Playwright tests#61
Merged
Merged
Conversation
Deploying astriarch with
|
| Latest commit: |
6e37080
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4f647f2a.astriarch.pages.dev |
| Branch Preview URL: | https://playwright-tests.astriarch.pages.dev |
There was a problem hiding this comment.
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 behindNODE_ENV=test. - Added/adjusted UI
data-testidhooks 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
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.
Added end to end playwright browser tests, code checks in GH actions and fixes for lint, etc...