Skip to content

test(e2e): port level_types/multi to playwright#73287

Open
stephenliang wants to merge 2 commits into
stagingfrom
stephen/multi-port
Open

test(e2e): port level_types/multi to playwright#73287
stephenliang wants to merge 2 commits into
stagingfrom
stephen/multi-port

Conversation

@stephenliang

@stephenliang stephenliang commented Jun 16, 2026

Copy link
Copy Markdown
Member

Ports the level_types/multi Cucumber feature to Playwright in
@code-dot-org/e2e-tests.

Scenarios (→ tests/levels/multi.spec.ts):

  • Loading the level — question + submit button render.
  • Click an option → submit the correct answer → win modal.
  • Submit an incorrect option → "Incorrect answer" modal → cross-mark appears.

The source feature is tagged @playwright so the Cucumber suite skips it (no
double-running).

Structure and naming:

  • Page object is MultiLevel, spec lives under tests/levels/. multi is a
    Level (dashboard/app/models/levels/multi.rb), not a lab or an activity —
    those are distinct concepts in our domain model.
  • The locale-forcing scenario uses an optional, backward-compatible lang param
    on labLevelUrl (default undefined → byte-identical URLs for existing
    callers), rather than a hand-built URL.

The change is scoped to its own new files plus that one additive labLevelUrl
param, so no other spec's behavior changes.

Links

Testing story

  • Ran locally against test-studio.code.org across all three browsers
    (chromium, firefox, webkit): 9/9 green.
  • Also green under the porting workflow's 5×/all-browser stress gate (45 clean
    runs).
  • yarn typecheck and yarn lint clean; repo pre-commit hook clean.

🤖 Generated with Claude Code

stephenliang and others added 2 commits June 16, 2026 12:17
Port 3 scenarios from level_types/multi.feature.
Green under the 5x/all-browser stress gate; original Cucumber feature tagged @playwright so the Cucumber suite skips it.

Source: level_types/multi.feature
Review follow-up to the level_types/multi port, scoped to the port's own files:

- Rename MultiLab -> MultiLevel; move the spec to tests/levels/. multi is a
  Level (dashboard/app/models/levels/multi.rb), not a lab or an activity.
- Collapse submit()/submitLast() to one submit() and drop the doubled
  first()/last() assertions; there is exactly one .submitButton.
- Add an optional lang param to labLevelUrl and delete the gotoUrl escape hatch.
- Drop the no-op rotateLandscape helper; the project viewport is already
  landscape.
- Drop the win-modal-title assertion, which the source feature never had.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@stephenliang stephenliang requested review from a team and lfryemason and removed request for a team June 16, 2026 20:15
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