e2e: fix for getting public key

This commit is contained in:
Yevheniia Berdnyk 2023-12-24 01:47:16 +02:00
parent 49c6a44824
commit 5d21b1f5ae
No known key found for this signature in database
GPG Key ID: 0642C73C66214825
3 changed files with 3 additions and 20 deletions

View File

@ -285,7 +285,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
'username': self.username_1}), 'username': self.username_1}),
(self.device_2.create_user, {'username': self.username_2})))) (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.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() self.profile_1 = self.home_1.get_profile_view()
[home.navigate_back_to_home_view() for home in self.homes] [home.navigate_back_to_home_view() for home in self.homes]
[home.chats_tab.click() for home in self.homes] [home.chats_tab.click() for home in self.homes]

View File

@ -675,21 +675,6 @@ class BaseView(object):
TouchAction(self.driver).tap(None, 255, 104, 1).perform() TouchAction(self.driver).tap(None, 255, 104, 1).perform()
time.sleep(3) 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): def tap_mutual_cr_switcher(self):
profile_view = self.profile_button.click() profile_view = self.profile_button.click()
profile_view.advanced_button.scroll_and_click() profile_view.advanced_button.scroll_and_click()

View File

@ -323,9 +323,7 @@ class HomeView(BaseView):
self.mark_all_read_activity_button = Button(self.driver, translation_id="mark-all-notifications-as-read") self.mark_all_read_activity_button = Button(self.driver, translation_id="mark-all-notifications-as-read")
# Share tab # Share tab
self.link_to_profile_text = Text( self.link_to_profile_text = Text(self.driver, accessibility_id="share-qr-code-info-text")
self.driver,
xpath="(//*[@content-desc='link-to-profile']/preceding-sibling::*[1]/android.widget.TextView)[1]")
self.close_share_tab_button = Button(self.driver, accessibility_id="close-shell-share-tab") self.close_share_tab_button = Button(self.driver, accessibility_id="close-shell-share-tab")
# Discover communities # Discover communities
@ -568,7 +566,7 @@ class HomeView(BaseView):
self.link_to_profile_text.click() self.link_to_profile_text.click()
return self.driver.get_clipboard_text() 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") self.driver.info("Getting public key via Share tab")
link_to_profile = self.get_link_to_profile() link_to_profile = self.get_link_to_profile()
self.click_system_back_button() self.click_system_back_button()