diff --git a/tests/test-project/src/test/editor/textEditor.test.ts b/tests/test-project/src/test/editor/textEditor.test.ts index 38059697b..41d5121d1 100644 --- a/tests/test-project/src/test/editor/textEditor.test.ts +++ b/tests/test-project/src/test/editor/textEditor.test.ts @@ -1,6 +1,6 @@ import * as path from 'path'; import { expect } from 'chai'; -import { TextEditor, EditorView, StatusBar, InputBox, ContentAssist, Workbench, FindWidget, VSBrowser, after, before } from "vscode-extension-tester"; +import { TextEditor, EditorView, StatusBar, InputBox, ContentAssist, Workbench, FindWidget, VSBrowser, after, before, afterEach, beforeEach } from "vscode-extension-tester"; describe.only('ContentAssist', async function () { let assist: ContentAssist; @@ -154,13 +154,18 @@ describe.only('TextEditor', function () { params.forEach(param => describe(`file using ${param.spaces}`, function () { let editor: TextEditor; + let ew: EditorView; - before(async function() { + beforeEach(async function() { await VSBrowser.instance.openResources(path.resolve(__dirname, '..', '..', '..', 'resources', param.file)); - editor = new TextEditor(); + ew = new EditorView(); + await ew.getDriver().wait(async function () { + return (await ew.getOpenEditorTitles()).includes(param.file); + }, 10_000); + editor = await ew.openEditor(param.file) as TextEditor; }); - after(async function() { + afterEach(async function() { await new EditorView().closeEditor(param.file); });