fix(playwright): move HTML reporter output folder outside test-results dir#132
Conversation
…s dir Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a Playwright configuration clash by moving the HTML reporter output directory outside the test artifacts output directory, so Playwright no longer aborts when it tries to clear the HTML report folder.
Changes:
- Set an explicit Playwright
outputDirto./test-resultsfor test artifacts. - Move the HTML reporter
outputFolderto./playwright-report(outside./test-results).
svelte-frontend/playwright.config.js
Outdated
| outputDir: './test-results', | ||
| reporter: [ | ||
| ['html', { outputFolder: './test-results/playwright-report' }], | ||
| ['html', { outputFolder: './playwright-report' }], |
There was a problem hiding this comment.
outputFolder: './playwright-report' points at a directory that already contains a checked-in Playwright HTML report (svelte-frontend/playwright-report/index.html). The HTML reporter clears its output folder before generating the report, so running tests will delete/overwrite that tracked file and leave local working trees dirty. Consider either (a) moving the reporter output to a new, untracked directory name (e.g. a dedicated ./playwright-report-output), or (b) removing the committed playwright-report/ artifacts from the repo so the folder is purely generated/ignored.
| ['html', { outputFolder: './playwright-report' }], | |
| ['html', { outputFolder: './playwright-report-output' }], |
|
@copilot apply changes based on the comments in this thread |
…t to avoid tracked file conflict Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
Done in 7e591f2. Changed the HTML reporter |
Playwright aborts with a configuration error when the HTML reporter
outputFolderis nested inside the testoutputDir— it clears the HTML folder before generating the report, destroying artifacts stored in the parent dir.Description
svelte-frontend/playwright.config.js:./test-results/playwright-report→./playwright-report-output(avoids conflict with the committedplaywright-report/index.htmlartifact)outputDir: './test-results'to anchor test artifacts directory.gitignore:svelte-frontend/playwright-report-output/to prevent generated HTML report artifacts from being committedRelated Issues
Test Evidence
npx playwright test --listresolves cleanly — no configuration clash error, all 60+ tests enumerated successfully. The new./playwright-report-outputdirectory does not conflict with the trackedplaywright-report/index.htmlfile, and is excluded from version control via.gitignore.Checklist
pytest tests/)black .andisort .)Original prompt
This pull request was created from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.