From 5d21b1f5ae0022e9415165e27f8e4fa88261b735 Mon Sep 17 00:00:00 2001 From: Yevheniia Berdnyk Date: Sun, 24 Dec 2023 01:47:16 +0200 Subject: [PATCH] e2e: fix for getting public key --- .../critical/chats/test_public_chat_browsing.py | 2 +- test/appium/views/base_view.py | 15 --------------- test/appium/views/home_view.py | 6 ++---- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/test/appium/tests/critical/chats/test_public_chat_browsing.py b/test/appium/tests/critical/chats/test_public_chat_browsing.py index 1e6e8f9f7e..5cb48a2a30 100644 --- a/test/appium/tests/critical/chats/test_public_chat_browsing.py +++ b/test/appium/tests/critical/chats/test_public_chat_browsing.py @@ -285,7 +285,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase): 'username': self.username_1}), (self.device_2.create_user, {'username': self.username_2})))) self.homes = self.home_1, self.home_2 = self.device_1.get_home_view(), self.device_2.get_home_view() - self.public_key_2 = self.home_2.get_public_key_via_share_profile_tab() + self.public_key_2 = self.home_2.get_public_key() self.profile_1 = self.home_1.get_profile_view() [home.navigate_back_to_home_view() for home in self.homes] [home.chats_tab.click() for home in self.homes] diff --git a/test/appium/views/base_view.py b/test/appium/views/base_view.py index d311788c1b..5dcaa6e786 100644 --- a/test/appium/views/base_view.py +++ b/test/appium/views/base_view.py @@ -675,21 +675,6 @@ class BaseView(object): TouchAction(self.driver).tap(None, 255, 104, 1).perform() time.sleep(3) - def get_public_key(self): - self.driver.info("Get public key via Share QR button") - - self.show_qr_button.click_until_presence_of_element(self.link_to_profile_button) - self.link_to_profile_button.click() - public_key = self.driver.get_clipboard_text() - # Legacy profile view - # profile_view = self.get_profile_view() - # self.profile_button.click_until_presence_of_element(profile_view.default_username_text) - # profile_view.share_my_profile_button.click() - # profile_view.public_key_text.wait_for_visibility_of_element(20) - # public_key = profile_view.public_key_text.text - self.click_system_back_button() - return public_key - def tap_mutual_cr_switcher(self): profile_view = self.profile_button.click() profile_view.advanced_button.scroll_and_click() diff --git a/test/appium/views/home_view.py b/test/appium/views/home_view.py index 265373fdd5..ce0fd47bb8 100644 --- a/test/appium/views/home_view.py +++ b/test/appium/views/home_view.py @@ -323,9 +323,7 @@ class HomeView(BaseView): self.mark_all_read_activity_button = Button(self.driver, translation_id="mark-all-notifications-as-read") # Share tab - self.link_to_profile_text = Text( - self.driver, - xpath="(//*[@content-desc='link-to-profile']/preceding-sibling::*[1]/android.widget.TextView)[1]") + self.link_to_profile_text = Text(self.driver, accessibility_id="share-qr-code-info-text") self.close_share_tab_button = Button(self.driver, accessibility_id="close-shell-share-tab") # Discover communities @@ -568,7 +566,7 @@ class HomeView(BaseView): self.link_to_profile_text.click() return self.driver.get_clipboard_text() - def get_public_key_via_share_profile_tab(self): + def get_public_key(self): self.driver.info("Getting public key via Share tab") link_to_profile = self.get_link_to_profile() self.click_system_back_button()