mirror of
https://github.com/status-im/status-mobile.git
synced 2025-02-04 21:05:18 +00:00
e2e: updated tests with editing profile when starting chat
This commit is contained in:
parent
daf52102ce
commit
a253f8cedb
@ -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")
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user