chore: stabilise test (#333)

* chore: fix testnet toggle test and total balace wallet test

* chore: increase timeout for syncing test

* chore: disable test mode and remove keycard hide steps
This commit is contained in:
Anastasiya 2023-11-22 13:42:26 +03:00 committed by GitHub
parent 85b0aa1509
commit b74ba4f7eb
8 changed files with 11 additions and 12 deletions

View File

@ -70,8 +70,8 @@ pipeline {
TESTRAIL_URL = 'https://ethstatus.testrail.net'
TESTRAIL_PROJECT_ID = 17
/* Runtime flag to make testing of the app easier. */
STATUS_RUNTIME_TEST_MODE = '1'
/* Runtime flag to make testing of the app easier. Switched off: unpredictable app behavior under new tests */
/* STATUS_RUNTIME_TEST_MODE = '1' */
}
stages {

View File

@ -128,7 +128,6 @@ class AUT:
else:
raise err
@allure.step('Restart application')
def restart(self):
self.stop()

View File

@ -138,8 +138,9 @@ class MainWindow(Window):
super(MainWindow, self).__init__('statusDesktop_mainWindow')
self.left_panel = LeftPanel()
# TODO: we need to handle all the issues with keycard mock var before using keycard window in tests
def prepare(self) -> 'Window':
MockedKeycardController().wait_until_appears().hide()
# MockedKeycardController().wait_until_appears().hide()
return super().prepare()
@allure.step('Sign Up user')
@ -159,7 +160,6 @@ class MainWindow(Window):
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE:
BetaConsentPopup().confirm()
MockedKeycardController().wait_until_appears().hide()
return self
@allure.step('Log in user')
@ -168,7 +168,6 @@ class MainWindow(Window):
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE:
BetaConsentPopup().confirm()
MockedKeycardController().wait_until_appears().hide()
return self
@allure.step('Authorize user')

View File

@ -59,7 +59,7 @@ class LeftPanel(QObject):
@allure.step('Get total balance value from All accounts')
def get_total_balance_value(self):
return self._all_accounts_balance.text[:-4]
return self._all_accounts_balance.text
@allure.step('Choose saved addresses on left wallet panel')
@close_exists(BasePopup())

View File

@ -17,7 +17,7 @@ from scripts.tools import image
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703084', 'Create community')
@pytest.mark.case(703084)
# @pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/167")
@pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/167")
@pytest.mark.parametrize('params', [constants.community_params])
def test_create_community(user_account, main_screen: MainWindow, params):
with step('Create community'):

View File

@ -49,7 +49,6 @@ def test_import_seed_phrase(aut: AUT, keys_screen, main_window, user_account, au
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE:
BetaConsentPopup().confirm()
MockedKeycardController().wait_until_appears().hide()
with (step('Verify that restored account reveals correct status wallet address')):
status_acc_view = (

View File

@ -69,9 +69,11 @@ def test_sync_device_during_onboarding(multiple_instance, user_data):
sync_start = sync_view.open_enter_sync_code_form()
sync_start.paste_sync_code()
sync_device_found = SyncDeviceFoundView()
assert driver.waitFor(lambda: 'Device found!' in sync_device_found.device_found_notifications)
assert driver.waitFor(
lambda: 'Device found!' in sync_device_found.device_found_notifications, 15000)
sync_result = SyncResultView().wait_until_appears()
assert driver.waitFor(lambda: 'Device synced!' in sync_result.device_synced_notifications)
assert driver.waitFor(
lambda: 'Device synced!' in sync_result.device_synced_notifications, 15000)
assert user.name in sync_device_found.device_found_notifications
with step('Sign in to synced account'):

View File

@ -56,7 +56,7 @@ def test_switch_testnet_mode(main_screen: MainWindow):
assert message == WalletNetworkSettings.TESTNET_DISABLED_TOAST_MESSAGE.value, \
f"Toast message is incorrect, current message is {message}"
if not configs.system.TEST_MODE:
TestnetModeBanner().wait_until_appears()
TestnetModeBanner().wait_until_hidden()
assert not networks.is_testnet_mode_toggle_checked(), f"Testnet toggle is on when it should not"