chore: raise lookup error if contacts list is empty and don't waste 30 minutes

This commit is contained in:
Anastasiya Semiankevich 2024-04-30 15:49:18 +03:00 committed by Anastasiya
parent 1588c02f1b
commit d06cfd342a
3 changed files with 13 additions and 5 deletions

View File

@ -26,7 +26,7 @@ class MessagingSettingsView(QObject):
@allure.step('Open contacts settings') @allure.step('Open contacts settings')
def open_contacts_settings(self) -> 'ContactsSettingsView': def open_contacts_settings(self) -> 'ContactsSettingsView':
self._contacts_button.click() self._contacts_button.click()
return ContactsSettingsView().wait_until_appears() return ContactsSettingsView()
class ContactItem: class ContactItem:
@ -106,7 +106,14 @@ class ContactsSettingsView(QObject):
@property @property
@allure.step('Get contact items') @allure.step('Get contact items')
def contact_items(self) -> typing.List[ContactItem]: def contact_items(self) -> typing.List[ContactItem]:
return [ContactItem(item) for item in self._contacts_items_list.items] try:
contact_items = []
for i in range(2):
contact_items = [ContactItem(item) for item in self._contacts_items_list.items]
if len(contact_items) != 0:
return contact_items
except LookupError as err:
raise err
@property @property
@allure.step('Get title of list with sent pending requests') @allure.step('Get title of list with sent pending requests')
@ -181,7 +188,7 @@ class ContactsSettingsView(QObject):
@allure.step('Open verify identity popup') @allure.step('Open verify identity popup')
def open_more_options_popup( def open_more_options_popup(
self, contact: str, timeout_sec: int = configs.timeouts.MESSAGING_TIMEOUT_SEC, attempts: int = 2): self, contact: str, timeout_sec: int = configs.timeouts.MESSAGING_TIMEOUT_SEC):
request = self.find_contact_in_list(contact, timeout_sec) request = self.find_contact_in_list(contact, timeout_sec)
request.open_more_options_popup() request.open_more_options_popup()
return self return self

View File

@ -63,8 +63,7 @@ def test_create_community(user_account, main_screen: MainWindow, params):
community_screen.verify_channel( community_screen.verify_channel(
'general', 'general',
'General channel for the community', 'General channel for the community',
None, None
color
) )
with step('Verify community parameters in community settings view'): with step('Verify community parameters in community settings view'):

View File

@ -8,6 +8,8 @@ from gui.components.back_up_your_seed_phrase_banner import BackUpSeedPhraseBanne
from gui.main_window import MainWindow from gui.main_window import MainWindow
pytestmark = marks pytestmark = marks
@pytest.mark.critical @pytest.mark.critical
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703001', 'Backup seed phrase') @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703001', 'Backup seed phrase')
@pytest.mark.case(703001) @pytest.mark.case(703001)