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

This commit is contained in:
Pavel Feldman 2023-05-25 15:38:35 -07:00 committed by GitHub
parent 00b34dddb2
commit f879ac7e44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 11 deletions

View File

@ -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)
});

View File

@ -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'
},