Skip to content

Commit 71f37a8

Browse files
committed
e2e: changed navigation in tests using view id tracker
1 parent 09622f4 commit 71f37a8

File tree

8 files changed

+148
-197
lines changed

8 files changed

+148
-197
lines changed

test/appium/tests/activity_center/test_activity_center.py

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ def prepare_devices(self):
2323
self.public_key_1 = self.home_1.get_public_key()
2424
self.profile_link_2 = self.home_2.get_link_to_profile()
2525
self.home_2.close_share_tab_button.click_until_absense_of_element(self.home_2.link_to_profile_button)
26-
[home.navigate_back_to_home_view() for home in self.homes]
27-
[home.chats_tab.click() for home in self.homes]
26+
[home.navigate_to_chats_view() for home in self.homes]
2827

2928
@marks.testrail_id(702850)
3029
def test_activity_center_contact_request_decline(self):
@@ -141,8 +140,7 @@ def test_activity_center_contact_request_accept_swipe_mark_all_as_read(self):
141140
"Contact was not added to contact list after accepting contact request (as receiver)")
142141

143142
self.device_2.just_fyi('Device1 check that contact appeared in contact list mutually')
144-
self.home_2.navigate_back_to_home_view()
145-
self.home_2.chats_tab.click()
143+
self.home_2.navigate_to_chats_view()
146144
self.home_2.contacts_tab.click()
147145
if not self.home_2.contact_details_row(username=self.username_1).is_element_displayed(20):
148146
self.errors.append(self.home_2,
@@ -245,10 +243,10 @@ def prepare_devices(self):
245243
self.username_1, self.username_2 = self.home_1.get_username(), self.home_2.get_username()
246244
self.profile_1, self.profile_2 = self.home_1.get_profile_view(), self.home_2.get_profile_view()
247245
self.public_key_2 = self.home_2.get_public_key()
248-
self.home_2.navigate_back_to_home_view()
249-
[home.chats_tab.click() for home in self.homes]
250246

247+
self.home_1.navigate_to_chats_view()
251248
self.home_1.add_contact(self.public_key_2)
249+
self.home_2.navigate_to_chats_view()
252250
self.home_2.handle_contact_request(self.username_1)
253251
self.text_message = 'hello'
254252

@@ -291,14 +289,12 @@ def test_navigation_jump_to(self):
291289
@marks.testrail_id(702947)
292290
def test_activity_center_reply_read_unread_delete_filter_swipe(self):
293291
message_to_reply, reply_to_message_from_sender = 'something to reply to', 'this is a reply'
294-
self.home_1.navigate_back_to_home_view()
295-
self.home_1.communities_tab.click()
292+
self.home_1.navigate_to_communities_view()
296293
self.home_1.get_chat(self.community_name, community=True).click()
297294
self.community_1.get_channel(self.channel_name).click()
298295
self.channel_1.send_message(message_to_reply)
299296

300-
self.home_1.navigate_back_to_home_view()
301-
self.home_1.communities_tab.click()
297+
self.home_1.navigate_to_communities_view()
302298
self.channel_2.chat_element_by_text(message_to_reply).wait_for_visibility_of_element(120)
303299
self.channel_2.quote_message(message_to_reply)
304300
self.channel_2.send_message(reply_to_message_from_sender)
@@ -356,8 +352,7 @@ def test_activity_center_reply_read_unread_delete_filter_swipe(self):
356352
reply_element.click()
357353
if not self.channel_1.chat_element_by_text(reply_to_message_from_sender).is_element_displayed():
358354
self.errors.append(self.home_1, "Was not redirected to chat after tapping on reply!")
359-
self.home_1.navigate_back_to_home_view()
360-
self.home_1.communities_tab.click()
355+
self.home_1.navigate_to_communities_view()
361356
if self.home_1.notifications_unread_badge.is_element_displayed():
362357
self.errors.append(self.home_1,
363358
"Notification was not marked as read after opening it in community channel!")
@@ -388,10 +383,10 @@ def prepare_devices(self):
388383
self.username_1, self.username_2 = self.home_1.get_username(), self.home_2.get_username()
389384
self.profile_1, self.profile_2 = self.home_1.get_profile_view(), self.home_2.get_profile_view()
390385
self.public_key_2 = self.home_2.get_public_key()
391-
self.home_2.navigate_back_to_home_view()
392-
[home.chats_tab.click() for home in self.homes]
393386

387+
self.home_1.navigate_to_chats_view()
394388
self.home_1.add_contact(self.public_key_2)
389+
self.home_2.navigate_to_chats_view()
395390
self.home_2.handle_contact_request(self.username_1)
396391
self.text_message = 'hello'
397392

@@ -414,8 +409,7 @@ def prepare_devices(self):
414409

415410
@marks.testrail_id(702957)
416411
def test_activity_center_mentions(self):
417-
self.home_1.navigate_back_to_home_view()
418-
self.home_1.communities_tab.click()
412+
self.home_1.navigate_to_communities_view()
419413

420414
self.device_2.just_fyi("Invited member sends a message with a mention")
421415
self.channel_2.mention_user(self.username_1)
@@ -451,8 +445,7 @@ def test_activity_center_mentions(self):
451445
@marks.testrail_id(702958)
452446
def test_activity_center_admin_notification_accept_swipe(self):
453447
self.home_2.just_fyi("Clearing history")
454-
self.home_2.navigate_back_to_home_view()
455-
self.home_2.chats_tab.click()
448+
self.home_2.navigate_to_chats_view()
456449
self.home_2.clear_chat_long_press(self.username_1)
457450

458451
[home.navigate_back_to_home_view() for home in (self.home_1, self.home_2)]
@@ -466,13 +459,11 @@ def test_activity_center_admin_notification_accept_swipe(self):
466459
self.community_1.invite_to_community(community_name, self.username_2)
467460

468461
self.home_2.just_fyi("Request access to community")
469-
self.home_2.navigate_back_to_home_view()
470-
self.home_2.chats_tab.click()
462+
self.home_2.navigate_to_chats_view()
471463
self.chat_2 = self.home_2.get_chat(self.username_1).click()
472464
self.community_2.join_community(open_community=False)
473465
for home in self.home_1, self.home_2:
474-
home.navigate_back_to_home_view()
475-
home.communities_tab.click()
466+
home.navigate_to_communities_view()
476467

477468
self.home_1.just_fyi("Checking unread indicators")
478469
try:

0 commit comments

Comments
 (0)