chore: update tests

This commit is contained in:
Anastasiya 2024-10-09 18:39:50 +03:00 committed by Anastasiya
parent bf666c20f5
commit f536c3447f
15 changed files with 19 additions and 34 deletions

View File

@ -1,4 +1,5 @@
import logging
import os
from os import path
from scripts.utils.system_path import SystemPath

View File

@ -111,4 +111,4 @@ class BackUpYourSeedPhrasePopUp(BasePopup):
self.confirm_second_word(seed_phrases)
self.continue_seed_phrase()
self.set_acknowledge(True)
self.complete_and_delete_seed_phrase().wait_until_hidden()
self.complete_and_delete_seed_phrase()

View File

@ -13,4 +13,3 @@ class BasePopup(QObject):
@allure.step('Close')
def close(self):
driver.type(self.object, '<Escape>')
self.wait_until_hidden()

View File

@ -1,7 +1,7 @@
import allure
import configs
import driver.objects_access
import driver
from gui.components.base_popup import BasePopup
from gui.elements.button import Button
from gui.elements.check_box import CheckBox
@ -28,13 +28,15 @@ class CategoryPopup(BasePopup):
self._name_text_edit.text = title
return self
@allure.step('Click checkbox in category popup')
@allure.step('Click checkbox in edit category popup')
def click_checkbox_by_index(self, index: int):
checkboxes = []
for child in driver.objects_access.walk_children(self._channels_view.object):
if child.id == 'channelItemCheckbox':
checkboxes.append(child)
driver.mouseClick(checkboxes[index])
checkboxes = driver.findAllObjects(self._channel_item_checkbox.real_name)
if len(checkboxes) > 0:
for _index, item in enumerate(checkboxes):
if index == _index:
driver.mouseClick(item)
else:
raise AssertionError('Empty list of channels')
return self
@ -50,7 +52,6 @@ class NewCategoryPopup(CategoryPopup):
if checkbox_state:
self._channel_item_checkbox.click()
self._create_button.click()
self.wait_until_hidden()
class EditCategoryPopup(CategoryPopup):
@ -63,4 +64,3 @@ class EditCategoryPopup(CategoryPopup):
@allure.step('Click save in edit category popup')
def save(self):
self._save_button.click()
self.wait_until_hidden()

View File

@ -238,5 +238,4 @@ class CreateCommunityPopup(BasePopup):
self.set_intro(intro)
self.set_outro(outro)
self._create_community_button.click()
self.wait_until_hidden()
return CommunityScreen().wait_until_appears()

View File

@ -20,4 +20,3 @@ class EditGroupNameAndImagePopup(BasePopup):
@allure.step('Save changes')
def save_changes(self):
self._save_changes_button.click()
self.wait_until_hidden()

View File

@ -14,5 +14,4 @@ class LeaveGroupPopup(BasePopup):
@allure.step("Confirm leaving group")
def confirm_leaving(self):
self._leave_button.click()
self.wait_until_hidden()

View File

@ -20,7 +20,6 @@ class SendContactRequest(BasePopup):
self._chat_key_text_edit.text = chat_key
self._message_text_edit.text = message
self._send_button.click()
self.wait_until_hidden()
class SendContactRequestFromProfile(BasePopup):

View File

@ -37,7 +37,6 @@ class SyncNewDevicePopup(BasePopup):
@allure.step('Click done')
def done(self):
self._done_button.click()
self.wait_until_hidden()
@allure.step('Click close')
def close(self):

View File

@ -90,7 +90,6 @@ class AddressPopup(AddSavedAddressPopup):
self.verify_otimism_mainnet_network_tag_present()
self.verify_arbitrum_mainnet_network_tag_present(),
self._save_add_address_button.click()
self.wait_until_hidden()
class EditSavedAddressPopup(AddSavedAddressPopup):

View File

@ -115,18 +115,20 @@ class QObject:
button or driver.Qt.LeftButton
)
LOG.info('%s: is clicked with Qt.LeftButton', self)
LOG.info("Checking if application context is frozen")
# LOG.info("Checking if application context is frozen")
if timeout is None:
pass
if timeout is not None:
if not isFrozen(timeout):
pass
pass
# TODO: enable after fixing https://github.com/status-im/status-desktop/issues/15345
# if not isFrozen(timeout):
# pass
else:
LOG.info("Application context did not respond after click")
raise Exception(f'Application UI is not responding within {timeout} second(s)')
# else:
# LOG.info("Application context did not respond after click")
# raise Exception(f'Application UI is not responding within {timeout} second(s)')
@allure.step('Native click {0}')
def native_mouse_click(

View File

@ -12,7 +12,6 @@ from gui.components.community.invite_contacts import InviteContactsPopup
from gui.components.context_menu import ContextMenu
from gui.components.onboarding.before_started_popup import BeforeStartedPopUp
from gui.components.onboarding.beta_consent_popup import BetaConsentPopup
from gui.components.onboarding.share_usage_data_popup import ShareUsageDataPopup
from gui.components.splash_screen import SplashScreen
from gui.components.toast_message import ToastMessage
from gui.components.online_identifier import OnlineIdentifier
@ -176,7 +175,6 @@ class MainWindow(Window):
@allure.step('Sign Up user')
def sign_up(self, user_account: UserAccount = RandomUser()):
share_updates_popup = ShareUsageDataPopup()
BeforeStartedPopUp().get_started()
welcome_screen = WelcomeToStatusView().wait_until_appears()
profile_view = welcome_screen.get_keys().generate_new_keys()
@ -193,19 +191,14 @@ class MainWindow(Window):
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()
if share_updates_popup.exists:
share_updates_popup.skip()
return self
@allure.step('Log in user')
def log_in(self, user_account: UserAccount):
share_updates_popup = ShareUsageDataPopup()
LoginView().log_in(user_account)
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()
if share_updates_popup.exists:
share_updates_popup.skip()
return self
@allure.step('Authorize user')

View File

@ -40,7 +40,6 @@ def test_add_generated_account_restart_add_again(
account_popup = wallet.left_panel.open_add_account_popup()
account_popup.set_name(name).set_emoji(emoji).set_color(color).save_changes()
authenticate_with_password(user_account)
account_popup.wait_until_hidden()
with step('Verify toast message notification when adding account'):
assert len(main_screen.wait_for_notification()) == 1, \
@ -67,7 +66,6 @@ def test_add_generated_account_restart_add_again(
account_popup = wallet.left_panel.open_add_account_popup()
account_popup.set_name(name2).set_emoji(emoji2).set_color(color2).save_changes()
authenticate_with_password(user_account)
account_popup.wait_until_hidden()
with step('Verify toast message notification when adding account'):
assert len(main_screen.wait_for_notification()) == 1, \

View File

@ -38,7 +38,6 @@ def test_delete_generated_account_from_wallet_settings(
with step('Add a new generated account from wallet settings screen'):
add_account_popup.set_name(account_name).set_emoji(emoji).set_color(color).save_changes()
authenticate_with_password(user_account)
add_account_popup.wait_until_hidden()
with step('Open account details view for the generated account'):
account_index = 1

View File

@ -37,7 +37,6 @@ def test_add_edit_delete_generated_account(main_screen: MainWindow, user_account
account_popup = wallet.left_panel.open_add_account_popup()
account_popup.set_name(name).set_emoji(emoji).set_color(color).save_changes()
authenticate_with_password(user_account)
account_popup.wait_until_hidden()
with step('Verify toast message notification when adding account'):
assert len(main_screen.wait_for_notification()) == 1, \