chore: fix nightly failures

This commit is contained in:
Anastasiya Semenkevich 2024-09-16 18:32:49 +03:00 committed by Anastasiya
parent 7914688769
commit ffe046df29
4 changed files with 9 additions and 10 deletions

View File

@ -26,12 +26,12 @@ class InviteContactsPopup(BasePopup):
@property @property
@allure.step('Get contacts') @allure.step('Get contacts')
def contacts(self) -> typing.List[str]: def contacts(self) -> typing.List[str]:
return [str(getattr(user, 'title', '')) for user in driver.findAllObjects(self._member_item.real_name)] return [str(user.userName) for user in driver.findAllObjects(self._member_item.real_name)]
@property @property
@allure.step('Invite contacts') @allure.step('Invite contacts')
def invited_contacts(self) -> typing.List[str]: def invited_contacts(self) -> typing.List[str]:
return [str(getattr(user, 'title', '')) for user in driver.findAllObjects(self._invited_member_item.real_name)] return [str(user.userName) for user in driver.findAllObjects(self._invited_member_item.real_name)]
def invite(self, contacts: typing.List[str], message: str): def invite(self, contacts: typing.List[str], message: str):
for contact in contacts: for contact in contacts:
@ -40,9 +40,9 @@ class InviteContactsPopup(BasePopup):
selected = [] selected = []
for member in driver.findAllObjects(self._member_item.real_name): for member in driver.findAllObjects(self._member_item.real_name):
if str(getattr(member, 'title', '')) in contacts: if str(getattr(member, 'userName', '')) in contacts:
driver.mouseClick(member) driver.mouseClick(member)
selected.append(member.title) selected.append(member.userName)
assert len(contacts) == len(selected), f'Selected contacts: {selected}, expected: {contacts}' assert len(contacts) == len(selected), f'Selected contacts: {selected}, expected: {contacts}'

View File

@ -440,7 +440,7 @@ class Members(QObject):
@property @property
@allure.step('Get all members') @allure.step('Get all members')
def members(self) -> typing.List[str]: def members(self) -> typing.List[str]:
return [str(member.statusListItemTitle.text) for member in driver.findAllObjects(self._member_item.real_name)] return [str(member.userName) for member in driver.findAllObjects(self._member_item.real_name)]
@allure.step('Open banned tab') @allure.step('Open banned tab')
def click_banned_button(self): def click_banned_button(self):
@ -453,7 +453,7 @@ class Members(QObject):
@allure.step('Click member by name') @allure.step('Click member by name')
def click_member(self, member_name: str): def click_member(self, member_name: str):
for member in driver.findAllObjects(self._member_item.real_name): for member in driver.findAllObjects(self._member_item.real_name):
if getattr(member, 'title', '') == member_name: if getattr(member, 'userName', '') == member_name:
driver.mouseClick(member) driver.mouseClick(member)
break break
return ProfilePopupFromMembers().wait_until_appears() return ProfilePopupFromMembers().wait_until_appears()
@ -461,7 +461,7 @@ class Members(QObject):
@allure.step('Verify member is offline by index') @allure.step('Verify member is offline by index')
def member_state(self, member_name: str) -> bool: def member_state(self, member_name: str) -> bool:
for member in driver.findAllObjects(self._member_item.real_name): for member in driver.findAllObjects(self._member_item.real_name):
if getattr(member, 'title', '') == member_name: if getattr(member, 'userName', '') == member_name:
for child in walk_children(member): for child in walk_children(member):
if getattr(child, 'id', '') == 'statusBadge': if getattr(child, 'id', '') == 'statusBadge':
return child.color.name return child.color.name

View File

@ -274,7 +274,7 @@ class MembersView(QObject):
@property @property
@allure.step('Get community members') @allure.step('Get community members')
def members(self) -> typing.List[str]: def members(self) -> typing.List[str]:
return [str(member.title) for member in driver.findAllObjects(self._member_list_item.real_name)] return [str(member.userName) for member in driver.findAllObjects(self._member_list_item.real_name)]
@allure.step('Get community member objects') @allure.step('Get community member objects')
def get_member_objects(self) -> typing.List: def get_member_objects(self) -> typing.List:

View File

@ -12,7 +12,6 @@ from tests.wallet_main_screen import marks
import constants import constants
from gui.components.signing_phrase_popup import SigningPhrasePopup from gui.components.signing_phrase_popup import SigningPhrasePopup
from gui.components.authenticate_popup import AuthenticatePopup
from gui.main_window import MainWindow from gui.main_window import MainWindow
from scripts.utils.generators import get_wallet_address_from_mnemonic from scripts.utils.generators import get_wallet_address_from_mnemonic
@ -59,7 +58,7 @@ def test_plus_button_manage_account_from_seed_phrase(main_screen: MainWindow, us
raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}')
with step('Verify account address from UI is correct for derived account '): with step('Verify account address from UI is correct for derived account '):
address_in_ui = wallet.left_panel.copy_account_address_in_context_menu(name) address_in_ui = wallet.left_panel.copy_account_address_in_context_menu(name).split(':')[-1]
address_from_mnemonic = get_wallet_address_from_mnemonic(mnemonic_data) address_from_mnemonic = get_wallet_address_from_mnemonic(mnemonic_data)
assert address_in_ui == address_from_mnemonic, \ assert address_in_ui == address_from_mnemonic, \
f'Expected to recover {address_from_mnemonic} but got {address_in_ui}' f'Expected to recover {address_from_mnemonic} but got {address_in_ui}'