Skip to content

Commit a74c0b0

Browse files
committed
docs(openspec): archive e2e-screenshot-scenarios
- move change to openspec/changes/archive/2026-05-28-e2e-screenshot-scenarios/ - add e2e-screenshots spec and update playwright-e2e-suite spec to gate on-demand scenarios behind a separate task - scope test:e2e to --project=chromium so screenshot project is excluded from the default run - refresh docs/screenshots/accounts.png
1 parent b15bf2b commit a74c0b0

11 files changed

Lines changed: 141 additions & 9 deletions

File tree

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"build": "vite build",
77
"preview": "vite preview",
88
"e2e:generate": "deno run -A e2e/fixtures/generate.ts",
9-
"test:e2e": "node_modules/.bin/playwright test --config=e2e/playwright.config.ts",
9+
"test:e2e": "node_modules/.bin/playwright test --config=e2e/playwright.config.ts --project=chromium",
1010
"e2e:ui": "node_modules/.bin/playwright test --config=e2e/playwright.config.ts --ui",
1111
"e2e:headless": "node_modules/.bin/playwright test --config=e2e/playwright.config.ts",
1212
"e2e:debug": "node_modules/.bin/playwright show-trace $(ls -t e2e/test-results/*/trace.zip 2>/dev/null | head -1)",

docs/screenshots/accounts.png

1.26 KB
Loading

openspec/changes/e2e-screenshot-scenarios/.openspec.yaml renamed to openspec/changes/archive/2026-05-28-e2e-screenshot-scenarios/.openspec.yaml

File renamed without changes.

openspec/changes/e2e-screenshot-scenarios/design.md renamed to openspec/changes/archive/2026-05-28-e2e-screenshot-scenarios/design.md

File renamed without changes.

openspec/changes/e2e-screenshot-scenarios/proposal.md renamed to openspec/changes/archive/2026-05-28-e2e-screenshot-scenarios/proposal.md

File renamed without changes.

openspec/changes/e2e-screenshot-scenarios/specs/e2e-screenshots/spec.md renamed to openspec/changes/archive/2026-05-28-e2e-screenshot-scenarios/specs/e2e-screenshots/spec.md

File renamed without changes.

openspec/changes/e2e-screenshot-scenarios/specs/playwright-e2e-suite/spec.md renamed to openspec/changes/archive/2026-05-28-e2e-screenshot-scenarios/specs/playwright-e2e-suite/spec.md

File renamed without changes.

openspec/changes/e2e-screenshot-scenarios/tasks.md renamed to openspec/changes/archive/2026-05-28-e2e-screenshot-scenarios/tasks.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828

2929
## 4. Validation cycle
3030

31-
- [ ] 4.1 Run `deno task test:e2e` and verify the screenshot spec was **not** executed (check Playwright report: only functional specs ran, total file count matches prior baseline).
32-
- [ ] 4.2 Run `deno task screenshots` from a clean tree and verify the dedicated project runs only `e2e/specs/screenshots.spec.ts`.
33-
- [ ] 4.3 Run `deno task lint` and `deno task check` (or repo equivalents) to confirm no type or lint regressions in the new spec file.
34-
- [ ] 4.4 If any e2e validation fails, fix and re-run 4.1–4.3 until clean.
31+
- [x] 4.1 Run `deno task test:e2e` and verify the screenshot spec was **not** executed (check Playwright report: only functional specs ran, total file count matches prior baseline).
32+
- [x] 4.2 Run `deno task screenshots` from a clean tree and verify the dedicated project runs only `e2e/specs/screenshots.spec.ts`.
33+
- [x] 4.3 Run `deno task lint` and `deno task check` (or repo equivalents) to confirm no type or lint regressions in the new spec file.
34+
- [x] 4.4 If any e2e validation fails, fix and re-run 4.1–4.3 until clean.
3535

3636
## 5. Cleanup
3737

