chore: fix join community test according changes in UI

This commit is contained in:
Valentina Novgorodtceva 2023-12-28 15:29:58 +07:00 committed by Anastasiya
parent 55ebd85637
commit e6d752ba4c
2 changed files with 9 additions and 13 deletions

View File

@ -79,7 +79,7 @@ class Message:
self.icon: typing.Optional[Image] = None
self.from_user: typing.Optional[str] = None
self.text: typing.Optional[str] = None
self._join_community_button: typing.Optional[Button] = None
self.banner_image: typing.Optional[Button] = None
self.community_invitation: dict = {}
self.init_ui()
@ -87,12 +87,10 @@ class Message:
for child in walk_children(self.object):
if getattr(child, 'objectName', '') == 'StatusDateGroupLabel':
self.date = str(child.text)
elif getattr(child, 'objectName', '') == 'communityName':
elif getattr(child, 'id', '') == 'title':
self.community_invitation['name'] = str(child.text)
elif getattr(child, 'objectName', '') == 'communityDescription':
elif getattr(child, 'id', '') == 'description':
self.community_invitation['description'] = str(child.text)
elif getattr(child, 'objectName', '') == 'communityMembers':
self.community_invitation['members'] = str(child.text)
else:
match getattr(child, 'id', ''):
case 'profileImage':
@ -103,13 +101,12 @@ class Message:
self.time = str(child.text)
case 'chatText':
self.text = str(child.text)
case 'joinBtn':
self._join_community_button = Button(name='', real_name=driver.objectMap.realName(child))
case 'bannerImage':
self.banner_image = Button(name='', real_name=driver.objectMap.realName(child))
@allure.step('Join community')
def join_community(self):
assert self._join_community_button is not None, 'Join button not found'
self._join_community_button.click()
@allure.step('Open community invitation')
def open_community_invitation(self):
self.banner_image.click()
return CommunityScreen().wait_until_appears()
@ -140,7 +137,7 @@ class ChatView(QObject):
if time.monotonic() - started_at > configs.timeouts.MESSAGING_TIMEOUT_SEC:
raise LookupError(f'Invitation not found')
return message.join_community()
return message.open_community_invitation()
class CreateChatView(QObject):

View File

@ -17,7 +17,6 @@ from gui.main_window import MainWindow
@pytest.mark.parametrize('user_data_one, user_data_two', [
(configs.testpath.TEST_USER_DATA / 'user_account_one', configs.testpath.TEST_USER_DATA / 'user_account_two')
])
@pytest.mark.skip(reason='https://github.com/status-im/desktop-qa-automation/issues/397')
def test_join_community_via_owner_invite(multiple_instance, user_data_one, user_data_two):
user_one: UserAccount = constants.user_account_one
user_two: UserAccount = constants.user_account_two