diff --git a/test/appium/tests/critical/chats/test_1_1_public_chats.py b/test/appium/tests/critical/chats/test_1_1_public_chats.py index 2a4ff6bcf3..5decb4c06a 100644 --- a/test/appium/tests/critical/chats/test_1_1_public_chats.py +++ b/test/appium/tests/critical/chats/test_1_1_public_chats.py @@ -32,7 +32,8 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase): for home in (self.home_1, self.home_2): home.navigate_back_to_home_view() home.chats_tab.click() - self.home_1.add_contact(self.public_key_2) + self.username_1 = "user_1" + self.home_1.add_contact(public_key=self.public_key_2, username=self.username_1) self.home_2.just_fyi("Accepting contact request from activity centre") self.home_2.handle_contact_request(self.username_1) @@ -243,7 +244,7 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase): unpin_element.click_until_absense_of_element(desired_element=unpin_element) self.chat_1.pin_message(self.message_4, 'pin-to-chat') for chat in self.chat_1, self.chat_2: - if chat.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30): + if not chat.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30): self.errors.append(chat, "Message 4 is not pinned in chat after unpinning previous one") self.home_1.just_fyi("Check pinned messages are visible in Pinned panel for both users") diff --git a/test/appium/views/home_view.py b/test/appium/views/home_view.py index 2c8d2f146a..717733b975 100644 --- a/test/appium/views/home_view.py +++ b/test/appium/views/home_view.py @@ -247,7 +247,9 @@ class HomeView(BaseView): def __init__(self, driver): super().__init__(driver) - self.plus_button = Button(self.driver, accessibility_id="new-chat-button") + self.skip_editing_profile_button = Button(self.driver, xpath="//*[@content-desc='button-two']//*[@text='Skip']") + self.edit_profile_button = Button(self.driver, xpath="//*[@content-desc='button-one']//*[@text='Edit Profile']") + self.submit_create_profile_button = Button(self.driver, accessibility_id="submit-create-profile-button") self.plus_community_button = Button(self.driver, accessibility_id="new-communities-button") self.chat_name_text = Text(self.driver, accessibility_id="chat-name-text") self.start_new_chat_button = ChatButton(self.driver, accessibility_id="start-1-1-chat-button") @@ -400,9 +402,15 @@ class HomeView(BaseView): self.close_activity_centre.wait_for_rendering_ended_and_click() self.chats_tab.wait_for_visibility_of_element() - def add_contact(self, public_key, nickname=''): + def add_contact(self, public_key, username='', nickname=''): self.driver.info("Adding user to Contacts via chats > add new contact") - self.new_chat_button.click_until_presence_of_element(self.add_a_contact_chat_bottom_sheet_button) + self.new_chat_button.click() + if username: + self.edit_profile_button.click() + self.get_sign_in_view().profile_title_input.send_keys(username) + self.submit_create_profile_button.click() + else: + self.skip_editing_profile_button.click_if_shown() self.add_a_contact_chat_bottom_sheet_button.click() chat = self.get_chat_view()