diff --git a/packages/playwright/src/runner/reporters.ts b/packages/playwright/src/runner/reporters.ts index cf0327ac72..c077cef99d 100644 --- a/packages/playwright/src/runner/reporters.ts +++ b/packages/playwright/src/runner/reporters.ts @@ -80,7 +80,8 @@ export async function createReporters(config: FullConfigInternal, mode: 'list' | if (!isTestServer && (mode === 'test' || mode === 'merge')) { // If we are not in the test server, always add a last-run reporter. - reporters.push(new LastRunReporter(runOptions)); + const lastRunOutputFile = config.projects.length >= 0 ? path.join(config.projects[0].project.outputDir, '.last-run.json') : undefined; + reporters.push(new LastRunReporter({ ...runOptions, outputFile: lastRunOutputFile })); } return reporters;