Skip to content

Commit

Permalink
e2e: updated with new accessibility ids
Browse files Browse the repository at this point in the history
  • Loading branch information
yevh-berdnyk authored and mohsen-ghafouri committed Mar 15, 2024
1 parent 068cc16 commit 70e65fe
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
6 changes: 3 additions & 3 deletions test/appium/tests/activity_center/test_activity_center.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_activity_center_contact_request_decline(self):
chat.profile_send_contact_request_button.click()
chat.contact_request_message_input.send_keys("hi")
chat.confirm_send_contact_request_button.click()
chat.confirm_send_contact_request_button.click()
chat.close_button.click()
self.home_2.navigate_back_to_home_view()

self.device_1.just_fyi("Device 1: check there is no PN when receiving new message to activity centre")
Expand Down Expand Up @@ -112,7 +112,7 @@ def test_activity_center_contact_request_accept_swipe_mark_all_as_read(self):
chat.profile_send_contact_request_button.click()
chat.contact_request_message_input.send_keys("hi")
chat.confirm_send_contact_request_button.click()
chat.close_profile_button.click()
chat.close_button.click()

self.device_1.just_fyi('Device1 accepts pending contact request by swiping')
self.home_1.chats_tab.click()
Expand Down Expand Up @@ -195,7 +195,7 @@ def _device_2_sign_in():
chat_1.profile_send_contact_request_button.click()
chat_1.contact_request_message_input.send_keys("hi")
chat_1.confirm_send_contact_request_button.click()
chat_1.close_profile_button.click()
chat_1.close_button.click()

self.home_2.just_fyi("Device 2 accepts contact request")
self.home_2.handle_contact_request(new_username_1)
Expand Down
6 changes: 4 additions & 2 deletions test/appium/tests/critical/test_deep_and_universal_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def test_links_open_universal_links_from_chat(self):
self.channel.send_message(url)
self.channel.chat_element_by_text(url).click_on_link_inside_message_body()
if self.channel.profile_send_contact_request_button.is_element_displayed(10):
username_text = self.profile_view.default_username_text.text
# username_text = self.profile_view.default_username_text.text
username_text = self.profile_view.contact_name_text.text
if not (username_text.endswith(url[-6:]) or username_text == text):
self.errors.append("Incorrect username is shown for profile url %s" % url)
else:
Expand Down Expand Up @@ -81,7 +82,8 @@ def test_links_deep_links(self):
for link, text in profile_links.items():
self.channel.just_fyi("Opening profile link %s" % link)
self.browser_view.open_url(link)
shown_name_text = self.profile_view.default_username_text.text
# shown_name_text = self.profile_view.default_username_text.text
shown_name_text = self.profile_view.contact_name_text.text
if text:
name_is_shown = shown_name_text == text or shown_name_text.endswith(link[-6:])
else:
Expand Down
12 changes: 4 additions & 8 deletions test/appium/views/chat_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,19 +850,15 @@ def __init__(self, driver):
# Contact's profile
self.contact_profile_picture = ProfilePictureElement(self.driver)
self.profile_send_message_button = ProfileSendMessageButton(self.driver)
self.close_profile_button = Button(self.driver,
xpath="(//android.widget.ImageView[@content-desc='icon'])[last()-1]")
self.profile_options_button = Button(self.driver,
xpath="(//android.widget.ImageView[@content-desc='icon'])[last()]")
self.profile_options_button = Button(self.driver, accessibility_id="contact-actions")
self.profile_block_contact_button = Button(self.driver, accessibility_id="block-user")
self.confirm_block_contact_button = Button(self.driver,
xpath="//*[@content-desc='button-one']//*[@text='Block']")
self.confirm_block_contact_button = Button(self.driver, accessibility_id="block-contact")
self.unblock_contact_button = Button(self.driver, accessibility_id="icon, Unblock")
self.profile_mute_contact = Button(self.driver, accessibility_id="Mute-item-button")
self.profile_unmute_contact = Button(self.driver, accessibility_id="Unmute-item-button")
self.profile_send_contact_request_button = Button(self.driver, accessibility_id="icon, Send contact request")
self.contact_request_message_input = EditBox(self.driver, accessibility_id="input")
self.confirm_send_contact_request_button = EditBox(self.driver, accessibility_id="button-one")
self.contact_request_message_input = EditBox(self.driver, accessibility_id="contact-request-message")
self.confirm_send_contact_request_button = EditBox(self.driver, accessibility_id="send-contact-request")
self.profile_add_to_contacts_button = Button(self.driver, accessibility_id="Add to contacts-item-button")
self.profile_remove_from_contacts = Button(self.driver, accessibility_id="Remove from contacts-item-button")
self.profile_details = Button(self.driver, accessibility_id="share-button")
Expand Down
3 changes: 1 addition & 2 deletions test/appium/views/home_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,7 @@ def add_contact(self, public_key, nickname='', remove_from_contacts=False):
chat.confirm_send_contact_request_button.click()
if nickname:
chat.set_nickname(nickname)
chat.close_profile_button.click()
self.navigate_back_to_home_view()
chat.close_button.click()

def create_group_chat(self, user_names_to_add: list, group_chat_name: str = 'new_group_chat'):
self.driver.info("## Creating group chat '%s'" % group_chat_name, device=False)
Expand Down
1 change: 1 addition & 0 deletions test/appium/views/profile_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def __init__(self, driver):
# Header
self.public_key_text = Text(self.driver, accessibility_id="chat-key")
self.default_username_text = Text(self.driver, accessibility_id="default-username")
self.contact_name_text = Text(self.driver, accessibility_id="contact-name")
self.share_my_profile_button = Button(self.driver, accessibility_id="share-header-button")
self.profile_picture = ProfilePictureElement(self.driver)
self.online_indicator = Button(self.driver, accessibility_id="online-profile-photo-dot")
Expand Down

0 comments on commit 70e65fe

Please sign in to comment.