mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-10 03:53:26 -08:00
QtTesting's own `currentChanged` command aborts on a one-element row list, so
pqWidgetTestEventPlayer drives views itself:
- selectRow selects a row through the selection model, the whole row, without a
mouse event
- clickRow left-clicks the centre of a cell, so the view's own handlers run
- doubleClickRow double-clicks it, for views whose double click acts
A tree addresses a row by the path of rows leading to it ("2/0" is the first
child of the third top-level row), and a click opens a collapsed path first.
Rows are model rows, so a filtered or sorted model counts the rows it shows.
Asserting what a command did needs QtTesting's check players, which the XML
source never reached: it marked every event an action, so `modelRowCount` was
rejected as unknown. An event now carries `type="check"` to be played as a
check.
Testing/item_view_test.xml drives the grouped settings navigation through
selectRow and clickRow and asserts the page stack followed.
Testing/deck_editor_double_click_test.xml proves the difference between the two
clicks: a single click on a card database row only selects it, a double click
adds the card to the deck.
34 lines
2 KiB
XML
34 lines
2 KiB
XML
<events>
|
|
<!--
|
|
Item-view driving through a playback.
|
|
|
|
QtTesting's own `currentChanged` command aborts on a one-element row
|
|
list, so rows are selected through the view's selection model or clicked
|
|
with real mouse events instead.
|
|
|
|
The settings navigation tree is grouped, so a page is addressed as
|
|
"group/page": the groups are Application, Cards & Data, Chat &
|
|
Sound and Advanced, and the page stack follows the page order
|
|
General(0) ... Shortcuts(7). Selecting a group header does nothing — the
|
|
headers are not selectable.
|
|
|
|
Double click is covered by deck_editor_double_click_test.xml, where it
|
|
has an effect a single click does not have.
|
|
-->
|
|
<event widget="MainWindow/menubar" command="activate" arguments="cockatriceMenu" />
|
|
<event widget="MainWindow/menubar/cockatriceMenu" command="activate" arguments="actionSettings" />
|
|
<event widget="MainWindow" command="pause" arguments="500" />
|
|
<event widget="MainWindow/settingsDialog/settingsView/pagesContainer/pagesWidget" command="expectProperty" arguments="currentIndex,0" />
|
|
|
|
<!-- Chat & Sound group, second page: Sound -->
|
|
<event widget="MainWindow/settingsDialog/settingsView/navTree" command="selectRow" arguments="2/1" />
|
|
<event widget="MainWindow" command="pause" arguments="300" />
|
|
<event widget="MainWindow/settingsDialog/settingsView/pagesContainer/pagesWidget" command="expectProperty" arguments="currentIndex,6" />
|
|
|
|
<!-- A click goes through the view rather than the selection model: Deck Editor -->
|
|
<event widget="MainWindow/settingsDialog/settingsView/navTree" command="clickRow" arguments="1/0" />
|
|
<event widget="MainWindow" command="pause" arguments="300" />
|
|
<event widget="MainWindow/settingsDialog/settingsView/pagesContainer/pagesWidget" command="expectProperty" arguments="currentIndex,3" />
|
|
|
|
<event widget="MainWindow/settingsDialog/settingsOkButton" command="activate" arguments="" />
|
|
</events>
|