Skip to content

Commit 247bec7

Browse files
author
DavidQ
committed
Route Playwright artifacts to tests/results and ignore local dependency outputs - PR_11_318C
1 parent f8eba48 commit 247bec7

3 files changed

Lines changed: 26 additions & 12 deletions

File tree

docs/dev/reports/PR_11_318C_report.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,21 @@ Move Playwright outputs from defaults into `tests/results/**` via config-only ch
1313

1414
## Implementation Summary
1515
- Config now routes Playwright outputs under `tests/results/**`:
16-
- test artifacts: `tests/results/artifacts`
16+
- top-level `outputDir`: `tests/results`
17+
- project artifact output: `tests/results/artifacts`
1718
- HTML report: `tests/results/report`
1819
- Kept existing run options:
1920
- `headless: false`
2021
- `slowMo: 500`
2122
- `trace: "on"`
22-
- Scoped Playwright discovery to `tests/ui` to run UI specs only when invoking `npx playwright test`.
23+
- `.gitignore` already included required ignore entries; no `.gitignore` changes were needed:
24+
- `node_modules/`
25+
- `tests/results/`
26+
- `tmp/`
2327

2428
## Validation Commands
2529
- `node --check playwright.config.cjs` -> **PASS**
26-
- `npx playwright test` -> **PASS**
30+
- `npx playwright test tests/ui/workspace-v2.asset-manager.spec.js` -> **PASS**
2731

2832
## Output Verification
2933
- `tests/results/` exists -> **YES**
@@ -33,5 +37,4 @@ Move Playwright outputs from defaults into `tests/results/**` via config-only ch
3337
- `playwright-report/` created -> **NO**
3438

3539
## Constraint Note
36-
- A direct combination of `outputDir = tests/results` and HTML reporter `outputFolder = tests/results/report` is rejected by Playwright due folder-clash protection.
37-
- Final config keeps all output in `tests/results/**` without using default output folders.
40+
- Playwright rejects direct HTML/outputDir folder collision. Final config keeps all output in `tests/results/**` by using top-level `outputDir` plus project-level artifact `outputDir`.

docs/pr/PR_11_318C_PLAYWRIGHT_OUTPUT_DIRS/BUILD_PR.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
## Implementation
44
- Updated `playwright.config.cjs`:
5-
- `testDir: "tests/ui"`
6-
- `outputDir: "tests/results/artifacts"`
5+
- top-level `outputDir: "tests/results"`
6+
- project-level UI artifact output:
7+
- `projects[0].outputDir: "tests/results/artifacts"`
8+
- `projects[0].testDir: "tests/ui"`
79
- HTML reporter output:
810
- `tests/results/report`
911
- Preserved:
@@ -12,9 +14,12 @@
1214
- `trace: "on"`
1315

1416
## Notes
15-
- Playwright rejects a config where HTML output folder is nested under the same root as `outputDir` when both are the same directory tree root (`tests/results`), because HTML reporter clears its output folder and can erase artifacts.
16-
- This config keeps all outputs under `tests/results/**` while avoiding reporter/outputDir collision.
17+
- `.gitignore` already includes required entries:
18+
- `node_modules/`
19+
- `tests/results/`
20+
- `tmp/`
21+
- Playwright rejects a config where HTML output folder and test artifact `outputDir` share a collision path. Project-level `outputDir` avoids that clash while keeping all outputs under `tests/results/**`.
1722

1823
## Validation
1924
- `node --check playwright.config.cjs`
20-
- `npx playwright test`
25+
- `npx playwright test tests/ui/workspace-v2.asset-manager.spec.js`

playwright.config.cjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
module.exports = {
2-
testDir: "tests/ui",
3-
outputDir: "tests/results/artifacts",
2+
outputDir: "tests/results",
3+
projects: [
4+
{
5+
name: "ui",
6+
testDir: "tests/ui",
7+
outputDir: "tests/results/artifacts"
8+
}
9+
],
410
reporter: [
511
["list"],
612
["html", { outputFolder: "tests/results/report", open: "never" }]

0 commit comments

Comments
 (0)