Skip to content

Commit

Permalink
Address some of @touilleMan's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vxgmichel committed Jul 29, 2021
1 parent 17ecb51 commit dcf4551
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tests/core/gui/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,7 @@ def right_main_window():
# For some reasons, the main window from the previous test might
# still be around. Simply wait for things to settle down until
# our freshly created window is detected as the app main window.
# TODO: investigate why `await aqtbot.wait_until(right_main_window)` fails
aqtbot.qtbot.wait_until(right_main_window)
await aqtbot.wait_until(right_main_window)

return main_w

Expand Down Expand Up @@ -413,13 +412,17 @@ async def test_switch_to_files_widget(self, workspace_name, error=False):
raise AssertionError(f"Workspace `{workspace_name}` not found")

f_w = self.test_get_files_widget()
async with aqtbot.wait_exposed(f_w), aqtbot.wait_signal(f_w.folder_changed):
# We need to make sure the workspace button is ready for left click first
await aqtbot.wait_until(wk_button.switch_button.isChecked)
# Send the click

# We need to make sure the workspace button is ready for left click first
async with aqtbot.wait_exposed(f_w):
pass
await aqtbot.wait_until(wk_button.switch_button.isChecked)

# Send the click and wait for the folder changed signal
async with aqtbot.wait_signal(f_w.folder_changed):
aqtbot.mouse_click(wk_button, QtCore.Qt.LeftButton)

# Wait for the spinner to disappear
# Wait for the spinner to disappear, meaning the folder information is properly displayed
await aqtbot.wait_until(f_w.spinner.isHidden)
return f_w

Expand Down

0 comments on commit dcf4551

Please sign in to comment.