38-
- [ ] 5.1 Resolve any TypeScript / Playwright deprecation warnings emitted by the new spec or config additions.
39-
- [ ] 5.2 Confirm no compilation warnings appear in `cargo check --workspace` (sanity check that the unrelated Rust workspace is unaffected by this frontend-only change).
38+
- [x] 5.1 Resolve any TypeScript / Playwright deprecation warnings emitted by the new spec or config additions.
39+
- [x] 5.2 Confirm no compilation warnings appear in `cargo check --workspace` (sanity check that the unrelated Rust workspace is unaffected by this frontend-only change).
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# e2e-screenshots
2+
3+
## Purpose
4+
5+
Capture canonical screenshots of the mailbrus SPA for documentation and marketing purposes. Screenshots are generated on-demand via a dedicated Playwright project and committed to the repository as immutable assets.
6+
7+
---
8+
9+
## Requirements
10+
11+
### Requirement: Dedicated screenshot scenario file
12+
13+
The repository SHALL contain a dedicated Playwright spec file (`e2e/specs/screenshots.spec.ts`) whose sole responsibility is staging the SPA into canonical views and capturing screenshots. The file MUST NOT contain functional assertions unrelated to capture, and MUST NOT be imported or referenced from functional spec files.
14+
15+
#### Scenario: Screenshot spec exists at the expected path
16+
17+
- **WHEN** the repository is inspected
18+
- **THEN** `e2e/specs/screenshots.spec.ts` exists
19+
- **AND** its tests' final action for each captured view is `page.screenshot(...)` writing into `docs/screenshots/`
20+
21+
---
22+
23+
### Requirement: Canonical view set
24+
25+
The screenshot scenario SHALL capture exactly the following five canonical views, each written to a fixed file name under `docs/screenshots/`:
26+
27+
| File | View |
28+
| --- | --- |
29+
| `message-list.png` | Populated message list, no overlay |
30+
| `reader.png` | A representative message open in the reader |
31+
| `accounts.png` | Account list / picker |
32+
| `compose.png` | Compose view with realistic draft content |
33+
| `about-over-list.png` | About dialog overlaid on the message list |
34+
35+
#### Scenario: All five PNGs are produced
36+
37+
- **WHEN** `deno task screenshots` completes successfully
38+
- **THEN** all five files listed above exist under `docs/screenshots/`
39+
- **AND** no other PNG files are produced under `docs/screenshots/` by the task
40+
41+
#### Scenario: About shot uses the real About dialog
42+
43+
- **WHEN** `about-over-list.png` is captured
44+
- **THEN** the visible About surface is rendered by the real `About.svelte` component triggered via its production entry point (keyboard shortcut, command palette, or menu)
45+
- **AND** no test-only overlay or mock About panel is injected
46+
47+
---
48+
49+
### Requirement: On-demand-only execution
50+
51+
The screenshot scenario SHALL run only when explicitly requested via the dedicated task. It MUST NOT execute as part of the default `deno task test:e2e` / `deno task e2e:headless` run, MUST NOT execute in any CI workflow's default test step, and MUST NOT be added to a pre-commit or pre-push hook.
52+
53+
#### Scenario: Default e2e run excludes screenshot scenario
54+
55+
- **WHEN** `deno task test:e2e` is invoked
56+
- **THEN** `e2e/specs/screenshots.spec.ts` is not executed
57+
- **AND** no files under `docs/screenshots/` are written or modified by the run
58+
59+
#### Scenario: CI does not run the screenshot scenario by default
60+
61+
- **WHEN** the project's CI workflows are inspected
62+
- **THEN** no workflow step invokes the screenshot project, task, or spec file as part of its default execution path
63+
- **AND** if any workflow does invoke it, that invocation is gated behind an explicit opt-in (manual dispatch, dedicated workflow, or label-triggered job)
64+
65+
#### Scenario: Screenshot task runs the scenario
66+
67+
- **WHEN** `deno task screenshots` is invoked
68+
- **THEN** Playwright executes the dedicated `screenshots` project containing only `e2e/specs/screenshots.spec.ts`
69+
- **AND** the process exit code reflects success or failure of that scenario
70+
71+
---
72+
73+
### Requirement: Deterministic capture environment
74+
75+
The screenshot scenario SHALL fix the capture environment so re-runs against unchanged UI code produce stable output. Fixed parameters MUST include viewport dimensions, color scheme, locale, and device scale factor. Animations and caret blink SHALL be suppressed before capture.
76+
77+
#### Scenario: Environment is pinned in config
78+
79+
- **WHEN** the screenshot Playwright project's configuration is inspected
80+
- **THEN** it specifies an explicit viewport width and height, a fixed `colorScheme`, a fixed `locale`, and a fixed `deviceScaleFactor`
81+
82+
#### Scenario: Animations are suppressed before capture
83+
84+
- **WHEN** any of the five views is captured
85+
- **THEN** CSS transitions, animations, and caret blink are disabled on the page before `page.screenshot(...)` is called
86+
87+
---
88+
89+
### Requirement: Committed output under docs/screenshots/
90+
91+
The five PNGs SHALL be committed to the repository under `docs/screenshots/`. They MUST NOT be listed in `.gitignore`. The output directory MUST be `docs/screenshots/` (not `e2e/screenshots/`, not `e2e/test-results/`).
92+
93+
#### Scenario: Output directory is tracked
94+
95+
- **WHEN** the repository is inspected
96+
- **THEN** `docs/screenshots/` exists and contains the five canonical PNGs as tracked files
97+
- **AND** neither `docs/screenshots/` nor `docs/screenshots/*.png` appears in any `.gitignore`
98+
99+
---
100+
101+
### Requirement: Reuse of existing E2E harness
102+
103+
The screenshot scenario SHALL obtain its server, cloned maildir, and page objects through the existing harness fixture (`e2e/harness/fixtures.ts`). It MUST NOT clone fixtures, spawn `mailbrus-server`, or hard-code DOM selectors inline; selectors SHALL come from existing page objects (`AccountsPage`, `MailboxPage`, `MessagePage`) or new page-object additions where genuinely needed.
104+
105+
#### Scenario: Scenario delegates to harness and page objects
106+
107+
- **WHEN** `e2e/specs/screenshots.spec.ts` is inspected
108+
- **THEN** it imports its `test` fixture from the harness rather than `@playwright/test` directly
109+
- **AND** it interacts with the SPA via page objects, not raw `page.locator(...)` selectors duplicated from page objects
110+
111+
---
112+
113+
### Requirement: Manifest-driven content for list and reader shots
114+
115+
For the `message-list.png` and `reader.png` views, the content shown SHALL be sourced from the typed fixture manifest in `e2e/fixtures/manifest.ts` (specific account / folder / message references), so corpus changes propagate to the screenshots through the manifest rather than through scattered literals.
116+
117+
#### Scenario: List and reader shots reference manifest entries
118+
119+
- **WHEN** the screenshot scenario stages the message-list and reader views
120+
- **THEN** the account, folder, and message it navigates to are obtained from named exports of the manifest, not from inline string literals

