Skip to content

Commit

Permalink
changed the shock checkbox test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrequ committed Mar 18, 2024
1 parent 36deb0f commit 13a552f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,22 @@ def test_toggle_show_shock_checkbox(app, qtbot):
"""
assert app.ui.checkBox_display_shock.isChecked()

# Click on the checkbox to toggle it off
qtbot.mouseClick(app.ui.checkBox_display_shock, Qt.LeftButton)
qtbot.wait(100) # event might be asynchronous

# Wait for the checkbox state to update
qtbot.waitUntil(lambda: not app.ui.checkBox_display_shock.isChecked())

# Assert that the checkbox is now unchecked
assert not app.ui.checkBox_display_shock.isChecked()

# Click on the checkbox again to toggle it on
qtbot.mouseClick(app.ui.checkBox_display_shock, Qt.LeftButton)
qtbot.wait(100)

# Wait for the checkbox state to update
qtbot.waitUntil(lambda: app.ui.checkBox_display_shock.isChecked())

# Assert that the checkbox is now checked
assert app.ui.checkBox_display_shock.isChecked()


Expand Down

0 comments on commit 13a552f

Please sign in to comment.