From 8dd0312a301ede5f9ffe4729154b23f5d9c44cec Mon Sep 17 00:00:00 2001 From: Dominik Jelinek Date: Wed, 10 Apr 2024 21:00:46 +0200 Subject: [PATCH] tmp Signed-off-by: Dominik Jelinek --- .../test-project/src/test/editor/textEditor.test.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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); });