Skip to content

Add cross-browser E2E tests with parallel account fixtures and CI reporting - #826

Open
PenguinWithATie wants to merge 2 commits into
mainfrom
testware_finally
Open

PenguinWithATie wants to merge 2 commits into
mainfrom
testware_finally

Conversation

@PenguinWithATie

Copy link
Copy Markdown
Collaborator

Summary

Replaces the placeholder Playwright test with cross-browser coverage for navigation, challenges, and multiplayer gameplay. Adds isolated account fixtures, recovery checks, and a GitHub Actions workflow with readable results and downloadable diagnostics.

Main changes

  • Parallel test fixtures: Reserve accounts from eight seeded test users using PostgreSQL advisory locks, supporting four concurrent authenticated scenarios. Each player gets an isolated browser context, and public challenges use separate Quick Play queues to avoid matching other tests.
  • Automatic recovery: Clear leftover challenges and unfinished games through application controls before and after scenarios. Release reservations after browser contexts close, including failure paths.
  • UI test support: Add accessible labels for pieces, move targets, challenge actions, and history controls, plus board coordinates and stack levels for precise assertions.
  • Test environment: Add development-only account seeds and Docker test mode with formatting checks, migrations, health checks, and a release build. Pin the shared Rust toolchain.
  • WebKit sessions: Add a test-only HTTP cookie workaround so release-build logins survive reloads.

Test scenarios

The full suite contains six scenarios across six browser/layout projects: 36 cases. Projects cover Chromium, Firefox, and WebKit on desktop and mobile layouts. Firefox's mobile project uses a narrow desktop viewport.

Scenario What it verifies
Anonymous navigation The home page responds and hydrates, navigation works for the layout, and Quick Play redirects unauthenticated visitors to sign-in.
Decline a direct challenge The recipient sees an incoming challenge and declining it removes the row.
Cancel a public challenge The opponent has no cancellation control; cancellation by the creator removes the challenge from the opponent's view.
Accept and abort Both players reach the same game after acceptance, then receive the abort notification and return home.
History, takebacks, and draws Plays seven turns, including a beetle climbing onto the queen; checks history and absence of move targets during the opponent's turn; rejects and accepts takebacks, then rejects and accepts draw offers. Both players see the agreed draw.
Chat and resignation Plays four turns, exchanges messages in both directions, checks unread alerts when chat is closed and their absence for messages read in open chat, then confirms both players see the resignation winner.

Mobile history checks exercise Previous, Next, First, and Last in portrait layout, asserting piece positions, stack levels, and disabled navigation at boundaries. Desktop checks verify the move list and selected history entries.

Tests of the supporting infrastructure

  • Unit tests: Cover account allocation, cleanup safeguards and races, session lifecycle failures, reservation loss, and WebKit interception boundaries.
  • Database integration tests: Verify seed rollback/reapplication, exclusive reservations, waiting and reuse, coordination across processes, and lock release after an owner is killed.
  • Browser recovery tests: On Chromium desktop and WebKit mobile, simulate abandoned direct/public challenges and unfinished games, then verify recovery before reuse. Also check cleanup after an intentional scenario failure.
  • Reporter tests: Exercise passes, retries, failures, skips, timeouts, and setup/teardown errors, including report links, escaping, and truncation.

CI and validation

  • CI currently selects the five challenge/gameplay scenarios: 30 cases. Anonymous smoke coverage and the supporting test suites run separately.
  • Results include a scenario-by-browser matrix, expandable steps, failure/flaky diagnostics, and source links. HTML reports, first-retry traces, and server diagnostics are retained for seven days.
  • The workflow runs on PRs targeting main, manual dispatch, and temporarily on pushes to testware_finally.

Execution status: This description is based on inspection of the branch changes; tests were not run while preparing it.

Cover challenges, gameplay, and navigation on desktop and mobile. Run the Docker test stack in GitHub Actions with readable summaries, consolidated reports and diagnostics, and supporting fixtures and UI labels.
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