Draft
Add Playwright automation for AI agent game testing#53
Conversation
Co-authored-by: durangogt <10979447+durangogt@users.noreply.github.com>
…ation Co-authored-by: durangogt <10979447+durangogt@users.noreply.github.com>
Co-authored-by: durangogt <10979447+durangogt@users.noreply.github.com>
…ss configurable Co-authored-by: durangogt <10979447+durangogt@users.noreply.github.com>
Co-authored-by: durangogt <10979447+durangogt@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add Playwright automation for AI agent game testing
Add Playwright automation for AI agent game testing
Feb 6, 2026
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.
Enables programmatic control of the web game via Playwright for automated testing and AI agent interaction. Agents can now play complete games, control all 4 players, and detect bugs automatically.
Architecture
Three-layer bridge between Playwright and Pygbag/WebAssembly:
Core Components
JavaScript API (
web/index.html)window.gameStatewith 9 methods:getCurrentPlayer(),getMarblePositions(),getDiceRoll(),getValidMoves(),isGameOver(),getWinner(),getFullState(),getMoveLog(),isReady()State Exporter (
web/state_exporter.py)aggravation_web.pywith 4 minimal additionsPlaywright Harness (
tests/test_web_automation.py)AggravationAutomationclass with game control methodsHEADLESSenv varExample Usage
Files Changed
New:
tests/test_web_automation.py- Automation harness (340 lines)web/state_exporter.py- State export module (85 lines)web/index.html- JavaScript API (200 lines)examples/simple_automation.py- Demo script (140 lines)AUTOMATION.md,TESTING_AUTOMATION.md,tests/README.md,examples/README.mdvalidate_automation_setup.py- Setup validatorModified:
web/aggravation_web.py- Added state export calls (+4 lines).gitignore- Excluded automation artifactsSetup & Usage
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.