Skip to content

feat: FM-945 Refine Gameplay E2E Automation to Support Dynamic Assessment Trigger and Complete Level Progression - #1988

Merged
ashwinnair-chimple merged 15 commits into
developfrom
FM-945
Jun 26, 2026
Merged

feat: FM-945 Refine Gameplay E2E Automation to Support Dynamic Assessment Trigger and Complete Level Progression#1988
ashwinnair-chimple merged 15 commits into
developfrom
FM-945

Conversation

@ashwinnair-chimple

@ashwinnair-chimple ashwinnair-chimple commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Changes

  • 5 Refine Gameplay E2E Automation to Support Dynamic Assessment Trigger and Complete Level Progression

How to test

  • run automated script npm run test:e2e:headed

Ref: FM-945

Summary by CodeRabbit

  • Bug Fixes

    • Improved stone interaction reliability by preventing premature “ready” checks and fully resetting stone-loading state after reset.
    • Enhanced assessment and level-completion transitions so progression happens more naturally with fewer timing-related issues.
  • Tests

    • Expanded and refactored end-to-end coverage for full gameplay, natural assessment flow, mini-game transitions, and level completion.
    • Updated serial test orchestration and registration ordering to better match real progression timing.
    • Increased level-end waiting robustness and improved verification of awarded stars.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f3cb2349-cb43-48aa-a230-fdb7b7ae9c22

📥 Commits

Reviewing files that changed from the base of the PR and between a8f2ed7 and 6589f3b.

📒 Files selected for processing (1)
  • e2e/helpers/mock-helpers.ts

📝 Walkthrough

Walkthrough

The PR adds live gameplay-state helpers, rewires the assessment and level-completion E2E flows to follow natural puzzle progression, and updates stone readiness handling plus mocked assessment config so the tests wait on actual in-game transitions.

Changes

Natural gameplay assessment flow

Layer / File(s) Summary
Shared gameplay state and helpers
e2e/fixtures/game-fixtures.ts, e2e/helpers/game-state-helpers.ts, e2e/helpers/index.ts, e2e/helpers/mock-helpers.ts, src/components/stone-handler/stone-handler.ts
Adds a full gameplay flow state, live puzzle/overlay accessors, correct-stone lookup, mocked assessment config, and stone readiness state updates.
Serial suite wiring
e2e/tests/ftm-assessment-survey-flow.spec.ts
Splits assessment registration around the mini-game sequence and switches the suite to the new full-gameplay state.
Natural assessment progression
e2e/tests/isolated/tc-009-013-assessment.spec.ts
Rewrites TC_009–TC_012 to drive puzzle advancement, wait for the assessment overlay, answer the question, and export the new registration entry points.
Post-mini-game completion and level end
e2e/tests/isolated/tc-009-013-assessment.spec.ts, e2e/tests/isolated/tc-016-level-completion.spec.ts
Completes the remaining puzzles after the mini-game and updates level completion to wait for the end screen and related UI state naturally.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • janfb-codev

Poem

A bunny hopped through stones of light,
and waited for the flow just right.
No magic clicks, no forced goodbye—
the stars arrived beneath the sky.
Hop, hop, hooray!

🚥 Pre-merge checks | ✅ 4 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 63.64% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Tests & Lint & Coverage ⚠️ Warning E2E tests were updated, but lint couldn’t be verified (no node_modules/eslint here) and there’s no coverage report or 70% threshold in jest config. Install deps, run npm run lint, and run coverage-enabled tests until a report shows ≥70% (or add a threshold) before merging.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise, descriptive, and matches the PR’s dynamic gameplay E2E automation and level-progression changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch FM-945

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
e2e/tests/isolated/tc-009-013-assessment.spec.ts (1)

744-748: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

registerTests won't run standalone as implied.

TC_013 waits for the first post-mini-game puzzle, but registerTests chains registerTC009_012 directly into _tc013 with no mini-game (TC_014/TC_015) in between — those live in a separate spec. So a direct file run will hang/fail at TC_013's waitForFunction. Consider dropping _tc013 from the "direct run" path, or clarify in the doc comment that this export is only valid when the mini-game runs externally.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/tests/isolated/tc-009-013-assessment.spec.ts` around lines 744 - 748, The
standalone test entrypoint is misleading because registerTests currently runs
registerTC009_012 and then _tc013 without the intervening mini-game flow that
TC_013 depends on. Update registerTests to either stop before _tc013 for direct
file execution or revise the doc comment to clearly state that the mini-game
stages (TC_014/TC_015) must be executed externally before _tc013 can run.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@e2e/tests/isolated/tc-009-013-assessment.spec.ts`:
- Around line 744-748: The standalone test entrypoint is misleading because
registerTests currently runs registerTC009_012 and then _tc013 without the
intervening mini-game flow that TC_013 depends on. Update registerTests to
either stop before _tc013 for direct file execution or revise the doc comment to
clearly state that the mini-game stages (TC_014/TC_015) must be executed
externally before _tc013 can run.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ef8954c1-7d91-4f38-9f26-511272358caf

📥 Commits

Reviewing files that changed from the base of the PR and between 143b536 and a8f2ed7.

📒 Files selected for processing (7)
  • e2e/fixtures/game-fixtures.ts
  • e2e/helpers/game-state-helpers.ts
  • e2e/helpers/index.ts
  • e2e/tests/ftm-assessment-survey-flow.spec.ts
  • e2e/tests/isolated/tc-009-013-assessment.spec.ts
  • e2e/tests/isolated/tc-016-level-completion.spec.ts
  • src/components/stone-handler/stone-handler.ts

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.

2 participants