Skip to content

Playwright tests#61

Merged
mpalmerlee merged 21 commits into
masterfrom
playwright-tests
Jun 11, 2026
Merged

Playwright tests#61
mpalmerlee merged 21 commits into
masterfrom
playwright-tests

Conversation

@mpalmerlee

@mpalmerlee mpalmerlee commented May 3, 2026

Copy link
Copy Markdown
Contributor

Added end to end playwright browser tests, code checks in GH actions and fixes for lint, etc...

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 3, 2026

Copy link
Copy Markdown

Deploying astriarch with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6e37080
Status: ✅  Deploy successful!
Preview URL: https://4f647f2a.astriarch.pages.dev
Branch Preview URL: https://playwright-tests.astriarch.pages.dev

View logs

@mpalmerlee mpalmerlee marked this pull request as ready for review May 11, 2026 23:53
@mpalmerlee mpalmerlee requested a review from Copilot May 11, 2026 23:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds Playwright-based end-to-end coverage for core multiplayer flows (create/join/resume/start game + basic in-game navigation) by introducing stable data-testid selectors in the Svelte UI, a test-only backend cleanup route, and a CI workflow to run lint/format/unit tests plus E2E.

Changes:

  • Added Playwright E2E test harness in apps/astriarch-frontend/e2e + Playwright config that boots a dedicated backend/frontend stack for tests.
  • Introduced test-only backend cleanup endpoint (POST /api/test/cleanup) and wired it behind NODE_ENV=test.
  • Added/adjusted UI data-testid hooks and various lint/test updates across frontend and engine/backend test suites.

Reviewed changes

