Skip to content

tests: add Playwright E2E fuzz test for the guided lesson - #627

Open
jpds wants to merge 3 commits into
aradzie:masterfrom
jpds:test/e2e-guided-lesson-fuzz
Open

tests: add Playwright E2E fuzz test for the guided lesson#627
jpds wants to merge 3 commits into
aradzie:masterfrom
jpds:test/e2e-guided-lesson-fuzz

Conversation

@jpds

@jpds jpds commented Jul 29, 2026

Copy link
Copy Markdown

This branch adds an end-to-end test suite with Playwright which exercises the guided lessons functionality.

Completes in about <5 minutes on my machine. I run this with:

export PLAYWRIGHT_BROWSERS_PATH="$(nix build nixpkgs#playwright-driver.browsers --no-link --print-out-paths)"
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
npm run test-e2e

@semanticdiff-com

semanticdiff-com Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  package.json  40% smaller
  .gitignore Unsupported file format
  e2e/guided-lesson/alphabet-size-churn.spec.ts  0% smaller
  e2e/guided-lesson/alphabet-unlock.spec.ts  0% smaller
  e2e/guided-lesson/daily-goal-toast.spec.ts  0% smaller
  e2e/guided-lesson/helpers.ts  0% smaller
  e2e/guided-lesson/mistake-color.spec.ts  0% smaller
  e2e/guided-lesson/pointer-highlight.spec.ts  0% smaller
  e2e/guided-lesson/recover-keys-churn.spec.ts  0% smaller
  e2e/guided-lesson/settings-churn.spec.ts  0% smaller
  e2e/smoke.spec.ts  0% smaller
  package-lock.json  0% smaller
  playwright.config.ts  0% smaller

@jpds
jpds force-pushed the test/e2e-guided-lesson-fuzz branch 6 times, most recently from 4048554 to 82c98a7 Compare July 31, 2026 11:54
jpds added 3 commits July 31, 2026 19:12
Simulates a human typing through the full American English alphabet in the
guided lesson with a randomized per-round typing speed, checking that keys
never regress, unlock one at a time, and that the target key, its toast, and its
confidence state stay consistent throughout.

Others included tests cover the toasts, the on-screen keyboard's
hesitation-pointer highlighting the physically correct key, and a
mistyped-then-corrected character rendering in the theme's miss color.
Writes new guided-lesson settings to `localStorage` and reloads mid-run.
This checks progress survives the `GuidedLesson`/`Progress` reconstruction:

* `naturalWords` and a target-speed ramp shouldn't lose already-earned unlocks
* `alphabetSize` can force-include several keys in one round
* `recoverKeys` can legitimately re-lock a key past the guaranteed first 6.
Occasionally mistypes-then-corrects the displayed character instead of
typing it cleanly, mirroring a human fumble.
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.

1 participant