From 4e97b5214ec073a713f6c58c5a1b74f0786fb969 Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Wed, 25 Mar 2026 16:20:34 +0100 Subject: [PATCH] Update README --- README.md | 15 +++++++++++++++ tests/e2e/screenshots.mjs | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/README.md b/README.md index 223f9bc..a9fb804 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,9 @@ tests/ playwright.config.js # Parallel by default; serial when --headed or --slow global-setup.js # Creates firmware symlink once before all tests run-e2e.sh + screenshots.mjs # Captures screenshots of every wizard step + screenshots.config.js # Mobile + desktop project config for screenshots + run-screenshots.sh # Runs screenshot capture # Root scripts test.sh # Runs all tests (WASM + E2E) @@ -268,6 +271,17 @@ Extra Playwright arguments can be passed after `--`: ./run-e2e.sh --headed --slow -- --grep "NickelMenu" ``` +### Screenshots + +Capture screenshots of every wizard step for visual review (mobile + desktop): + +```bash +cd tests/e2e +./run-screenshots.sh +``` + +Output is saved to `tests/e2e/screenshots/mobile/` and `tests/e2e/screenshots/desktop/` (gitignored). The script uses a separate Playwright config (`screenshots.config.js`) with two projects: mobile (393×852, 3× DPI) and desktop (1280×900, 3× DPI). Screenshots cover the full wizard flow including device connection, mode selection, NickelMenu configuration, custom patches, error states, dialogs, and the feedback widget. + ### WASM integration test Calls `patchFirmware()` directly in Go/WASM via Node.js: @@ -295,6 +309,7 @@ The hosted version at [kp.nicoverbruggen.be](https://kp.nicoverbruggen.be) uses - **nm-simplified-home** — whether simplified home screen features were selected - **nm-basic-tabs** — whether the basic tab bar option was selected - **flow-end** — how the flow ended (write to device or download, for both NickelMenu and custom patches) +- **feedback** — thumbs up/down response to "Did you find it easy to use this wizard?" shown on done screens Analytics are disabled for local and self-hosted installs. They activate only when `UMAMI_WEBSITE_ID` and `UMAMI_SCRIPT_URL` environment variables are set on the server. To test the analytics UI locally without sending any data: diff --git a/tests/e2e/screenshots.mjs b/tests/e2e/screenshots.mjs index 3b5615e..9b00ff6 100644 --- a/tests/e2e/screenshots.mjs +++ b/tests/e2e/screenshots.mjs @@ -93,6 +93,40 @@ test('capture all steps', async ({ page }, testInfo) => { await shot(page, '10-patches-selected', testInfo); }); +test('nickelmenu done with feedback', async ({ page }, testInfo) => { + // Enable analytics so the feedback widget appears + await page.addInitScript(() => { window.__ANALYTICS_ENABLED = true; }); + + await page.goto('/'); + await dismissMobileModal(page); + await injectMockDevice(page); + + // Connect device → mode selection → NickelMenu + await page.click('#btn-connect'); + await page.click('#btn-connect-ready'); + await expect(page.locator('#step-device')).not.toBeHidden(); + await page.click('#btn-device-next'); + await page.click('input[name="mode"][value="nickelmenu"]'); + await page.click('#btn-mode-next'); + + // NickelMenu-only → review → write to device + await page.click('input[value="nickelmenu-only"]'); + await page.click('#btn-nm-next'); + await expect(page.locator('#step-nm-review')).not.toBeHidden(); + await page.click('#btn-nm-write'); + + // Wait for done step + const nmDone = page.locator('#step-nm-done'); + await expect(nmDone).not.toBeHidden(); + await expect(nmDone.locator('.feedback')).toBeVisible(); + await shot(page, '15-done-feedback', testInfo); + + // Click thumbs up and capture the thank-you state + await nmDone.locator('.feedback-btn[data-vote="up"]').click(); + await expect(nmDone.locator('.feedback-thanks')).toBeVisible(); + await shot(page, '16-done-feedback-voted', testInfo); +}); + test('incompatible firmware', async ({ page }, testInfo) => { await page.goto('/'); await dismissMobileModal(page);