Copilot reviewed 74 out of 75 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
README.md Documents how to run E2E tests locally
pnpm-lock.yaml Adds Playwright deps and lock updates
package.json Updates packageManager and keeps workspace scripts aligned
packages/astriarch-engine/src/engine/gameController.spec.ts Adds unit coverage for AI command processing in clock advance
packages/astriarch-engine/src/engine/computerPlayer.ts Formatting + exploration distance sort behavior change
packages/astriarch-engine/src/engine/computerPlayer.spec.ts Test refactors, less noisy output, updated simulation expectations
packages/astriarch-engine/src/engine/battleSimulator.spec.ts Loosens probabilistic thresholds + silences logs by default
apps/astriarch-frontend/src/stories/Page.stories.svelte Removes unused import
apps/astriarch-frontend/src/routes/test/+page.svelte Cleanup: removes unused state/imports + adds keyed each blocks
apps/astriarch-frontend/src/routes/+page.svelte Adds E2E selectors + notification test hook
apps/astriarch-frontend/src/lib/utils/notificationUtils.ts Adds lint suppression for unknown notification type logging
apps/astriarch-frontend/src/lib/services/websocket.ts Adds lint suppression around event.data access
apps/astriarch-frontend/src/lib/components/lobby/LobbyView.svelte Adds view/test selectors + removes unused state
apps/astriarch-frontend/src/lib/components/lobby/GameOptionsView.svelte Adds testids + keyed each blocks
apps/astriarch-frontend/src/lib/components/lobby/GameList.svelte Adds testid to game list rows
apps/astriarch-frontend/src/lib/components/lobby/GameDetails.svelte Adds testids + keys; uses any for status compatibility
apps/astriarch-frontend/src/lib/components/layout/TabView.svelte Adds keys + typing lint suppressions
apps/astriarch-frontend/src/lib/components/game/GameOverModal.svelte Removes unused import
apps/astriarch-frontend/src/lib/components/game-views/TradingCenterView.svelte Removes unused imports + adds keyed each blocks
apps/astriarch-frontend/src/lib/components/game-views/ShipCardSummary.svelte Makes each deterministic with stable keys
apps/astriarch-frontend/src/lib/components/game-views/ShipCard.svelte Makes each deterministic with stable keys
apps/astriarch-frontend/src/lib/components/game-views/ResearchLabView.svelte Removes unused store usage + adds keys and lint suppressions
apps/astriarch-frontend/src/lib/components/game-views/PlanetOverviewView.svelte Removes unused imports + adds keyed each blocks
apps/astriarch-frontend/src/lib/components/game-views/PlanetInfoPanel.svelte Removes unused Fleet helper + adds keys and typing suppressions
apps/astriarch-frontend/src/lib/components/game-views/FleetCommandView.svelte Adds send-ships-btn selector + keyed each blocks
apps/astriarch-frontend/src/lib/components/game-views/ActivityView.svelte Adds typing lint suppressions for formatter helpers
apps/astriarch-frontend/src/lib/components/galaxy/GalaxyCanvas.svelte Adds typing lint suppressions for Konva event types
apps/astriarch-frontend/src/lib/components/controls/AvailablePlanetProductionItem.svelte Adds keys + lint suppression for {@html}
apps/astriarch-frontend/src/lib/components/audio/AudioControls.svelte Adjusts state derivation + lint suppression
apps/astriarch-frontend/src/lib/components/atoms/AvailablePlanetProductionItem.svelte Adds keys for cost rows
apps/astriarch-frontend/src/lib/components/astriarch/top-overview/TopOverview.svelte Layout tweaks + typed rest-props support
apps/astriarch-frontend/src/lib/components/astriarch/top-overview-item/TopOverviewItem.svelte Adjusts formatting and min-width + typing for children
apps/astriarch-frontend/src/lib/components/astriarch/top-overview-button/VolumeButton.svelte Adds typed rest-props support
apps/astriarch-frontend/src/lib/components/astriarch/top-overview-button/TopOverviewButton.svelte Adds typed rest-props support + layout tweak
apps/astriarch-frontend/src/lib/components/astriarch/top-overview-button/GameSpeedButton.svelte Removes unused import + typed rest-props support
apps/astriarch-frontend/src/lib/components/astriarch/text/Text.svelte Adds typing for children
apps/astriarch-frontend/src/lib/components/astriarch/tab-controller/TabController.svelte Removes unused onclick prop + adds keyed each
apps/astriarch-frontend/src/lib/components/astriarch/PlanetSelector.svelte Adds keyed each
apps/astriarch-frontend/src/lib/components/astriarch/notification/TaskNotificationPanel.svelte Simplifies types + adds keyed each
apps/astriarch-frontend/src/lib/components/astriarch/notification/TaskItem.svelte Adds lint suppression for debug-only var
apps/astriarch-frontend/src/lib/components/astriarch/notification/Notification.svelte Adds typing for children
apps/astriarch-frontend/src/lib/components/astriarch/navigation-tab/NavigationTabUnselectedSvg.svelte Adds ariaLabel for accessibility + wiring
apps/astriarch-frontend/src/lib/components/astriarch/navigation-tab/NavigationTabSelectedSvg.svelte Adds ariaLabel for accessibility + wiring
apps/astriarch-frontend/src/lib/components/astriarch/navigation-tab/NavigationTab.svelte Passes aria labels through for tab SVGs
apps/astriarch-frontend/src/lib/components/astriarch/navigation-controller/NavigationController.svelte Adds keyed each and typing suppression
apps/astriarch-frontend/src/lib/components/astriarch/dropdown/Dropdown.svelte Adds keyed each
apps/astriarch-frontend/src/lib/components/astriarch/dialog/Dialog.svelte Adds typing suppressions for rest props
apps/astriarch-frontend/src/lib/components/astriarch/card/Card.svelte Adds typing for children
apps/astriarch-frontend/src/lib/components/astriarch/button/Button.svelte Adds typing for children and keeps rest-props forwarding
apps/astriarch-frontend/src/lib/components/astriarch/box/Box.svelte Adds typed rest-props support
apps/astriarch-frontend/src/lib/assets/tab/TabSvgUnselected.svelte Adds lint suppression for $props() typing
apps/astriarch-frontend/playwright.config.ts New Playwright config (starts backend+frontend stack)
apps/astriarch-frontend/package.json Adds E2E scripts + Playwright dep; build now builds engine first
apps/astriarch-frontend/e2e/scenarios/scenario-a-human-vs-ai.spec.ts Scenario A: create vs AI and reach in-game view
apps/astriarch-frontend/e2e/scenarios/scenario-b-two-humans.spec.ts Scenario B: two players join and start together
apps/astriarch-frontend/e2e/scenarios/scenario-c-resume-game.spec.ts Scenario C: reload and resume in-progress game
apps/astriarch-frontend/e2e/scenarios/scenario-d-command-flow.spec.ts Scenario D: verify command flow/UI reachable
apps/astriarch-frontend/e2e/README.md E2E structure + selector contract documentation
apps/astriarch-frontend/e2e/helpers/lobby.ts Lobby/game list helper actions
apps/astriarch-frontend/e2e/helpers/inGame.ts In-game waits/assertions + navigation helpers
apps/astriarch-frontend/e2e/helpers/gameOptions.ts Game-options helper actions
apps/astriarch-frontend/e2e/helpers/cleanup.ts Calls backend cleanup endpoint + name generator
apps/astriarch-frontend/e2e/global-setup.ts Suite-level cleanup before tests
apps/astriarch-frontend/e2e/global-teardown.ts Suite-level cleanup after tests
apps/astriarch-frontend/e2e/fixtures/player.ts Multi-player browser context fixture
apps/astriarch-frontend/.gitignore Ignores Playwright reports/results
apps/astriarch-backend/tsconfig.json Excludes *.spec.ts from main TS build
apps/astriarch-backend/tsconfig.jest.json Jest-specific TS config (adds jest/node types)
apps/astriarch-backend/src/routes/testRoutes.ts Adds test-only cleanup endpoint
apps/astriarch-backend/src/routes/healthRoutes.spec.ts Adds unit test for health route behavior
apps/astriarch-backend/src/app.ts Registers test routes only when NODE_ENV=test
apps/astriarch-backend/scripts/cleanup-test-data.js CLI helper to call cleanup endpoint
apps/astriarch-backend/package.json Adds lint:check + cleanup script
apps/astriarch-backend/jest.config.js Adds Jest config using ts-jest
.github/workflows/code-checks.yml Adds CI jobs for lint/format/unit tests + frontend E2E
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment thread apps/astriarch-frontend/src/lib/components/lobby/GameList.svelte
Comment thread apps/astriarch-frontend/src/routes/+page.svelte
Comment thread apps/astriarch-backend/src/routes/testRoutes.ts Outdated
Comment thread apps/astriarch-frontend/playwright.config.ts Outdated
Comment thread apps/astriarch-frontend/playwright.config.ts
@mpalmerlee mpalmerlee merged commit 466e40a into master Jun 11, 2026
3 checks passed
@mpalmerlee mpalmerlee deleted the playwright-tests branch June 11, 2026 04:17
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