mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 01:23:24 -08:00
[Tests] Assert settings navigation through the event player (#7698)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
3fa8d78786
commit
96f8c3a423
2 changed files with 36 additions and 0 deletions
33
Testing/settings_navigation_test.xml
Normal file
33
Testing/settings_navigation_test.xml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<events>
|
||||
<!--
|
||||
Settings navigation (state assertions).
|
||||
|
||||
Navigates the settings page tree by label, checks that the page stack
|
||||
followed, then filters with the search box and verifies the text landed
|
||||
in the edit — then closes with the OK button.
|
||||
-->
|
||||
<event widget="MainWindow/menubar" command="activate" arguments="cockatriceMenu" />
|
||||
<event widget="MainWindow/menubar/cockatriceMenu" command="activate" arguments="actionSettings" />
|
||||
<event widget="MainWindow" command="pause" arguments="500" />
|
||||
|
||||
<!-- The dialog opens on the first page (General) -->
|
||||
<event widget="MainWindow/settingsDialog/settingsView/pagesContainer/pagesWidget" command="expectProperty" arguments="currentIndex,0" />
|
||||
|
||||
<!-- Navigate to Shortcuts, the last page of the tree -->
|
||||
<event widget="MainWindow/settingsDialog/settingsView/navTree" command="selectItem" arguments="Shortcuts" />
|
||||
<event widget="MainWindow" command="pause" arguments="300" />
|
||||
<event widget="MainWindow/settingsDialog/settingsView/pagesContainer/pagesWidget" command="expectProperty" arguments="currentIndex,7" />
|
||||
|
||||
<!-- ... and back to General -->
|
||||
<event widget="MainWindow/settingsDialog/settingsView/navTree" command="selectItem" arguments="General" />
|
||||
<event widget="MainWindow" command="pause" arguments="300" />
|
||||
<event widget="MainWindow/settingsDialog/settingsView/pagesContainer/pagesWidget" command="expectProperty" arguments="currentIndex,0" />
|
||||
|
||||
<!-- Filters the settings by search term -->
|
||||
<event widget="MainWindow/settingsDialog/settingsView/settingsSearchEdit" command="typeText" arguments="sound" />
|
||||
<event widget="MainWindow" command="pause" arguments="300" />
|
||||
<event widget="MainWindow/settingsDialog/settingsView/settingsSearchEdit" command="expectProperty" arguments="text,sound" />
|
||||
|
||||
<!-- Close -->
|
||||
<event widget="MainWindow/settingsDialog/settingsOkButton" command="activate" arguments="" />
|
||||
</events>
|
||||
|
|
@ -144,6 +144,7 @@ void SettingsView::setupUi()
|
|||
|
||||
// Pages stacked widget
|
||||
pagesWidget = new QStackedWidget;
|
||||
pagesWidget->setObjectName("pagesWidget");
|
||||
|
||||
auto *generalPage = new GeneralSettingsPage;
|
||||
auto *appearancePage = new AppearanceSettingsPage;
|
||||
|
|
@ -208,6 +209,7 @@ void SettingsView::setupUi()
|
|||
|
||||
// Pages container (stacked widget + search results overlay)
|
||||
pagesContainer = new QWidget;
|
||||
pagesContainer->setObjectName("pagesContainer");
|
||||
auto *containerLayout = new QStackedLayout;
|
||||
containerLayout->setStackingMode(QStackedLayout::StackAll);
|
||||
containerLayout->addWidget(pagesWidget);
|
||||
|
|
@ -247,6 +249,7 @@ void SettingsView::setupUi()
|
|||
void SettingsView::setupNavTree()
|
||||
{
|
||||
navTree = new QTreeWidget;
|
||||
navTree->setObjectName("navTree");
|
||||
navTree->setHeaderHidden(true);
|
||||
navTree->setRootIsDecorated(true);
|
||||
navTree->setIconSize(QSize(24, 24));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue