mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: report output dir as a part of the list files (#23283)
This commit is contained in:
parent
00b34dddb2
commit
f879ac7e44
@ -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)
|
||||
});
|
||||
|
@ -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'
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user