[gui-test] GUI-114 execute get current file name on edt

This commit is contained in:
Artem Gainanov
2018-05-30 15:26:05 +07:00
parent 99db6052eb
commit dd07de149d
@@ -84,8 +84,15 @@ public class FileEditorFixture extends EditorFixture {
*/
@Nullable
public String getCurrentFileName() {
VirtualFile currentFile = getCurrentFile();
return currentFile != null ? currentFile.getName() : null;
final String[] fileName = {null};
execute(new GuiTask() {
@Override
protected void executeInEDT() throws Throwable {
VirtualFile currentFile = getCurrentFile();
fileName[0] = currentFile != null ? currentFile.getName() : null;
}
});
return fileName[0];
}
/**
@@ -367,5 +374,4 @@ public class FileEditorFixture extends EditorFixture {
public Boolean hasTab(@NotNull final String tabName) {
return tabs.hasTab(tabName);
}
}