From 428b86a9a6b77f3ccc7a3326e954c8c3dddad84f Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 22 Dec 2023 09:38:40 -0800 Subject: [PATCH] Revert "fix: respect .only in --list mode" This reverts commit 9a5bfc54e5af2ee0ad7308fb5abcd57e0562e97c. As it breaks extension. Reference #28709 --- packages/playwright/src/runner/tasks.ts | 2 +- tests/playwright-test/list-mode.spec.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/playwright/src/runner/tasks.ts b/packages/playwright/src/runner/tasks.ts index 7127f35ec2da0..7f874aef4e9c8 100644 --- a/packages/playwright/src/runner/tasks.ts +++ b/packages/playwright/src/runner/tasks.ts @@ -102,7 +102,7 @@ function addRunTasks(taskRunner: TaskRunner, config: FullConfigInternal export function createTaskRunnerForList(config: FullConfigInternal, reporter: ReporterV2, mode: 'in-process' | 'out-of-process', options: { failOnLoadErrors: boolean }): TaskRunner { const taskRunner = new TaskRunner(reporter, config.config.globalTimeout); - taskRunner.addTask('load tests', createLoadTask(mode, { ...options, filterOnly: true })); + taskRunner.addTask('load tests', createLoadTask(mode, { ...options, filterOnly: false })); taskRunner.addTask('report begin', createReportBeginTask()); return taskRunner; } diff --git a/tests/playwright-test/list-mode.spec.ts b/tests/playwright-test/list-mode.spec.ts index 80e21fd8f23f5..1388b38dd9e30 100644 --- a/tests/playwright-test/list-mode.spec.ts +++ b/tests/playwright-test/list-mode.spec.ts @@ -152,8 +152,7 @@ test('should report errors', async ({ runInlineTest }) => { expect(result.output).toContain('> 3 | oh = 2;'); }); -test('should respect .only', async ({ runInlineTest }) => { - test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28709' }); +test('should ignore .only', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` const { test, expect } = require('@playwright/test'); @@ -168,8 +167,9 @@ test('should respect .only', async ({ runInlineTest }) => { expect(result.exitCode).toBe(0); expect(result.output).toContain([ `Listing tests:`, + ` a.test.js:3:7 › example1`, ` a.test.js:6:12 › example2`, - `Total: 1 test in 1 file` + `Total: 2 tests in 1 file` ].join('\n')); });