test(fase-9): WebKit project + swipe-toggle gesture specs

Closes 9.4 (swipe-delete E2E in WebKit — repurposed to the current
swipe-to-check / swipe-to-uncheck gesture, since Fase 5.10 replaced
swipe-to-delete with a double-tap delete flow).

- playwright.config.ts gains a second project named "webkit"
  (devices['iPhone 13']) gated behind RUN_WEBKIT=1 so the suite stays
  green on hosts that do not have the GTK/WebKit system libs
  (libicu74, libxml2, libmanette-0.2-0, libwoff1) installed — those
  need `sudo pnpm exec playwright install-deps`. The chromium project
  ignores `*.webkit.test.ts` so the same file never runs in both.
- Justfile adds `just playwright-install` (chromium + webkit) and
  `just test-webkit` for the on-demand run.
- New tests/e2e/swipe-toggle.webkit.test.ts contains SW-01 + SW-02:
  swipe right on an unchecked row marks it checked; swipe left on a
  checked row marks it unchecked. The handlers in lists/[id]/+page.svelte
  use unified pointer events, so the helper dispatches
  PointerEvent('pointer{down,move,up}') with pointerType:'touch'
  directly — works regardless of the project's hasTouch setting.
- lists/[id]/+page.svelte exposes data-checked and data-name on each
  item-row to give the specs a robust locator without depending on
  text/heading hierarchy.

Note: cannot validate the WebKit runs end-to-end in this sandbox
(missing libicu74/libwoff1 require sudo apt install). The spec is
ready to run under any CI image that has Playwright's standard
linux deps installed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-18 01:37:42 +02:00
parent ed556ce245
commit cda7321d37
4 changed files with 156 additions and 3 deletions

View File

@@ -132,7 +132,14 @@ test-db:
test-integration:
pnpm --filter @colectivo/test-utils test
# Run Playwright E2E tests (headless)
# Install Playwright browsers (chromium + webkit). WebKit is required for
# touch-gesture specs (Fase 9.4 swipe-toggle) — the *.webkit.test.ts files
# are gated to that project in playwright.config.ts.
playwright-install:
pnpm --filter @colectivo/web exec playwright install chromium webkit
# Run Playwright E2E tests (headless). Includes the WebKit project — make
# sure `just playwright-install` has run at least once.
test-e2e:
pnpm --filter @colectivo/web exec playwright test
@@ -140,6 +147,13 @@ test-e2e:
test-e2e-headed:
pnpm --filter @colectivo/web exec playwright test --headed
# Run only the WebKit (Mobile Safari) touch-gesture specs (Fase 9.4).
# Gated behind RUN_WEBKIT=1 in playwright.config so it stays out of the
# default test-all (WebKit needs system libs not available on every host
# — see `just playwright-install` and `sudo pnpm exec playwright install-deps`).
test-webkit:
RUN_WEBKIT=1 pnpm --filter @colectivo/web exec playwright test --project=webkit
# Run Kong rate-limit verification tests. Restarts Kong first to ensure a
# clean counter state (tests burn through the minute + hour quotas). Not
# part of test-all because the tests share the rate-limit counter with the