Move per-test game reset into a fixture and extract play-word flow#1
Closed
RISCfuture wants to merge 1 commit into
Closed
Move per-test game reset into a fixture and extract play-word flow#1RISCfuture wants to merge 1 commit into
RISCfuture wants to merge 1 commit into
Conversation
Address two e2e structure findings in the gameplay spec: - Replace the inlined per-test reset (goto + clear localStorage + reload) in beforeEach with an injected auto-fixture (resetGame) in fixtures.ts, so lifecycle setup is owned by a Playwright fixture rather than the spec. - Extract the duplicated per-word play loop (find tiles, click them, add, wait for the current word to clear) into a playWord/playWords flow helper composed from the existing GameBoardPage primitives, and use it in both the "all fourtiles" and "all words" beforeEach blocks. The thin star and found-words page objects are left unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Superseded by #2 on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses two e2e structure findings in
e2e/gameplay.spec.ts, aligning with the Playwright test guidance (fixtures own lifecycle; helpers own actions).Findings addressed
beforeEachclearedlocalStorageand reloaded to reset the game inline. This per-test reset now lives in a Playwright auto-fixture (resetGame, viatest.extendwith{ auto: true }) ine2e/fixtures.ts, so it is injected per test rather than inlined in the spec. The spec'sbeforeEachnow only readswordsRemainingfrom the already-reset page.:117-122and:155-160is extracted intoplayWord/playWordsine2e/game-flows.ts, composed from the existingGameBoardPageprimitives (clickTiles,clickAdd,getCurrentWord) andtilesForWordFromPage. Both the "all fourtiles" and "all words"beforeEachblocks now callplayWords. The helper's only assertion is synchronization (waiting for the word to clear); feature assertions stay in the specs.The thin star / found-words page objects were intentionally left unchanged, as noted in the finding.
Verification
All run on Node 26.3.0 / pnpm 11.5.1:
pnpm run type-check(vue-tsc): passpnpm run lint(eslint + stylelint + oxlint + knip): pass (exit 0; only pre-existing knip config hints, unrelated to this change)pnpm run test:unit(vitest): 6/6 passnpx playwright test --list: specs compile (39 tests)npx playwright test --project=chromium: 13/13 pass (22.3s), exercising the new fixture and flow helperOne targeted
eslint-disable-next-line @typescript-eslint/no-invalid-void-typeis applied to theresetGame: voidfixture type, which is the idiomatic Playwright type for an auto-fixture that exposes no value to specs.🤖 Generated with Claude Code