diff --git a/package-lock.json b/package-lock.json index aa5e2cb4c..c07f988b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ }, "devDependencies": { "@babel/preset-typescript": "^7.23.2", - "@playwright/test": "1.42.1-beta-1709332975000", + "@playwright/test": "1.43.0-beta-1711554436000", "@types/babel__core": "^7.20.3", "@types/babel__helper-plugin-utils": "^7.10.2", "@types/babel__traverse": "^7.20.3", @@ -857,12 +857,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.42.1-beta-1709332975000", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.42.1-beta-1709332975000.tgz", - "integrity": "sha512-bSWWb3TFlrFUpNEKxdwNYiatkuDUxJwtYx0dlvs33mA4MOfzM4da9xJgd3ujmzaxFHhNlnvUrGqxUzQ2XHrdRA==", + "version": "1.43.0-beta-1711554436000", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.43.0-beta-1711554436000.tgz", + "integrity": "sha512-j4tokWU1MZovN5US681d9MvW6eVJ0wtRyLzCYyxo5MiG+wJOnHUZSsZewPTXx3YKGVWqX+hX1dB6qCglSVV02A==", "dev": true, "dependencies": { - "playwright": "1.42.1-beta-1709332975000" + "playwright": "1.43.0-beta-1711554436000" }, "bin": { "playwright": "cli.js" @@ -3749,12 +3749,12 @@ } }, "node_modules/playwright": { - "version": "1.42.1-beta-1709332975000", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.42.1-beta-1709332975000.tgz", - "integrity": "sha512-+Ngqdya/U5TbUKs8PbJ7NsWNv3fk+NaCdgl9kk9jaaDjgJ0OkbvvxUNEeMhXo9XWy3phPWPvrBWtZ9wMVQB+Jg==", + "version": "1.43.0-beta-1711554436000", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.43.0-beta-1711554436000.tgz", + "integrity": "sha512-Oynd6RVx5iXPhBPZNeDSvhOg7PHghqdock3YGK1+j5jTMS/Lud830xCAMkPobtp0gUr38emWsW35RD9tUYaVvA==", "dev": true, "dependencies": { - "playwright-core": "1.42.1-beta-1709332975000" + "playwright-core": "1.43.0-beta-1711554436000" }, "bin": { "playwright": "cli.js" @@ -3767,9 +3767,9 @@ } }, "node_modules/playwright-core": { - "version": "1.42.1-beta-1709332975000", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.42.1-beta-1709332975000.tgz", - "integrity": "sha512-haDeBMMDCFQZDs6eP8XnolxLmcDSPJCq28BZ0Lr25VWobv6Y1rUY13M3knveunj/YjGaywjjfT3uE4y4MP7drA==", + "version": "1.43.0-beta-1711554436000", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.43.0-beta-1711554436000.tgz", + "integrity": "sha512-jaDUmMC7tuRL4Qs19d9JN42hoQ4kFlvzFt94T8Dq5T5yVG5e7DUFoUguUmN+cxzcqBllYGRdDYgWu3X1gIkb/w==", "dev": true, "bin": { "playwright-core": "cli.js" @@ -5295,12 +5295,12 @@ "optional": true }, "@playwright/test": { - "version": "1.42.1-beta-1709332975000", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.42.1-beta-1709332975000.tgz", - "integrity": "sha512-bSWWb3TFlrFUpNEKxdwNYiatkuDUxJwtYx0dlvs33mA4MOfzM4da9xJgd3ujmzaxFHhNlnvUrGqxUzQ2XHrdRA==", + "version": "1.43.0-beta-1711554436000", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.43.0-beta-1711554436000.tgz", + "integrity": "sha512-j4tokWU1MZovN5US681d9MvW6eVJ0wtRyLzCYyxo5MiG+wJOnHUZSsZewPTXx3YKGVWqX+hX1dB6qCglSVV02A==", "dev": true, "requires": { - "playwright": "1.42.1-beta-1709332975000" + "playwright": "1.43.0-beta-1711554436000" } }, "@types/babel__core": { @@ -7315,19 +7315,19 @@ "dev": true }, "playwright": { - "version": "1.42.1-beta-1709332975000", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.42.1-beta-1709332975000.tgz", - "integrity": "sha512-+Ngqdya/U5TbUKs8PbJ7NsWNv3fk+NaCdgl9kk9jaaDjgJ0OkbvvxUNEeMhXo9XWy3phPWPvrBWtZ9wMVQB+Jg==", + "version": "1.43.0-beta-1711554436000", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.43.0-beta-1711554436000.tgz", + "integrity": "sha512-Oynd6RVx5iXPhBPZNeDSvhOg7PHghqdock3YGK1+j5jTMS/Lud830xCAMkPobtp0gUr38emWsW35RD9tUYaVvA==", "dev": true, "requires": { "fsevents": "2.3.2", - "playwright-core": "1.42.1-beta-1709332975000" + "playwright-core": "1.43.0-beta-1711554436000" } }, "playwright-core": { - "version": "1.42.1-beta-1709332975000", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.42.1-beta-1709332975000.tgz", - "integrity": "sha512-haDeBMMDCFQZDs6eP8XnolxLmcDSPJCq28BZ0Lr25VWobv6Y1rUY13M3knveunj/YjGaywjjfT3uE4y4MP7drA==", + "version": "1.43.0-beta-1711554436000", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.43.0-beta-1711554436000.tgz", + "integrity": "sha512-jaDUmMC7tuRL4Qs19d9JN42hoQ4kFlvzFt94T8Dq5T5yVG5e7DUFoUguUmN+cxzcqBllYGRdDYgWu3X1gIkb/w==", "dev": true }, "prebuild-install": { diff --git a/package.json b/package.json index 6b5a2cd1f..c10a56a50 100644 --- a/package.json +++ b/package.json @@ -121,8 +121,7 @@ "l10n": "npx @vscode/l10n-dev export -o ./l10n ./src", "vscode:prepublish": "npm run build", "lint": "tsc && eslint . --ext .ts,.tsx,.js", - "test": "playwright test --project=cli --project=cli-reuse", - "test-all": "playwright test", + "test": "playwright test", "package": "vsce package", "code": "code --uninstall-extension ms-playwright.playwright && code --install-extension playwright-0.2.11.vsix", "uncode": "code --uninstall-extension ms-playwright.playwright", @@ -131,7 +130,7 @@ }, "devDependencies": { "@babel/preset-typescript": "^7.23.2", - "@playwright/test": "1.42.1-beta-1709332975000", + "@playwright/test": "1.43.0-beta-1711554436000", "@types/babel__core": "^7.20.3", "@types/babel__helper-plugin-utils": "^7.10.2", "@types/babel__traverse": "^7.20.3", diff --git a/src/extension.ts b/src/extension.ts index 81b0422f1..cc90f2bc1 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -22,7 +22,7 @@ import * as reporterTypes from './upstream/reporter'; import { ReusedBrowser } from './reusedBrowser'; import { SettingsModel } from './settingsModel'; import { SettingsView } from './settingsView'; -import { TestModel, TestModelCollection, TestProject, projectFiles } from './testModel'; +import { TestModel, TestModelCollection, TestProject } from './testModel'; import { TestTree } from './testTree'; import { NodeJSNotFoundError, ansiToHtml, getPlaywrightInfo } from './utils'; import * as vscodeTypes from './vscodeTypes'; @@ -77,12 +77,6 @@ export class Extension implements RunHooks { private _settingsModel: SettingsModel; private _settingsView!: SettingsView; private _watchSupport: WatchSupport; - private _filesPendingListTests: { - files: Set, - timer: NodeJS.Timeout, - promise: Promise, - finishedCallback: () => void - } | undefined; private _diagnostics: vscodeTypes.DiagnosticCollection; private _treeItemObserver: TreeItemObserver; private _watchQueue = Promise.resolve(); @@ -145,9 +139,6 @@ export class Extension implements RunHooks { } dispose() { - clearTimeout(this._filesPendingListTests?.timer); - this._filesPendingListTests?.finishedCallback(); - delete this._filesPendingListTests; for (const d of this._disposables) d?.dispose?.(); } @@ -364,7 +355,7 @@ export class Extension implements RunHooks { break; } } - const { projects, locations, parametrizedTestTitle } = this._narrowDownProjectsAndLocations(runInfo.model, include); + const { projects, locations, parametrizedTestTitle } = this._narrowDownLocations(runInfo.model, include); if (locations && !locations.length) return; @@ -390,7 +381,7 @@ export class Extension implements RunHooks { } } - private _narrowDownProjectsAndLocations(model: TestModel, items: readonly vscodeTypes.TestItem[]): { projects: TestProject[], locations: string[] | null, parametrizedTestTitle: string | undefined } { + private _narrowDownLocations(model: TestModel, items: readonly vscodeTypes.TestItem[]): { projects: TestProject[], locations: string[] | null, parametrizedTestTitle: string | undefined } { if (!items.length) return { projects: model.enabledProjects(), locations: null, parametrizedTestTitle: undefined }; @@ -410,26 +401,18 @@ export class Extension implements RunHooks { } } - // Only pick projects that have tests matching test run request. const locations = new Set(); - const projectsWithFiles: TestProject[] = []; for (const item of items) { const itemFsPath = item.uri!.fsPath; - const projectsWithFile = model.enabledProjects().filter(project => { - const files = projectFiles(project); - for (const file of files.keys()) { - if (file.startsWith(itemFsPath)) - return true; + const enabledFiles = model.enabledFiles(); + for (const file of enabledFiles) { + if (file === itemFsPath || file.startsWith(itemFsPath)) { + const line = item.range ? ':' + (item.range.start.line + 1) : ''; + locations.add(item.uri!.fsPath + line); } - return false; - }); - if (!projectsWithFile.length) - continue; - const line = item.range ? ':' + (item.range.start.line + 1) : ''; - locations.add(item.uri!.fsPath + line); - projectsWithFiles.push(...projectsWithFile); + } } - return { projects: projectsWithFiles, locations: [...locations], parametrizedTestTitle }; + return { projects: model.enabledProjects(), locations: [...locations], parametrizedTestTitle }; } private async _resolveChildren(fileItem: vscodeTypes.TestItem | undefined): Promise { @@ -582,41 +565,9 @@ export class Extension implements RunHooks { await this._ensureTestsInAllModels(files); } - private _ensureTestsInAllModels(inputFiles: string[]): Promise { - // Perform coalescing listTests calls to avoid multiple - // 'list tests' processes running at the same time. - if (!inputFiles.length) - return Promise.resolve(); - - if (!this._filesPendingListTests) { - let finishedCallback!: () => void; - const promise = new Promise(f => finishedCallback = f); - const files = new Set(); - - const timer = setTimeout(async () => { - delete this._filesPendingListTests; - for (const model of this._models.enabledModels()) { - const filteredFiles = model.narrowDownFilesToEnabledProjects(files); - if (!filteredFiles.size) - continue; - await model.ensureTests([...filteredFiles]).catch(e => console.log(e)); - } - this._updateDiagnostics(); - finishedCallback(); - }, 0); - - this._filesPendingListTests = { - files, - finishedCallback, - promise, - timer, - }; - } - - for (const file of inputFiles) - this._filesPendingListTests.files.add(file); - - return this._filesPendingListTests.promise; + private async _ensureTestsInAllModels(inputFiles: string[]): Promise { + for (const model of this._models.enabledModels()) + await model.ensureTests(inputFiles); } private _updateDiagnostics() { @@ -699,9 +650,15 @@ export class Extension implements RunHooks { if (line.startsWith(' at ')) { // Render relative stack. for (const workspaceFolder of this._vscode.workspace.workspaceFolders || []) { - const prefix = ' at ' + workspaceFolder.uri.fsPath; - if (line.startsWith(prefix)) { - line = ' at ' + line.substring(prefix.length + 1); + const prefix1 = (' at ' + workspaceFolder.uri.fsPath + path.sep).toLowerCase(); + const prefix2 = (' at fn (' + workspaceFolder.uri.fsPath + path.sep).toLowerCase(); + const lowerLine = line.toLowerCase(); + if (lowerLine.startsWith(prefix1)) { + line = ' at ' + line.substring(prefix1.length); + break; + } + if (lowerLine.startsWith(prefix2)) { + line = ' at ' + line.substring(prefix2.length, line.length - 1); break; } } diff --git a/src/playwrightTestServer.ts b/src/playwrightTestServer.ts index 35cf214f4..5c25671c7 100644 --- a/src/playwrightTestServer.ts +++ b/src/playwrightTestServer.ts @@ -22,6 +22,7 @@ import { TeleReporterReceiver } from './upstream/teleReceiver'; import { TestServerConnection } from './upstream/testServerConnection'; import { startBackend } from './backend'; import type { PlaywrightTestOptions, PlaywrightTestRunOptions, TestConfig } from './playwrightTestTypes'; +import { escapeRegex } from './utils'; export class PlaywrightTestServer { private _vscode: vscodeTypes.VSCode; @@ -91,6 +92,8 @@ export class PlaywrightTestServer { return; if (!testServer) return; + // Locations are regular expressions. + locations = locations.map(escapeRegex); const { report } = await testServer.listTests({ locations }); const teleReceiver = new TeleReporterReceiver(reporter, { mergeProjects: true, @@ -107,6 +110,8 @@ export class PlaywrightTestServer { return; if (!testServer) return; + // Locations are regular expressions. + locations = locations.map(escapeRegex); testServer.runTests({ locations, ...options }); token.onCancellationRequested(() => { testServer.stopTestsNoReply({}); diff --git a/src/testModel.ts b/src/testModel.ts index 08d76855a..aaf8d16ad 100644 --- a/src/testModel.ts +++ b/src/testModel.ts @@ -66,6 +66,13 @@ export class TestModel { readonly tag: vscodeTypes.TestTag; private _errorByFile = new MultiMap(); private _options: TestModelOptions; + private _filesWithListedTests = new Set(); + private _filesPendingListTests: { + files: Set, + timer: NodeJS.Timeout, + promise: Promise, + finishedCallback: () => void + } | undefined; constructor(vscode: vscodeTypes.VSCode, workspaceFolder: string, configFile: string, playwrightInfo: { cli: string, version: number }, options: TestModelOptions) { this._vscode = vscode; @@ -79,6 +86,9 @@ export class TestModel { } reset() { + clearTimeout(this._filesPendingListTests?.timer); + this._filesPendingListTests?.finishedCallback(); + delete this._filesPendingListTests; this._projects.clear(); this._fileToSources.clear(); this._sourceToFile.clear(); @@ -106,17 +116,18 @@ export class TestModel { return [...this._projects.values()].filter(p => p.isEnabled); } - enabledFiles(): string[] { - const result: string[] = []; + enabledFiles(): Set { + const result = new Set(); for (const project of this.enabledProjects()) { const files = projectFiles(project); for (const file of files.keys()) - result.push(file); + result.add(file); } return result; } async _listFiles() { + this._filesWithListedTests.clear(); let report: ConfigListFilesReport; try { report = await this._playwrightTest.listFiles(); @@ -225,32 +236,49 @@ export class TestModel { if (created.length || deleted.length) await this._listFiles(); - if (changed.length) - await this.listTests(changed); - } - - async ensureTests(files: string[]) { - // Do not list tests if all files are already loaded, otherwise we - // end up with update loop when updating tests for visible editors. - let allFilesLoaded = true; - for (const project of this._projects.values()) { - const projectSuiteFiles = projectFiles(project); - for (const f of files) { - const fileSuite = projectSuiteFiles.get(f); - if (!fileSuite || (fileSuite as any)[listFilesFlag]) { - allFilesLoaded = false; - break; - } - } - if (!allFilesLoaded) - break; + if (changed.length) { + const changedWithListedTests = changed.filter(f => this._filesWithListedTests.has(f)); + for (const c of changedWithListedTests) + this._filesWithListedTests.delete(c); + await this.ensureTests(changedWithListedTests); + } + } + + async ensureTests(inputFiles: string[]): Promise { + const enabledFiles = this.enabledFiles(); + const filesToListTests = inputFiles.filter(f => enabledFiles.has(f) && !this._filesWithListedTests.has(f)); + if (!filesToListTests.length) + return; + + for (const file of filesToListTests) + this._filesWithListedTests.add(file); + + if (!this._filesPendingListTests) { + let finishedCallback!: () => void; + const promise = new Promise(f => finishedCallback = f); + const files = new Set(); + + const timer = setTimeout(async () => { + delete this._filesPendingListTests; + await this._listTests([...files]).catch(e => console.log(e)); + finishedCallback(); + }, 100); + + this._filesPendingListTests = { + files, + finishedCallback, + promise, + timer, + }; } - if (allFilesLoaded) - return []; - await this.listTests(files); + + for (const file of filesToListTests) + this._filesPendingListTests.files.add(file); + + return this._filesPendingListTests.promise; } - async listTests(files: string[]) { + private async _listTests(files: string[]) { const errors: reporterTypes.TestError[] = []; let rootSuite: reporterTypes.Suite | undefined; await this._playwrightTest.test(files, 'list', {}, { @@ -310,6 +338,7 @@ export class TestModel { for (const fileSuite of projectSuite.suites) { if (!fileSuite.allTests().length) continue; + this._filesWithListedTests.add(fileSuite.location!.file); const existingFileSuite = files.get(fileSuite.location!.file); if (!existingFileSuite || !existingFileSuite.allTests().length) files.set(fileSuite.location!.file, fileSuite); @@ -433,18 +462,6 @@ export class TestModel { async findRelatedTestFiles(files: string[]) { return await this._playwrightTest.findRelatedTestFiles(files); } - - narrowDownFilesToEnabledProjects(fileNames: Set) { - const result = new Set(); - for (const project of this.enabledProjects()) { - const files = projectFiles(project); - for (const fileName of fileNames) { - if (files.has(fileName)) - result.add(fileName); - } - } - return result; - } } export class TestModelCollection extends DisposableBase { diff --git a/tests/debug-tests.spec.ts b/tests/debug-tests.spec.ts index de1799010..13fefc385 100644 --- a/tests/debug-tests.spec.ts +++ b/tests/debug-tests.spec.ts @@ -42,7 +42,7 @@ test('should debug all tests', async ({ activate }) => { passed `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > debug -c playwright.config.js `); @@ -69,7 +69,7 @@ test('should debug one test', async ({ activate }) => { passed `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts > debug -c playwright.config.js tests/test.spec.ts:3 diff --git a/tests/decorations.spec.ts b/tests/decorations.spec.ts index 115de1742..fdc419335 100644 --- a/tests/decorations.spec.ts +++ b/tests/decorations.spec.ts @@ -63,7 +63,7 @@ test('should highlight steps while running', async ({ activate }) => { [5:18 - 5:18]: decorator #2 {"after":{"contentText":" — Xms"}} `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts > playwright test -c playwright.config.js diff --git a/tests/global-errors.spec.ts b/tests/global-errors.spec.ts index 749d2d388..3ed395099 100644 --- a/tests/global-errors.spec.ts +++ b/tests/global-errors.spec.ts @@ -68,7 +68,7 @@ test('should report error in global setup', async ({ activate }) => { globalSetup.ts:[3:21 - 3:21] Error: expect(`); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js `); diff --git a/tests/list-files.spec.ts b/tests/list-files.spec.ts index 4f1b23361..85590fc39 100644 --- a/tests/list-files.spec.ts +++ b/tests/list-files.spec.ts @@ -29,7 +29,7 @@ test('should list files', async ({ activate }) => { - tests - test.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js `); }); @@ -46,7 +46,7 @@ test('should list files top level if no testDir', async ({ activate }, testInfo) await expect(testController).toHaveTestTree(` - test.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js `); }); @@ -91,7 +91,7 @@ test('should list folders', async ({ activate }) => { - test-a.spec.ts - test-b.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js `); }); @@ -107,7 +107,7 @@ test('should pick new files', async ({ activate }) => { - test-1.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js `); @@ -122,7 +122,7 @@ test('should pick new files', async ({ activate }) => { - test-2.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright list-files -c playwright.config.js `); @@ -186,7 +186,7 @@ test('should remove deleted files', async ({ activate }) => { - test-3.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js `); @@ -201,7 +201,7 @@ test('should remove deleted files', async ({ activate }) => { - test-3.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright list-files -c playwright.config.js `); @@ -253,7 +253,7 @@ test('should support multiple projects', async ({ activate }) => { - test2.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js `); }); @@ -285,7 +285,7 @@ test('should switch between multiple projects with filter', async ({ activate }) - test1.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js `); @@ -308,7 +308,7 @@ test('should switch between multiple projects with filter', async ({ activate }) [x] project 2 `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js `); }); @@ -325,7 +325,7 @@ test('should list files in relative folder', async ({ activate }) => { - tests - test.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` foo/bar> playwright list-files -c playwright.config.js `); }); @@ -382,7 +382,7 @@ test('should ignore errors when listing files', async ({ activate }) => { - test.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright list-files -c playwright.config.ts `); diff --git a/tests/list-tests.spec.ts b/tests/list-tests.spec.ts index e658f5e20..0c34ca39e 100644 --- a/tests/list-tests.spec.ts +++ b/tests/list-tests.spec.ts @@ -34,7 +34,7 @@ test('should list tests on expand', async ({ activate }) => { - one [2:0] `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts `); @@ -64,7 +64,7 @@ test('should list tests for visible editors', async ({ activate }) => { - two [2:0] `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test1.spec.ts tests/test2.spec.ts `); @@ -121,7 +121,7 @@ test('should discover new tests', async ({ activate }) => { await testController.expandTestItems(/test.spec.ts/); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts `); @@ -142,7 +142,7 @@ test('should discover new tests', async ({ activate }) => { - two [3:0] `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts @@ -158,7 +158,7 @@ test('should discover new tests with active editor', async ({ activate }) => { `, }); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js `); @@ -167,6 +167,11 @@ test('should discover new tests with active editor', async ({ activate }) => { test('two', async () => {}); `); + await expect(vscode).toHaveExecLog(` + > playwright list-files -c playwright.config.js + > playwright list-files -c playwright.config.js + `); + await Promise.all([ new Promise(f => { testController.onDidChangeTestItem(ti => { @@ -184,7 +189,7 @@ test('should discover new tests with active editor', async ({ activate }) => { - two [2:0] `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test2.spec.ts @@ -220,7 +225,7 @@ test('should discover tests on add + change', async ({ activate }) => { - one [2:0] `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null test.spec.ts @@ -239,7 +244,7 @@ test('should discover new test at existing location', async ({ activate }) => { await testController.expandTestItems(/test.spec.ts/); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts `); @@ -258,7 +263,7 @@ test('should discover new test at existing location', async ({ activate }) => { - two [2:0] `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts @@ -277,7 +282,7 @@ test('should remove deleted tests', async ({ activate }) => { await testController.expandTestItems(/test.spec.ts/); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts `); @@ -303,7 +308,7 @@ test('should remove deleted tests', async ({ activate }) => { - one [2:0] `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts @@ -358,7 +363,7 @@ test('should regain tests after error is fixed', async ({ activate }) => { await testController.expandTestItems(/test.spec.ts/); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts `); @@ -384,7 +389,7 @@ test('should regain tests after error is fixed', async ({ activate }) => { - two [3:0] `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts @@ -425,7 +430,7 @@ test('should support multiple configs', async ({ activate }) => { - two [2:0] `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` tests1> playwright list-files -c playwright.config.js tests2> playwright list-files -c playwright.config.js tests1> playwright test -c playwright.config.js --list --reporter=null test.spec.ts @@ -469,7 +474,7 @@ test('should support multiple projects', async ({ activate }) => { - test2.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test1.spec.ts `); diff --git a/tests/project-setup.spec.ts b/tests/project-setup.spec.ts index aab16a637..5821a89e3 100644 --- a/tests/project-setup.spec.ts +++ b/tests/project-setup.spec.ts @@ -47,12 +47,14 @@ const testsWithSetup = { `, }; -test('should run setup and teardown projects (1)', async ({ activate }) => { - const { vscode, testController } = await activate(testsWithSetup); - await enableProjects(vscode, ['setup', 'teardown', 'test']); - const testRun = await testController.run(); +test.describe(() => { + test.skip(({ useTestServer }) => !useTestServer); + test('should run setup and teardown projects (1)', async ({ activate }) => { + const { vscode, testController } = await activate(testsWithSetup); + await enableProjects(vscode, ['setup', 'teardown', 'test']); + const testRun = await testController.run(); - await expect(testController).toHaveTestTree(` + await expect(testController).toHaveTestTree(` - setup.ts - ✅ setup [2:0] - teardown.ts @@ -61,63 +63,78 @@ test('should run setup and teardown projects (1)', async ({ activate }) => { - ✅ test [2:0] `); - const output = testRun.renderLog({ output: true }); - expect(output).toContain('from-setup'); - expect(output).toContain('from-test'); - expect(output).toContain('from-teardown'); -}); + const output = testRun.renderLog({ output: true }); + expect(output).toContain('from-setup'); + expect(output).toContain('from-test'); + expect(output).toContain('from-teardown'); + }); -test('should run setup and teardown projects (2)', async ({ activate }) => { - test.fixme(); - const { vscode, testController } = await activate(testsWithSetup); - await enableProjects(vscode, ['teardown', 'test']); - const testRun = await testController.run(); + test('should run setup and teardown projects (2)', async ({ activate }) => { + const { vscode, testController } = await activate(testsWithSetup); + await enableProjects(vscode, ['teardown', 'test']); + const testRun = await testController.run(); - await expect(testController).toHaveTestTree(` - - test.ts - - ✅ test [2:0] + await expect(testController).toHaveTestTree(` - teardown.ts - ✅ teardown [2:0] + - test.ts + - ✅ test [2:0] `); - const output = testRun.renderLog({ output: true }); - expect(output).not.toContain('from-setup'); - expect(output).toContain('from-test'); - expect(output).toContain('from-teardown'); -}); + const output = testRun.renderLog({ output: true }); + expect(output).not.toContain('from-setup'); + expect(output).toContain('from-test'); + expect(output).toContain('from-teardown'); + }); -test('should run setup and teardown projects (3)', async ({ activate }) => { - test.fixme(); - const { vscode, testController } = await activate(testsWithSetup); - await enableProjects(vscode, ['teardown', 'test']); - const testRun = await testController.run(); + test('should run setup and teardown projects (3)', async ({ activate }) => { + const { vscode, testController } = await activate(testsWithSetup); + await enableProjects(vscode, ['test']); + const testRun = await testController.run(); - await expect(testController).toHaveTestTree(` + await expect(testController).toHaveTestTree(` - test.ts - ✅ test [2:0] `); - const output = testRun.renderLog({ output: true }); - expect(output).not.toContain('from-setup'); - expect(output).toContain('from-test'); - expect(output).not.toContain('from-teardown'); + const output = testRun.renderLog({ output: true }); + expect(output).not.toContain('from-setup'); + expect(output).toContain('from-test'); + expect(output).not.toContain('from-teardown'); + }); + + test('should run part of the setup only', async ({ activate }) => { + const { vscode, testController } = await activate(testsWithSetup); + await enableProjects(vscode, ['setup', 'teardown', 'test']); + + await testController.expandTestItems(/setup.ts/); + const testItems = testController.findTestItems(/setup/); + await testController.run(testItems); + + await expect(testController).toHaveTestTree(` + - setup.ts + - ✅ setup [2:0] + - teardown.ts + - ✅ teardown [2:0] + - test.ts + `); + }); }); -test('should run part of the setup only', async ({ activate }) => { - test.fixme(); +test('should run setup and teardown for test', async ({ activate }) => { const { vscode, testController } = await activate(testsWithSetup); await enableProjects(vscode, ['setup', 'teardown', 'test']); - await testController.expandTestItems(/setup.ts/); - const testItems = testController.findTestItems(/setup/); + await testController.expandTestItems(/test.ts/); + const testItems = testController.findTestItems(/test/); await testController.run(testItems); await expect(testController).toHaveTestTree(` - - ✅ setup.ts - ✅ setup [2:0] - - ✅ teardown.ts - ✅ teardown [2:0] - - ◯ test.ts - ◯ test [2:0] + - setup.ts + - ✅ setup [2:0] + - teardown.ts + - ✅ teardown [2:0] + - test.ts + - ✅ test [2:0] `); }); diff --git a/tests/project-tree.spec.ts b/tests/project-tree.spec.ts index 8ce0d5913..6a448ee11 100644 --- a/tests/project-tree.spec.ts +++ b/tests/project-tree.spec.ts @@ -40,7 +40,7 @@ test('should switch between configs', async ({ activate }) => { [ ] projectTwo `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` tests1> playwright list-files -c playwright.config.js `); @@ -56,7 +56,7 @@ test('should switch between configs', async ({ activate }) => { - tests2 - test.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` tests1> playwright list-files -c playwright.config.js tests2> playwright list-files -c playwright.config.js `); diff --git a/tests/run-annotations.spec.ts b/tests/run-annotations.spec.ts index 798739ad9..73c8657ad 100644 --- a/tests/run-annotations.spec.ts +++ b/tests/run-annotations.spec.ts @@ -55,7 +55,7 @@ test('should mark test as skipped', async ({ activate }) => { passed `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js `); diff --git a/tests/run-tests.spec.ts b/tests/run-tests.spec.ts index 20f786099..a40038727 100644 --- a/tests/run-tests.spec.ts +++ b/tests/run-tests.spec.ts @@ -53,7 +53,7 @@ test('should run all tests', async ({ activate }) => { passed `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js `); @@ -86,7 +86,7 @@ test('should run one test', async ({ activate }) => { passed `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts > playwright test -c playwright.config.js tests/test.spec.ts:3 @@ -149,7 +149,7 @@ test('should run file', async ({ activate }) => { passed `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js tests/test.spec.ts `); @@ -183,7 +183,7 @@ test('should run folder', async ({ activate }) => { passed `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js tests/folder `); @@ -316,7 +316,7 @@ test('should only create test run if file belongs to context', async ({ activate expect(testRuns).toHaveLength(1); } - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` tests1> playwright list-files -c playwright.config.js tests2> playwright list-files -c playwright.config.js tests1> playwright test -c playwright.config.js test1.spec.ts @@ -329,7 +329,7 @@ test('should only create test run if file belongs to context', async ({ activate expect(testRuns).toHaveLength(1); } - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` tests1> playwright list-files -c playwright.config.js tests2> playwright list-files -c playwright.config.js tests1> playwright test -c playwright.config.js test1.spec.ts @@ -368,7 +368,7 @@ test('should only create test run if folder belongs to context', async ({ activa const items = testController.findTestItems(/foo1/); await profile.run(items); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` tests1> playwright list-files -c playwright.config.js tests2> playwright list-files -c playwright.config.js tests1> playwright test -c playwright.config.js foo1 @@ -394,7 +394,7 @@ test('should run all projects at once', async ({ activate }) => { const profile = testController.runProfile(); await profile.run(); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --project=projectOne --project=projectTwo `); @@ -448,14 +448,12 @@ test('should group projects by config', async ({ activate }) => { await testController.runProfile().run(); - await expect(() => { - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` tests1> playwright list-files -c playwright.config.js tests2> playwright list-files -c playwright.config.js tests1> playwright test -c playwright.config.js --project=projectOne --project=projectTwo tests2> playwright test -c playwright.config.js --project=projectOne --project=projectTwo `); - }).toPass(); }); test('should stop', async ({ activate, showBrowser }) => { @@ -581,7 +579,7 @@ test('should run all parametrized tests', async ({ activate }) => { passed `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts > playwright test -c playwright.config.js tests/test.spec.ts:4 @@ -611,7 +609,7 @@ test('should run one parametrized test', async ({ activate }) => { passed `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts > playwright test -c playwright.config.js --grep=test two tests/test.spec.ts:4 @@ -649,7 +647,7 @@ test('should run one parametrized groups', async ({ activate }) => { passed `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts > playwright test -c playwright.config.js --grep=group three tests/test.spec.ts:4 @@ -683,7 +681,7 @@ test('should run tests in parametrized groups', async ({ activate }) => { passed `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts > playwright test -c playwright.config.js --grep=level 1 tests/test.spec.ts:4 @@ -700,7 +698,7 @@ test('should run tests in parametrized groups', async ({ activate }) => { passed `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts > playwright test -c playwright.config.js --grep=level 1 tests/test.spec.ts:4 @@ -719,7 +717,7 @@ test('should list tests in relative folder', async ({ activate }) => { await testController.expandTestItems(/test.spec/); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` foo/bar> playwright list-files -c playwright.config.js foo/bar> playwright test -c playwright.config.js --list --reporter=null ../../tests/test.spec.ts `); @@ -759,7 +757,7 @@ test('should filter selected project', async ({ activate }) => { passed `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --project=project 1 tests1/test.spec.ts `); @@ -790,7 +788,7 @@ test('should report project-specific failures', async ({ activate }) => { testController.onDidCreateTestRun(run => testRuns.push(run)); await profile.run(); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --project=projectA --project=projectB --project=projectC `); diff --git a/tests/source-map.spec.ts b/tests/source-map.spec.ts index 0db6940f8..94a20e877 100644 --- a/tests/source-map.spec.ts +++ b/tests/source-map.spec.ts @@ -27,7 +27,7 @@ test('should list files', async ({ activate }) => { - tests - test.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js `); }); @@ -48,7 +48,7 @@ test('should list tests on expand', async ({ activate }) => { - two [3:0] `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts `); @@ -72,7 +72,7 @@ test('should list tests for visible editors', async ({ activate }) => { - two [3:0] `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts `); @@ -91,7 +91,7 @@ test('should pick new files', async ({ activate }) => { - test-1.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js `); @@ -108,7 +108,7 @@ test('should pick new files', async ({ activate }) => { - test-2.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright list-files -c playwright.config.js `); @@ -135,7 +135,7 @@ test('should remove deleted files', async ({ activate }) => { - test-3.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js `); @@ -152,7 +152,7 @@ test('should remove deleted files', async ({ activate }) => { - test-3.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright list-files -c playwright.config.js `); @@ -168,7 +168,7 @@ test('should discover new tests', async ({ activate }) => { await testController.expandTestItems(/test.spec.ts/); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts `); @@ -188,10 +188,10 @@ test('should discover new tests', async ({ activate }) => { - two [4:0] `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts - > playwright test -c playwright.config.js --list --reporter=null build/test.spec.js.map tests/test.spec.ts + > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts `); }); @@ -215,7 +215,7 @@ test('should run all tests', async ({ activate }) => { passed `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js `); @@ -241,7 +241,7 @@ test('should run one test', async ({ activate }) => { passed `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts > playwright test -c playwright.config.js tests/test.spec.ts:3 diff --git a/tests/track-configs.spec.ts b/tests/track-configs.spec.ts index 77b97ca17..a7d4b5f5b 100644 --- a/tests/track-configs.spec.ts +++ b/tests/track-configs.spec.ts @@ -32,7 +32,7 @@ test('should load first config', async ({ activate }) => { - test.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js `); }); @@ -64,7 +64,7 @@ test('should load second config', async ({ activate }) => { - test.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright1.config.js > playwright list-files -c playwright1.config.js > playwright list-files -c playwright2.config.js @@ -101,7 +101,7 @@ test('should remove model for config', async ({ activate }) => { - test.spec.ts `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright1.config.js > playwright list-files -c playwright2.config.js > playwright list-files -c playwright2.config.js diff --git a/tests/utils.ts b/tests/utils.ts index b6739f585..e62767d8e 100644 --- a/tests/utils.ts +++ b/tests/utils.ts @@ -52,11 +52,11 @@ export const expect = baseExpect.extend({ } }, - toHaveExecLog(vscode: VSCode, expectedLog: string) { + async toHaveExecLog(vscode: VSCode, expectedLog: string) { if (vscode.extensions[0]._settingsModel.useTestServer.get()) return { pass: true, message: () => '' }; try { - expect(vscode.renderExecLog(' ')).toBe(expectedLog); + await expect.poll(() => vscode.renderExecLog(' ')).toBe(expectedLog); return { pass: true, message: () => '' }; } catch (e) { return { diff --git a/tests/watch.spec.ts b/tests/watch.spec.ts index 2cc81cdee..09c8319eb 100644 --- a/tests/watch.spec.ts +++ b/tests/watch.spec.ts @@ -48,15 +48,13 @@ test('should watch all tests', async ({ activate }) => { expect(testRun.renderLog()).toBe(` tests > test-1.spec.ts > should pass [2:0] - enqueued enqueued started passed `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js - > playwright test -c playwright.config.js --list --reporter=null tests/test-1.spec.ts > playwright find-related-test-files -c playwright.config.js > playwright test -c playwright.config.js tests/test-1.spec.ts `); @@ -90,9 +88,8 @@ test('should unwatch all tests', async ({ activate }) => { expect(testRuns).toHaveLength(0); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js - > playwright test -c playwright.config.js --list --reporter=null tests/test-1.spec.ts `); }); @@ -128,7 +125,6 @@ test('should watch test file', async ({ activate }) => { expect(testRun.renderLog()).toBe(` tests > test-2.spec.ts > should pass [2:0] - enqueued enqueued started passed @@ -169,7 +165,7 @@ test.skip('should watch tests via helper', async ({ activate }) => { failed `); - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright find-related-test-files -c playwright.config.js > playwright test -c playwright.config.js tests/test.spec.ts @@ -212,7 +208,7 @@ test('should watch test in a file', async ({ activate }) => { // first --list is for expand // second --list is for workspace change - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts @@ -262,7 +258,7 @@ test('should watch two tests in a file', async ({ activate }) => { // first --list is for expand // second --list is for workspace change - expect(vscode).toHaveExecLog(` + await expect(vscode).toHaveExecLog(` > playwright list-files -c playwright.config.js > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts > playwright test -c playwright.config.js --list --reporter=null tests/test.spec.ts