Skip to content

fix(playwright): move HTML reporter output folder outside test-results dir#132

Merged
Steake merged 3 commits intocopilot/resolve-merge-conflicts-129from
copilot/fix-playwright-output-folder-issue
Mar 8, 2026
Merged

fix(playwright): move HTML reporter output folder outside test-results dir#132
Steake merged 3 commits intocopilot/resolve-merge-conflicts-129from
copilot/fix-playwright-output-folder-issue

Conversation

Copy link
Contributor

Copilot AI commented Mar 8, 2026

Playwright aborts with a configuration error when the HTML reporter outputFolder is nested inside the test outputDir — it clears the HTML folder before generating the report, destroying artifacts stored in the parent dir.

Description

  • svelte-frontend/playwright.config.js:

    • Move HTML reporter output from ./test-results/playwright-report./playwright-report-output (avoids conflict with the committed playwright-report/index.html artifact)
    • Add explicit outputDir: './test-results' to anchor test artifacts directory
  • .gitignore:

    • Add svelte-frontend/playwright-report-output/ to prevent generated HTML report artifacts from being committed
+  outputDir: './test-results',
   reporter: [
-    ['html', { outputFolder: './test-results/playwright-report' }],
+    ['html', { outputFolder: './playwright-report-output' }],
     ['json', { outputFile: './test-results/test-results.json' }],

Related Issues

Test Evidence

npx playwright test --list resolves cleanly — no configuration clash error, all 60+ tests enumerated successfully. The new ./playwright-report-output directory does not conflict with the tracked playwright-report/index.html file, and is excluded from version control via .gitignore.

Checklist

  • Tests pass locally (pytest tests/)
  • Code is formatted (black . and isort .)
  • Documentation updated (if applicable)
  • No secrets or credentials committed
  • Related issue linked above
Original prompt

Create a small fix PR branched off PR #130's head branch (copilot/resolve-merge-conflicts-129) to fix the failing GitHub Actions job in workflow .github/workflows/frontend.yml.

Context:

  • Failing job logs (Actions run 22819926375, job 66191041249) show Playwright aborting with:
    • Configuration Error: HTML reporter output folder clashes with the tests output folder
    • HTML reporter will clear its output directory prior to being generated, which will lead to the artifact loss.
  • The workflow runs in svelte-frontend and executes npm test (which runs playwright test).

Root cause:

  • In svelte-frontend/playwright.config.js, the HTML reporter output folder is configured inside the test results output folder:
    • ['html', { outputFolder: './test-results/playwright-report' }]
    • JSON output is ./test-results/test-results.json
  • Playwright disallows the HTML report output directory being inside the test results output directory.

Required change:

  1. Update svelte-frontend/playwright.config.js so the HTML reporter output folder is NOT under ./test-results.
    • Change it to ./playwright-report (relative to svelte-frontend).
  2. Keep JSON output in ./test-results/test-results.json.
  3. (Optional but preferred) Add outputDir: './test-results' to make the test output dir explicit (ensure it does not reintroduce the clash).

Acceptance criteria:

  • CI no longer fails with the Playwright configuration error about output folder clash.
  • npm test proceeds past Playwright configuration and starts/runs tests.
  • Keep the change minimal and limited to the Playwright config.

References:

  • Workflow: .github/workflows/frontend.yml
  • Playwright config: svelte-frontend/playwright.config.js
  • Package scripts: svelte-frontend/package.json

Open the PR targeting the branch copilot/resolve-merge-conflicts-129 (i.e., as a sub-PR to PR #130).

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.

…s dir

Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
@Steake Steake marked this pull request as ready for review March 8, 2026 11:32
@Steake Steake self-requested a review as a code owner March 8, 2026 11:32
Copilot AI review requested due to automatic review settings March 8, 2026 11:32
Copilot AI changed the title [WIP] Fix Playwright reporter output folder configuration fix(playwright): move HTML reporter output folder outside test-results dir Mar 8, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 outputDir to ./test-results for test artifacts.
  • Move the HTML reporter outputFolder to ./playwright-report (outside ./test-results).

outputDir: './test-results',
reporter: [
['html', { outputFolder: './test-results/playwright-report' }],
['html', { outputFolder: './playwright-report' }],
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
['html', { outputFolder: './playwright-report' }],
['html', { outputFolder: './playwright-report-output' }],

Copilot uses AI. Check for mistakes.
@Steake
Copy link
Owner

Steake commented Mar 8, 2026

@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>
Copy link
Contributor Author

Copilot AI commented Mar 8, 2026

@copilot apply changes based on the comments in this thread

Done in 7e591f2. Changed the HTML reporter outputFolder to ./playwright-report-output (avoiding the conflict with the tracked playwright-report/index.html file), and added svelte-frontend/playwright-report-output/ to the root .gitignore so generated reports stay untracked.

@Steake Steake merged commit e7c32ed into copilot/resolve-merge-conflicts-129 Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants