chore: wait until appears removed

This commit is contained in:
Anastasiya Semenkevich 2023-12-11 10:20:29 +03:00 committed by Anastasiya
parent 2f6973e03d
commit a161df0c65
2 changed files with 3 additions and 4 deletions

View File

@ -126,12 +126,12 @@ class LeftPanel(QObject):
def open_wallet(self, attempts: int = 2) -> WalletScreen: def open_wallet(self, attempts: int = 2) -> WalletScreen:
self._wallet_button.click() self._wallet_button.click()
try: try:
return WalletScreen().wait_until_appears() return WalletScreen()
except AssertionError as err: except Exception as ex:
if attempts: if attempts:
return self.open_wallet(attempts - 1) return self.open_wallet(attempts - 1)
else: else:
raise err raise ex
class MainWindow(Window): class MainWindow(Window):

View File

@ -84,7 +84,6 @@ def test_settings_include_in_total_balance(main_screen: MainWindow, name, watche
main_screen.left_panel.open_wallet().left_panel.hide_include_in_total_balance_from_context_menu(name) main_screen.left_panel.open_wallet().left_panel.hide_include_in_total_balance_from_context_menu(name)
with step('Check the balance is back to 0 again'): with step('Check the balance is back to 0 again'):
main_screen.left_panel.open_wallet()
assert driver.waitFor( assert driver.waitFor(
lambda: float(wallet_main_screen.left_panel.get_total_balance_value().replace("\xa0", "") lambda: float(wallet_main_screen.left_panel.get_total_balance_value().replace("\xa0", "")
.replace(",", "")) == 0, configs.timeouts.UI_LOAD_TIMEOUT_MSEC), \ .replace(",", "")) == 0, configs.timeouts.UI_LOAD_TIMEOUT_MSEC), \