Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: report output dir as a part of the list files (#23283)

Pavel Feldmanf879ac7e44ba
diff --git a/packages/playwright-test/src/runner/runner.ts b/packages/playwright-test/src/runner/runner.ts
index 8f4a33d333..f42910c6c4 100644
--- a/packages/playwright-test/src/runner/runner.ts
+++ b/packages/playwright-test/src/runner/runner.ts
@@ -27,6 +27,18 @@ import { runWatchModeLoop } from './watchMode';
import { runUIMode } from './uiMode';
import { InternalReporter } from '../reporters/internalReporter';
+type ProjectConfigWithFiles = {
+ name: string;
+ testDir: string;
+ outputDir: string;
+ use: { testIdAttribute?: string };
+ files: string[];
+};
+
+type ConfigListFilesReport = {
+ projects: ProjectConfigWithFiles[];
+};
+
export class Runner {
private _config: FullConfigInternal;
@@ -35,17 +47,6 @@ export class Runner {
}
async listTestFiles(projectNames: string[] | undefined): Promise<any> {
- type ProjectConfigWithFiles = {
- name: string;
- testDir: string;
- use: { testIdAttribute?: string };
- files: string[];
- };
-
- type ConfigListFilesReport = {
- projects: ProjectConfigWithFiles[];
- };
-
const projects = filterProjects(this._config.projects, projectNames);
const report: ConfigListFilesReport = {
projects: []
@@ -54,6 +55,7 @@ export class Runner {
report.projects.push({
name: project.project.name,
testDir: project.project.testDir,
+ outputDir: project.project.outputDir,
use: { testIdAttribute: project.project.use.testIdAttribute },
files: await collectFilesForProject(project)
});
diff --git a/tests/playwright-test/list-files.spec.ts b/tests/playwright-test/list-files.spec.ts
index 263d11a226..40945197d8 100644
--- a/tests/playwright-test/list-files.spec.ts
+++ b/tests/playwright-test/list-files.spec.ts
@@ -31,6 +31,7 @@ test('should list files', async ({ runListFiles }) => {
{
name: 'foo',
testDir: expect.stringContaining('list-files-should-list-files-playwright-test'),
+ outputDir: expect.stringContaining('list-files-should-list-files-playwright-test/test-results'),
use: {},
files: [
expect.stringContaining('a.test.js')
@@ -39,6 +40,7 @@ test('should list files', async ({ runListFiles }) => {
{
name: 'bar',
testDir: expect.stringContaining('list-files-should-list-files-playwright-test'),
+ outputDir: expect.stringContaining('list-files-should-list-files-playwright-test/test-results'),
use: {},
files: [
expect.stringContaining('a.test.js')
@@ -65,6 +67,7 @@ test('should include testIdAttribute', async ({ runListFiles }) => {
{
name: '',
testDir: expect.stringContaining('list-files-should-include-testIdAttribute-playwright-test'),
+ outputDir: expect.stringContaining('list-files-should-include-testIdAttribute-playwright-test/test-results'),
use: {
testIdAttribute: 'myid'
},