[Tests] Play card interactions through a Cockatrice event player (#7697)

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-11-04 06:23:45 +01:00 • committed by GitHub
parent 34201122ec
commit 3fa8d78786
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 1119 additions and 3 deletions

View file

@ -50,3 +50,17 @@ A test is a `<events>` list. Widgets are named by their path from the main windo
| `activate` | action or menu name | triggers a QAction (menus are opened first) |
| `key` | Qt key code | presses that key on the focused widget |
| `pause` | milliseconds | waits, letting the UI settle |
| `clickCard` | `card,zone` | double click the card found in that zone (plays it from hand) |
| `flipCard` | `card,zone` | right-click → *Turn Over* |
| `cardAction` | `card,zone,label` | right-click → first menu entry whose label contains `label` (submenus included) |
| `moveCard` | `card,srcZone,dstZone` | drags the card onto the destination zone |
| `drawArrow` | `srcCard,srcZone,dstCard,dstZone` | right-drag an arrow between two cards |
| `createToken` | `name,color,pt` | creates a token as the active local player |
| `selectItem` | `item label` | selects the tree/list entry with that label |
| `typeText` | `text` | types text one key event at a time |
| `expectProperty` | `property,value` | fails playback unless the widget property matches |
The card, item and property commands are `pqCockatriceEventPlayer`
(`cockatrice/src/game_graphics/pq_cockatrice_event_player.h`). They resolve cards by name
and zone through the `QGraphicsScene` and send real mouse events at the card's current
viewport position, so a test does not depend on the window size or screen resolution.

View file

@ -0,0 +1,69 @@
<events>
<!--
Card actions (custom commands of pqCockatriceEventPlayer).
Exercises the context menu path (tap, counters in a submenu, flip),
arrow drawing, and dragging a card between zones. All of it through
mouse events on the game view, so the same file runs at any resolution.
-->
<!-- ===== Two-player local game ===== -->
<event widget="MainWindow/menubar/cockatriceMenu" command="activate" arguments="Start &amp;local game..." />
<event widget="MainWindow/localGameDialog/generalGroupBox/numberPlayersEdit" command="set_int" arguments="2" />
<event widget="MainWindow/localGameDialog" command="key" arguments="16777220" />
<event widget="MainWindow" command="pause" arguments="1000" />
<!-- ===== Player 1 loads a one-card deck ===== -->
<!-- (No tab-count assertion: the restored workspace state decides how many other
tabs exist, and the paths below already prove the game tab is there.) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_0/qt_tabwidget_stackedwidget/deckViewContainer/loadFromClipboardButton" command="activate" arguments="" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_0/qt_tabwidget_stackedwidget/deckViewContainer/dlgDeckTextEdit/contentsEdit" command="typeText" arguments="1 Lightning Bolt" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_0/qt_tabwidget_stackedwidget/deckViewContainer/dlgDeckTextEdit" command="keyEvent" arguments="6,16777220,67108864,,0,1" />
<event widget="MainWindow" command="pause" arguments="500" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_0/qt_tabwidget_stackedwidget/deckViewContainer/readyStartButton" command="activate" arguments="" />
<event widget="MainWindow" command="pause" arguments="300" />
<!-- ===== Player 2 loads the same deck and readies up ===== -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_1/qt_tabwidget_stackedwidget/deckViewContainer/loadFromClipboardButton" command="activate" arguments="" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_1/qt_tabwidget_stackedwidget/deckViewContainer/dlgDeckTextEdit/contentsEdit" command="typeText" arguments="1 Lightning Bolt" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_1/qt_tabwidget_stackedwidget/deckViewContainer/dlgDeckTextEdit" command="keyEvent" arguments="6,16777220,67108864,,0,1" />
<event widget="MainWindow" command="pause" arguments="500" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_1/qt_tabwidget_stackedwidget/deckViewContainer/readyStartButton" command="activate" arguments="" />
<event widget="MainWindow" command="pause" arguments="1000" />
<!-- ===== Player 1, precombat main ===== -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="300" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="300" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="500" />
<!-- ===== A token to interact with ===== -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/gamePlayAreaWidget/gameView" command="createToken" arguments="Goblin,r,1/1" />
<event widget="MainWindow" command="pause" arguments="1000" />
<!-- Tap it through the context menu -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/gamePlayAreaWidget/gameView" command="cardAction" arguments="Goblin,table,Tap / Untap" />
<event widget="MainWindow" command="pause" arguments="300" />
<!-- Add a counter: the entry lives in the "Card counters" submenu -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/gamePlayAreaWidget/gameView" command="cardAction" arguments="Goblin,table,Add counter (A)" />
<event widget="MainWindow" command="pause" arguments="300" />
<!-- Flip it face down -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/gamePlayAreaWidget/gameView" command="flipCard" arguments="Goblin,table" />
<event widget="MainWindow" command="pause" arguments="300" />
<!-- ===== An arrow from a second token to the Goblin ===== -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/gamePlayAreaWidget/gameView" command="createToken" arguments="Elf,w,1/1" />
<event widget="MainWindow" command="pause" arguments="1000" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/gamePlayAreaWidget/gameView" command="drawArrow" arguments="Elf,table,Goblin,table" />
<event widget="MainWindow" command="pause" arguments="500" />
<!-- ===== Drag the Goblin into the graveyard ===== -->
<!-- A token that leaves the battlefield is destroyed rather than moved, so
there is nothing to drag back afterwards. -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/gamePlayAreaWidget/gameView" command="moveCard" arguments="Goblin,table,grave" />
<event widget="MainWindow" command="pause" arguments="1000" />
</events>

View file

@ -0,0 +1,101 @@
<events>
<!--
Tier 7: Game Mechanics
Tests: play cards (clickCard), flip cards (flipCard),
create tokens (createToken), draw arrows (drawArrow).
All interactions are pure UI mouse events through the QGraphicsView viewport.
-->
<!-- ===== Start a local 2-player game ===== -->
<event widget="MainWindow/menubar/cockatriceMenu" command="activate" arguments="Start &amp;local game..." />
<!-- Force two players so both deck views exist, independent of the user's settings -->
<event widget="MainWindow/localGameDialog/generalGroupBox/numberPlayersEdit" command="set_int" arguments="2" />
<event widget="MainWindow/localGameDialog" command="key" arguments="16777220" />
<!-- ===== Player 1: Load 3-card deck ===== -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_0/qt_tabwidget_stackedwidget/deckViewContainer/loadFromClipboardButton" command="activate" arguments="" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_0/qt_tabwidget_stackedwidget/deckViewContainer/dlgDeckTextEdit/contentsEdit" command="keyEvent" arguments="6,65,67108864,,0,1" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_0/qt_tabwidget_stackedwidget/deckViewContainer/dlgDeckTextEdit/contentsEdit" command="typeText" arguments="3 Lightning Bolt" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_0/qt_tabwidget_stackedwidget/deckViewContainer/dlgDeckTextEdit" command="keyEvent" arguments="6,16777220,67108864,,0,1" />
<event widget="MainWindow" command="pause" arguments="500" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_0/qt_tabwidget_stackedwidget/deckViewContainer/readyStartButton" command="activate" arguments="" />
<event widget="MainWindow" command="pause" arguments="300" />
<!-- ===== Player 2: Load same deck ===== -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_1/qt_tabwidget_stackedwidget/deckViewContainer/loadFromClipboardButton" command="activate" arguments="" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_1/qt_tabwidget_stackedwidget/deckViewContainer/dlgDeckTextEdit/contentsEdit" command="keyEvent" arguments="6,65,67108864,,0,1" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_1/qt_tabwidget_stackedwidget/deckViewContainer/dlgDeckTextEdit/contentsEdit" command="typeText" arguments="3 Lightning Bolt" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_1/qt_tabwidget_stackedwidget/deckViewContainer/dlgDeckTextEdit" command="keyEvent" arguments="6,16777220,67108864,,0,1" />
<event widget="MainWindow" command="pause" arguments="500" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_1/qt_tabwidget_stackedwidget/deckViewContainer/readyStartButton" command="activate" arguments="" />
<event widget="MainWindow" command="pause" arguments="1000" />
<!-- ===== Player 1, Turn 1 ===== -->
<!-- Upkeep → Draw → Main 1 -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="300" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="500" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="500" />
<!-- Create a Goblin token -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/gamePlayAreaWidget/gameView" command="createToken" arguments="Goblin,r,1/1" />
<event widget="MainWindow" command="pause" arguments="1000" />
<!-- Create a second token (Elf) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/gamePlayAreaWidget/gameView" command="createToken" arguments="Elf,w,1/1" />
<event widget="MainWindow" command="pause" arguments="1000" />
<!-- Flip the Goblin (right-click → Turn Over) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/gamePlayAreaWidget/gameView" command="flipCard" arguments="Goblin,table" />
<event widget="MainWindow" command="pause" arguments="500" />
<!-- Play a Lightning Bolt from hand (double-click) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/gamePlayAreaWidget/gameView" command="clickCard" arguments="Lightning Bolt,hand" />
<event widget="MainWindow" command="pause" arguments="500" -->
<!-- Draw arrow from Elf to Goblin (right-drag) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/gamePlayAreaWidget/gameView" command="drawArrow" arguments="Elf,table,Goblin,table" />
<event widget="MainWindow" command="pause" arguments="500" />
<!-- Advance through all remaining phases to end turn -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="200" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="200" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="200" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="200" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="200" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="200" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="500" />
<!-- ===== Player 2, Turn 1 ===== -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="300" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="500" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="500" />
<!-- Advance through all phases to end turn -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="200" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="200" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="200" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="200" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="200" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="200" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="500" />
</events>

View file

@ -0,0 +1,178 @@
<events>
<!--
Tier 6: Local Game Lifecycle (Extended)
Tests: create game -> load decks -> ready up -> game starts
-> play through turns using menu activate commands
Phase actions triggered via activate on phasesMenu:
aNextPhaseAction advances phase + triggers phase action (e.g., draw at draw step)
aNextTurn in gameMenu triggers next turn
This avoids keyboard shortcut issues in offscreen/test environments.
-->
<!-- ===== Phase 1: Start a local game via main menu ===== -->
<event widget="MainWindow/menubar/cockatriceMenu" command="activate" arguments="Start &amp;local game..." />
<!-- Force two players so both deck views exist, independent of the user's settings -->
<event widget="MainWindow/localGameDialog/generalGroupBox/numberPlayersEdit" command="set_int" arguments="2" />
<event widget="MainWindow/localGameDialog" command="key" arguments="16777220" />
<!-- ===== Phase 2: Player 1 loads deck from clipboard ===== -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_0/qt_tabwidget_stackedwidget/deckViewContainer/loadFromClipboardButton" command="activate" arguments="" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_0/qt_tabwidget_stackedwidget/deckViewContainer/dlgDeckTextEdit/contentsEdit" command="keyEvent" arguments="6,65,67108864,,0,1" />
<!-- 1 Lightning Bolt -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_0/qt_tabwidget_stackedwidget/deckViewContainer/dlgDeckTextEdit/contentsEdit" command="typeText" arguments="1 Lightning Bolt" />
<!-- Ctrl+Return to accept clipboard dialog -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_0/qt_tabwidget_stackedwidget/deckViewContainer/dlgDeckTextEdit" command="keyEvent" arguments="6,16777220,67108864,,0,1" />
<!-- Delay -->
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Player 1 ready up -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_0/qt_tabwidget_stackedwidget/deckViewContainer/readyStartButton" command="activate" arguments="" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- ===== Phase 3: Player 2 loads deck from clipboard ===== -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_1/qt_tabwidget_stackedwidget/deckViewContainer/loadFromClipboardButton" command="activate" arguments="" />
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_1/qt_tabwidget_stackedwidget/deckViewContainer/dlgDeckTextEdit/contentsEdit" command="keyEvent" arguments="6,65,67108864,,0,1" />
<!-- 1 Lightning Bolt -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_1/qt_tabwidget_stackedwidget/deckViewContainer/dlgDeckTextEdit/contentsEdit" command="typeText" arguments="1 Lightning Bolt" />
<!-- Ctrl+Return to accept clipboard dialog -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_1/qt_tabwidget_stackedwidget/deckViewContainer/dlgDeckTextEdit" command="keyEvent" arguments="6,16777220,67108864,,0,1" />
<!-- Delay -->
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Player 2 ready up -> game auto-starts -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/deckViewContainerWidget/tabbedDeckView_1/qt_tabwidget_stackedwidget/deckViewContainer/readyStartButton" command="activate" arguments="" />
<!-- Delay for game to start -->
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- ===== Phase 4: Advance through all 11 phases via phasesMenu activate ===== -->
<!-- Using activate on phasesMenu triggers aNextPhaseAction which:
- advances the phase by 1
- calls triggerPhaseAction (e.g., draw card at draw step, untap all at untap) -->
<!-- Phase 0 (Untap) → 1 (Upkeep) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Phase 1 (Upkeep) → 2 (Draw): TRIGGERS DRAW — Player 1 draws 1 card -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="500" />
<!-- Phase 2 (Draw) → 3 (Main 1) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="500" />
<!-- ===== Main 1: Play a card from hand by double-click ===== -->
<!-- clickCard resolves card by name in the scene, maps to viewport coords at current window size. -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/mainWidget/gamePlayAreaWidget/gameView" command="clickCard" arguments="Lightning Bolt,hand" />
<event widget="MainWindow" command="pause" arguments="500" />
<!-- Phase 3 → 4 (Begin Combat) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="pause" arguments="300" />
<!-- Phase 4 → 5 (Declare Attackers) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Phase 5 → 6 (Declare Blockers) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Phase 6 → 7 (Combat Damage) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Phase 7 → 8 (End Combat) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Phase 8 → 9 (Main 2) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Phase 9 → 10 (Cleanup) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Phase 10 → 0 (Untap): TRIGGERS NEXT TURN + UNTAP ALL — now Player 2's turn -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<!-- Delay for turn transition -->
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- ===== Phase 5: Player 2's turn — advance through all 11 phases ===== -->
<!-- Phase 0 (Untap) → 1 (Upkeep) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Phase 1 (Upkeep) → 2 (Draw): TRIGGERS DRAW — Player 2 draws 1 card -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Phase 2 (Draw) → 3 (Main 1) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Phase 3 → 4 (Begin Combat) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Phase 4 → 5 (Declare Attackers) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Phase 5 → 6 (Declare Blockers) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Phase 6 → 7 (Combat Damage) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Phase 7 → 8 (End Combat) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Phase 8 → 9 (Main 2) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Phase 9 → 10 (Cleanup) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Phase 10 → 0 (Untap): TRIGGERS NEXT TURN — back to Player 1 -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<!-- Delay -->
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- ===== Phase 6: Player 1 turn 2 — advance to draw again ===== -->
<!-- Phase 0 (Untap) → 1 (Upkeep) -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
<!-- Phase 1 (Upkeep) → 2 (Draw): TRIGGERS DRAW — Player 1 draws again -->
<event widget="MainWindow/tabSupervisor/stackedWidget/TabGame/phasesMenu" command="activate" arguments="aNextPhaseAction" />
<event widget="MainWindow" command="key" arguments="32" />
<event widget="MainWindow" command="key" arguments="32" />
</events>