openspec/specs/playwright-e2e-suite/spec.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,26 @@ The E2E suite SHALL follow a fixed, documented layout separating Playwright conf
2626

2727
### Requirement: Runnable task
2828

29-
The suite SHALL be runnable through a single project task (e.g. `deno task test:e2e`) that ensures prerequisites and executes the Playwright tests, suitable for both local and CI use.
29+
The suite SHALL be runnable through a single project task (e.g. `deno task test:e2e`) that ensures prerequisites and executes the Playwright tests, suitable for both local and CI use. The default task SHALL execute only functional specs; on-demand scenarios (such as screenshot capture under [[e2e-screenshots]]) MUST be gated behind separate, explicitly invoked tasks and MUST NOT be included in the default `test:e2e` execution set or in any CI workflow's default test step.
3030

3131
#### Scenario: Suite runs via task
3232

3333
- **WHEN** the E2E task is invoked
3434
- **THEN** prerequisites are ensured and the Playwright tests execute
3535
- **AND** the process exit code reflects pass/fail of the suite
3636

37+
#### Scenario: Default task excludes on-demand scenarios
38+
39+
- **WHEN** `deno task test:e2e` is invoked
40+
- **THEN** only functional spec files execute
41+
- **AND** spec files belonging to on-demand-only Playwright projects (e.g. the screenshot project) are not executed
42+
43+
#### Scenario: On-demand scenarios have their own task
44+
45+
- **WHEN** an on-demand-only Playwright project exists in the suite
46+
- **THEN** the project is invokable via a dedicated, named task (e.g. `deno task screenshots`)
47+
- **AND** that task is documented alongside `test:e2e` in the project README or AGENTS/CLAUDE docs
48+
3749
### Requirement: Assertions reference the manifest
3850

3951
Specs SHALL assert against the typed fixture manifest rather than hard-coded message literals, so corpus changes propagate to expectations through the manifest.

0 commit comments

Comments
 (0)