Skip to content

Commit 2e88ba9

Browse files
committed
e2e: fixes for unpin messages and community logo
1 parent f27c569 commit 2e88ba9

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

test/appium/tests/deep_links/test_deep_and_universal_links.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ def test_links_deep_links_profile(self):
7878
def test_deep_links_communities(self):
7979
closed_community_name, snt_community_name = "closed community", "SNT community"
8080
self.sign_in.reopen_app(sign_in=True, user_name=self.username)
81-
self.home.navigate_to_communities_view()
81+
if self.home.communities_tab.is_element_displayed():
82+
self.home.communities_tab.click()
83+
else:
84+
self.home.navigate_to_communities_view()
8285
self.home.create_community(community_type="closed")
8386
if not self.community_view.community_options_button.is_element_displayed():
8487
self.home.get_chat(closed_community_name, community=True).click()

test/appium/tests/private_chats/test_group_chat.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,6 @@ def _check_messages(index):
357357
self.errors.verify_no_errors()
358358

359359
@marks.testrail_id(702732)
360-
@marks.xfail(
361-
reason="Can not unpin messages from pinned messages menu - https://github.com/status-im/status-mobile/issues/22497")
362360
def test_group_chat_pin_messages(self):
363361
[self.homes[i].navigate_back_to_home_view() for i in range(3)]
364362
[self.homes[i].get_chat(self.chat_name).click() for i in range(3)]
@@ -410,8 +408,8 @@ def test_group_chat_pin_messages(self):
410408
self.chats[0].view_pinned_messages_button.click_until_presence_of_element(self.chats[0].pinned_messages_list)
411409
if self.chats[0].pinned_messages_list.message_element_by_text(self.message_4).is_element_displayed():
412410
self.errors.append(self.chats[0], "Can pin more than 3 messages")
413-
self.chats[0].tap_by_coordinates(500, 100)
414-
self.chats[0].pin_message(self.message_2, action='unpin-from-chat')
411+
self.chats[0].pinned_messages_list.message_element_by_text(self.message_2).long_press_without_release()
412+
self.chats[0].element_by_translation_id('unpin-from-chat').click()
415413
self.chats[0].pin_message(self.message_4, 'pin-to-chat')
416414
for chat in self.chats[0], self.chats[1]:
417415
if not chat.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30):

test/appium/tests/private_chats/test_one_to_one_chat.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,8 @@ def test_1_1_chat_emoji_send_reply_and_open_link(self):
186186

187187
self.errors.verify_no_errors()
188188

189-
# @marks.smoke # ToDo: return to the smoke suite when https://github.com/status-im/status-mobile/issues/22497 is fixed
189+
@marks.smoke
190190
@marks.testrail_id(702731)
191-
@marks.xfail(
192-
reason="Can not unpin messages from pinned messages menu - https://github.com/status-im/status-mobile/issues/22497")
193191
def test_1_1_chat_pin_messages(self):
194192
self.home_1.just_fyi("Check that Device1 can pin own message in 1-1 chat")
195193
self.chat_2.navigate_to_chats_view()
@@ -243,10 +241,9 @@ def test_1_1_chat_pin_messages(self):
243241
or self.chat_1.pinned_messages_list.message_element_by_text(self.message_4).is_element_displayed():
244242
self.errors.append(self.chat_1, "Can pin more than 3 messages in chat")
245243
else:
246-
unpin_element = self.chat_1.element_by_translation_id('unpin-from-chat')
247244
self.chat_1.pinned_messages_list.message_element_by_text(self.message_2).long_press_without_release()
248245
self.home_1.just_fyi("Unpin one message so that another could be pinned")
249-
unpin_element.click_until_absense_of_element(desired_element=unpin_element)
246+
self.chat_1.element_by_translation_id('unpin-from-chat').click()
250247
self.chat_1.pin_message(self.message_4, 'pin-to-chat')
251248
for chat in self.chat_1, self.chat_2:
252249
if not chat.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30):
@@ -263,9 +260,8 @@ def test_1_1_chat_pin_messages(self):
263260
self.chat_1.tap_by_coordinates(500, 100)
264261
self.chat_1.view_pinned_messages_button.click_until_presence_of_element(self.chat_1.pinned_messages_list)
265262
pinned_message = self.chat_1.pinned_messages_list.message_element_by_text(self.message_4)
266-
unpin_element = self.chat_1.element_by_translation_id("unpin-from-chat")
267263
pinned_message.long_press_without_release()
268-
unpin_element.click_until_absense_of_element(unpin_element)
264+
self.chat_1.element_by_translation_id("unpin-from-chat").click()
269265
try:
270266
self.chat_2.chat_element_by_text(self.message_4).pinned_by_label.wait_for_invisibility_of_element(60)
271267
except TimeoutException:

test/appium/views/chat_view.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,8 @@ def __init__(self, driver):
325325
self.close_community_view_button = Button(self.driver, accessibility_id="back-button")
326326
self.community_title = Text(self.driver, accessibility_id="community-title")
327327
self.community_logo = BaseElement(
328-
self.driver, xpath="//*[@content-desc='community-title']/preceding-sibling::*/android.widget.ImageView")
328+
self.driver,
329+
xpath="//*[*[*[@content-desc='community-title']]]/following-sibling::*/android.widget.ImageView")
329330
self.community_description_text = Text(self.driver, accessibility_id="community-description-text")
330331
self.community_status_joined = Text(self.driver, accessibility_id="status-tag-positive")
331332
self.community_status_pending = Text(self.driver, accessibility_id="status-tag-pending")
31.2 KB
Loading

0 commit comments

Comments
 (0)