feat(e2e): add Playwright E2E testing infrastructure - #218
Closed
NicoRuedaA wants to merge 30 commits into
Closed
Conversation
Eliminate 52 football remnants from the OFM-to-OLManager migration across 3 phases: critical domain changes, medium i18n/cleanup, low deprecations. Phase A - Critical: - Rename StandingEntry: goals_for/against -> maps_won/lost, kill_difference() - Remove formation from Team (struct + V53 migration) - Remove clean_sheets, footedness, yellow_cards/red_cards, draws - #[deprecated] on Position enum (use LolRole instead) - Replace CompactTeamMatchStatsData with LoL stats - Rewrite SquadTab.helpers.ts: buildPitchRows -> buildLaneRows - PlayStyle -> DraftStrategy (backend + frontend + V54 migration) - Remove football_nation from WorldEditorTab, store types, scripts Phase B - Medium: - Rename i18n keys: footballHerald->lolEsports, pitchInteractionHint->riftInteractionHint - Rename footballTermGuard.ts -> guard.ts - Rename FOOTBALL_IDENTITIES -> LEGACY_NATIONAL_IDENTITIES - Remove openfootlogo.svg references - Migrate test data from 4-4-2 to LoL 5-role rosters Phase C - Low: - Clean up Rust/frontend comments (football -> legacy/LoL) - Remove offsides from test fixtures - Archive migration proposals to docs/legacy/archived-proposals/ - Update lec_world.json description from OpenFootManager to OLManager Fixes: - Add missing locale argument to finish_live_match_internal (blocked game load) Stadium/arena rename excluded by user request.
- Add missing getStandingKillsFor and getStandingKillsAgainst wrappers in types.ts - Fix TournamentsTab test: Fixtures -> Matches (post i18n rename) - Game now loads correctly, all 646 frontend tests pass
- Replace openfootlogo.svg with olmanager-logo.svg - Restore img tag in MainMenu.tsx pointing to new logo - New SVG logo with shield crest + Open League Manager text
Renamed 5 player attributes and removed 3 dead goalkeeper fields: - pace -> reaction_speed - strength -> durability - passing -> coordination - tackling -> interception - defending -> positional_defense - REMOVED: handling, reflexes, aerial (dead code, unused) All renamed fields have #[serde(alias)] for backward compat.
- TeamData: play_style -> draft_strategy - EngineTeamData: play_style -> draft_strategy - LeagueStandingSnapshot: removed drawn, goals_for->maps_won, goals_against->maps_lost - Fixed 80+ test files with outdated field references - Removed draws/drawn/formation from test data
Covers Team, Player, and Staff attributes with their in-game effects, usage locations, and multiplier formulas. Includes LolStaffEffects output chain (coaching→8 multipliers) and full match flow diagram.
- Removed deprecated Position enum (17 football variants) and all references - Removed CoachingSpecialization enum (7 variants, 3 unused) and specialization field - Removed shared.rs from engine (dead code: PlayerSnap, TraitContext, DraftStrategyPhase, etc.) - Removed default_engine_attr helper - Updated tests, DB queries, staff effects, and training mappings accordingly
- Added logo_url: Option<String> to Team struct - Populated from team name slug on world load - Removed FALLBACK_TEAM_LOGOS hardcoded mapping - Renamed resolveExampleTeamLogo → resolveTeamLogo with optional logoUrl param
… paths - Rename lec_world.json to world.json, generate-lec-world.mjs to generate-world.mjs - Rename lec-default to default in Rust and frontend - Add logo_url to each team in world.json (local /teams-icons/slug.webp) - Fix Movistar KOI slug from mad-lions to movistar-koi - Move team shields to public/teams-icons/ as WebP - Remove shifters external lolesports URL (local shield now) - Update Rust fallback path from /team-logos/ to /teams-icons/
…ibutes - Fix Rust world_source check from lec-default to default - Fix attrsFor() to merge 16 old attrs into 9 new LoL attrs - Remove weak_foot from generated player data - Regenerate world.json with 9-attribute format
- Install @playwright/test with chromium - Create e2e/playwright.config.ts - Create e2e/tests/new-game.spec.ts with full onboarding flow - Add test:e2e and test:e2e:ui npm scripts
- Create e2e/mocks/tauri.js with mock invoke responses - Mock covers start_new_game, get_team_selection_data, select_team - Team/player data generated inline with realistic LoL attrs - Update playwright.config to use webServer (npm run dev) - Update test to inject mock before each test via addInitScript
…r path - Add click on 'Nueva Partida' to switch menuState from 'main' to 'create' - Change HTML reporter output to e2e-report to avoid clash with test output - Clean up old test-results directory
- DatePicker is 3 separate inputs (day/month/year), not native type=date - Select month via dropdown, first day, year via numeric inputs - Handle nationality button dropdown with search
- Use button[type=submit] instead of locale-specific text for start - Use Dirigir text for manage button (Spanish locale) - Simplify DatePicker selectors - Handle nationality dropdown with waitFor before click
…e-load tests - Expand tauri.js mock to handle 40+ invoke commands - Add 6 new test files covering core gameplay flows - All tests share onboarding fixture via beforeEach - Mock returns realistic game state with advancing week counter
…avigation tests - Add get_active_game, get_champions, save_game handlers to mock - Add Squad, Training, Schedule tab navigation tests - Fix viewport issue with browser.newContext - Consolidate tests into new-game.spec.ts (stable execution order) - Add waitUntil: networkidle for first page load
- Change Squad/Training/Schedule selectors to Spanish (Plantilla/Entrenamiento/Calendario) - Settings default language is es (Spanish) - Sidebar uses translated labels for aria-label - Dashboard sidebar club items conditional on !isUnemployed - Spanish translations confirmed from es.json
- Fix getCurrentWindow crash: add metadata to __TAURI_INTERNALS__ mock - Add plugin:window handlers for 25+ window methods - Fix squad roster: set manager_id on Fnatic team for proper team lookup - Verify all sidebar tabs: Dashboard, Squad, Inbox, News, Schedule, Training, Players, Teams, Settings - All 9 navigation flows tested in 25.6 seconds
NicoRuedaA
marked this pull request as ready for review
May 11, 2026 19:33
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.
Summary
Adds end-to-end testing infrastructure using Playwright with a mocked Tauri backend, targeting the Vite dev server.
Changes
Infrastructure
e2e/playwright.config.tswith auto-starting Vite dev servere2e/mocks/tauri.js— full mock forwindow.__TAURI_INTERNALS__handling 30+ invoke commands and 25+ window plugin methodstest:e2e(headless),test:e2e:ui(interactive)Test Coverage
The
complete game flowtest covers the full user journey (25.7s runtime):Key Fixes Discovered
getCurrentWindow()from@tauri-apps/api/windowrequireswindow.__TAURI_INTERNALS__.metadata(was causing React unmount → blank page)team.manager_id === managerId— teams must havemanager_idsetTesting
Closes #217