From 6cb48834ae8ebb6796f16d7725c7d3498b1ee408 Mon Sep 17 00:00:00 2001 From: diana Date: Thu, 17 Feb 2022 13:12:31 +0100 Subject: [PATCH] e2e: automate backup of contacts --- .../atomic/account_management/test_profile.py | 33 +++++++++++++++++++ test/appium/views/profile_view.py | 5 +++ 2 files changed, 38 insertions(+) diff --git a/test/appium/tests/atomic/account_management/test_profile.py b/test/appium/tests/atomic/account_management/test_profile.py index ecab23b8d0..afe669840d 100644 --- a/test/appium/tests/atomic/account_management/test_profile.py +++ b/test/appium/tests/atomic/account_management/test_profile.py @@ -268,6 +268,39 @@ class TestProfileSingleDevice(SingleDeviceTestCase): self.errors.verify_no_errors() + @marks.testrail_id(700702) + @marks.medium + def test_backup_of_contacts(self): + sign_in = SignInView(self.driver) + home = sign_in.create_user() + + home.just_fyi('Add user to contacts') + home.add_contact(basic_user['public_key']) + + home.just_fyi('Back up contacts') + profile = home.profile_button.click() + profile.sync_settings_button.click() + profile.backup_settings_button.click() + profile.perform_backup_button.click() + + profile.just_fyi('Back up seed phrase') + profile.back_button.click(2) + profile.privacy_and_security_button.click() + profile.backup_recovery_phrase_button.click() + profile.ok_continue_button.click() + recovery_phrase = profile.get_recovery_phrase() + self.driver.reset() + + profile.just_fyi('Recover account from seed phrase') + sign_in.recover_access(' '.join(recovery_phrase.values())) + + sign_in.just_fyi('Check backed up contact') + profile.profile_button.click() + profile.contacts_button.click() + profile.element_by_text(basic_user["username"]) + if not profile.element_by_text(basic_user['username']).is_element_displayed(): + self.driver.fail("Contact was not backed up!") + @marks.testrail_id(5431) @marks.medium def test_add_custom_network(self): diff --git a/test/appium/views/profile_view.py b/test/appium/views/profile_view.py index 8a52494be7..b7eb57cf1c 100644 --- a/test/appium/views/profile_view.py +++ b/test/appium/views/profile_view.py @@ -253,6 +253,11 @@ class ProfileView(BaseView): suffix="/following-sibling::android.widget.Switch[1]") self.ask_me_when_on_mobile_network = Button(self.driver, translation_id="mobile-network-ask-me", suffix="/following-sibling::android.widget.Switch[1]") + ## Backup settings + self.backup_settings_button = Button(self.driver, accessibility_id="backup-settings-button") + ## Perform backup + self.perform_backup_button = Button(self.driver, translation_id="perform-backup") + ## Sync history data self.sync_history_for_button = Button(self.driver, accessibility_id="default-sync-period-button") ## History nodes