diff --git a/packages/playwright/src/isomorphic/testTree.ts b/packages/playwright/src/isomorphic/testTree.ts index 64f414a763b6c..4a5cc55aee1e2 100644 --- a/packages/playwright/src/isomorphic/testTree.ts +++ b/packages/playwright/src/isomorphic/testTree.ts @@ -295,20 +295,7 @@ export class TestTree { } collectTestIds(treeItem?: TreeItem): Set { - const testIds = new Set(); - if (!treeItem) - return testIds; - - const visit = (treeItem: TreeItem) => { - if (treeItem.kind === 'case') - treeItem.tests.map(t => t.id).forEach(id => testIds.add(id)); - else if (treeItem.kind === 'test') - testIds.add(treeItem.id); - else - treeItem.children?.forEach(visit); - }; - visit(treeItem); - return testIds; + return treeItem ? collectTestIds(treeItem) : new Set(); } } @@ -349,4 +336,18 @@ export function sortAndPropagateStatus(treeItem: TreeItem) { treeItem.status = 'passed'; } +export function collectTestIds(treeItem: TreeItem): Set { + const testIds = new Set(); + const visit = (treeItem: TreeItem) => { + if (treeItem.kind === 'case') + treeItem.tests.map(t => t.id).forEach(id => testIds.add(id)); + else if (treeItem.kind === 'test') + testIds.add(treeItem.id); + else + treeItem.children?.forEach(visit); + }; + visit(treeItem); + return testIds; +} + export const statusEx = Symbol('statusEx'); diff --git a/packages/playwright/src/runner/tasks.ts b/packages/playwright/src/runner/tasks.ts index a8925084f4fb2..46d0ae4181756 100644 --- a/packages/playwright/src/runner/tasks.ts +++ b/packages/playwright/src/runner/tasks.ts @@ -85,7 +85,6 @@ export function createTaskRunnerForWatch(config: FullConfigInternal, reporter: R export function createTaskRunnerForTestServer(config: FullConfigInternal, reporter: ReporterV2): TaskRunner { const taskRunner = new TaskRunner(reporter, 0); - addGlobalSetupTasks(taskRunner, config); taskRunner.addTask('load tests', createLoadTask('out-of-process', { filterOnly: true, failOnLoadErrors: false, doNotRunDepsOutsideProjectFilter: true })); addRunTasks(taskRunner, config); return taskRunner;