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 { runUIMode } from './uiMode';
|
||||||
import { InternalReporter } from '../reporters/internalReporter';
|
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 {
|
export class Runner {
|
||||||
private _config: FullConfigInternal;
|
private _config: FullConfigInternal;
|
||||||
|
|
||||||
@ -35,17 +47,6 @@ export class Runner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async listTestFiles(projectNames: string[] | undefined): Promise<any> {
|
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 projects = filterProjects(this._config.projects, projectNames);
|
||||||
const report: ConfigListFilesReport = {
|
const report: ConfigListFilesReport = {
|
||||||
projects: []
|
projects: []
|
||||||
@ -54,6 +55,7 @@ export class Runner {
|
|||||||
report.projects.push({
|
report.projects.push({
|
||||||
name: project.project.name,
|
name: project.project.name,
|
||||||
testDir: project.project.testDir,
|
testDir: project.project.testDir,
|
||||||
|
outputDir: project.project.outputDir,
|
||||||
use: { testIdAttribute: project.project.use.testIdAttribute },
|
use: { testIdAttribute: project.project.use.testIdAttribute },
|
||||||
files: await collectFilesForProject(project)
|
files: await collectFilesForProject(project)
|
||||||
});
|
});
|
||||||
|
@ -31,6 +31,7 @@ test('should list files', async ({ runListFiles }) => {
|
|||||||
{
|
{
|
||||||
name: 'foo',
|
name: 'foo',
|
||||||
testDir: expect.stringContaining('list-files-should-list-files-playwright-test'),
|
testDir: expect.stringContaining('list-files-should-list-files-playwright-test'),
|
||||||
|
outputDir: expect.stringContaining('list-files-should-list-files-playwright-test/test-results'),
|
||||||
use: {},
|
use: {},
|
||||||
files: [
|
files: [
|
||||||
expect.stringContaining('a.test.js')
|
expect.stringContaining('a.test.js')
|
||||||
@ -39,6 +40,7 @@ test('should list files', async ({ runListFiles }) => {
|
|||||||
{
|
{
|
||||||
name: 'bar',
|
name: 'bar',
|
||||||
testDir: expect.stringContaining('list-files-should-list-files-playwright-test'),
|
testDir: expect.stringContaining('list-files-should-list-files-playwright-test'),
|
||||||
|
outputDir: expect.stringContaining('list-files-should-list-files-playwright-test/test-results'),
|
||||||
use: {},
|
use: {},
|
||||||
files: [
|
files: [
|
||||||
expect.stringContaining('a.test.js')
|
expect.stringContaining('a.test.js')
|
||||||
@ -65,6 +67,7 @@ test('should include testIdAttribute', async ({ runListFiles }) => {
|
|||||||
{
|
{
|
||||||
name: '',
|
name: '',
|
||||||
testDir: expect.stringContaining('list-files-should-include-testIdAttribute-playwright-test'),
|
testDir: expect.stringContaining('list-files-should-include-testIdAttribute-playwright-test'),
|
||||||
|
outputDir: expect.stringContaining('list-files-should-include-testIdAttribute-playwright-test/test-results'),
|
||||||
use: {
|
use: {
|
||||||
testIdAttribute: 'myid'
|
testIdAttribute: 'myid'
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user