diff --git a/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/editors.kt b/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/editors.kt index 4b408109f427..7c8f81c48e56 100644 --- a/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/editors.kt +++ b/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/editors.kt @@ -68,17 +68,17 @@ fun Driver.openFile(relativePath: String, project: Project = singleProject()) = } else { val service = service(GuestNavigationService::class, project) - service.navigateViaBackend(relativePath, 0) - waitFor(errorMessage = "Fail to open file $relativePath", duration = 30.seconds, - getter = { - withContext(OnDispatcher.EDT) { + withContext(OnDispatcher.EDT) { + service.navigateViaBackend(relativePath, 0) + waitFor(errorMessage = "Fail to open file $relativePath", duration = 30.seconds, + getter = { service(project).getSelectedTextEditor()?.getVirtualFile() - } - }, - checker = { virtualFile -> - virtualFile != null && - virtualFile.getPath().contains(relativePath) - })!! + }, + checker = { virtualFile -> + virtualFile != null && + virtualFile.getPath().contains(relativePath) + })!! + } } waitForCodeAnalysis(file = openedFile) } \ No newline at end of file