From 40b1a9b8aeba69caad95bb93d4fe18a35b751d28 Mon Sep 17 00:00:00 2001 From: Churikova Tetiana Date: Tue, 20 Jul 2021 17:23:13 +0200 Subject: [PATCH] e2e: frozen kk 1 part Signed-off-by: Churikova Tetiana --- .../atomic/account_management/test_keycard.py | 67 +++++++++++++++++++ test/appium/views/keycard_view.py | 8 ++- test/appium/views/sign_in_view.py | 1 + 3 files changed, 74 insertions(+), 2 deletions(-) diff --git a/test/appium/tests/atomic/account_management/test_keycard.py b/test/appium/tests/atomic/account_management/test_keycard.py index 004cb7593d..1f4a6b2a46 100644 --- a/test/appium/tests/atomic/account_management/test_keycard.py +++ b/test/appium/tests/atomic/account_management/test_keycard.py @@ -8,6 +8,8 @@ class TestCreateAccount(SingleDeviceTestCase): @marks.testrail_id(6645) @marks.critical + @marks.skip + # TODO: blocked due to 12322 def test_restore_account_migrate_multiaccount_to_keycard(self): sign_in = SignInView(self.driver) seed = basic_user['passphrase'] @@ -31,6 +33,7 @@ class TestCreateAccount(SingleDeviceTestCase): if sign_in.seedphrase_input.is_element_displayed(): self.driver.fail("Proceeded to seedphrase input without confirmed Actions") sign_in.move_keystore_file_option.click() + sign_in.reset_database_checkbox.click() sign_in.enter_seed_phrase_next_button.click() sign_in.seedphrase_input.set_value(transaction_senders['A']['passphrase']) sign_in.choose_storage_button.click() @@ -448,6 +451,70 @@ class TestCreateAccount(SingleDeviceTestCase): self.driver.fail("Popup about successful setting new pairing is not shown!") keycard.ok_button.click() + self.errors.verify_no_errors() + + @marks.testrail_id(695851) + @marks.medium + def test_keycard_frozen_card_flows(self): + # TODO: should be renewed after fix 12324 + sign_in = SignInView(self.driver) + seed = basic_user['passphrase'] + home = sign_in.recover_access(passphrase=seed, keycard=True) + profile = home.profile_button.click() + profile.keycard_button.scroll_and_click() + + home.just_fyi('Set new PUK') + keycard = profile.change_puk_button.click() + keycard.enter_default_pin() + [keycard.enter_default_puk() for _ in range (2)] + keycard.ok_button.click() + + home.just_fyi("Checking reset with PUK when logged in") + keycard = profile.change_pin_button.click() + keycard.enter_another_pin() + keycard.wait_for_element_starts_with_text('2 attempts left', 30) + keycard.enter_another_pin() + keycard.element_by_text_part('one attempt').wait_for_element(30) + keycard.enter_another_pin() + if not home.element_by_translation_id("keycard-is-frozen-title").is_element_displayed(): + self.driver.fail("No popup about frozen keycard is shown!") + + # home.element_by_translation_id("keycard-is-frozen-factory-reset").click() + # sign_in.seedphrase_input.set_value(transaction_senders['A']['passphrase']) + # sign_in.next_button.click() + # if not home.element_by_translation_id("seed-key-uid-mismatch").is_element_displayed(): + # self.driver.fail("No popup about mismatch in seed phrase is shown!") + # home.element_by_translation_id("try-again").click() + # sign_in.seedphrase_input.clear() + home.element_by_translation_id("keycard-is-frozen-reset").click() + keycard.enter_another_pin() + home.element_by_text_part('2/2').wait_for_element(20) + keycard.enter_another_pin() + home.element_by_translation_id("enter-puk-code").click() + keycard.enter_default_puk() + home.element_by_translation_id("keycard-access-reset").wait_for_element(20) + home.profile_button.double_click() + profile.logout() + + + home.just_fyi("Checking reset with PUK when logged out") + keycard.enter_another_pin() + keycard.wait_for_element_starts_with_text('2 attempts left', 30) + keycard.enter_another_pin() + keycard.element_by_text_part('one attempt').wait_for_element(30) + keycard.enter_another_pin() + if not home.element_by_translation_id("keycard-is-frozen-title").is_element_displayed(): + self.driver.fail("No popup about frozen keycard is shown!") + home.element_by_translation_id("keycard-is-frozen-reset").click() + keycard.enter_another_pin() + home.element_by_text_part('2/2').wait_for_element(20) + keycard.enter_another_pin() + home.element_by_translation_id("enter-puk-code").click() + keycard.enter_default_puk() + home.element_by_translation_id("keycard-access-reset").wait_for_element(20) + home.element_by_translation_id("open").click() + + self.errors.verify_no_errors() class TestKeycardCreateMultiaccountMultipleDevice(MultipleDeviceTestCase): diff --git a/test/appium/views/keycard_view.py b/test/appium/views/keycard_view.py index d1a48c261a..7d0b0d51bb 100644 --- a/test/appium/views/keycard_view.py +++ b/test/appium/views/keycard_view.py @@ -16,6 +16,7 @@ class KeycardView(BaseView): self.connect_pairing_card_button = Button(self.driver, accessibility_id="connect-pairing-card") # Keyboard + self.zero_button = SilentButton(self.driver, accessibility_id="numpad-button-0") self.one_button = SilentButton(self.driver, accessibility_id="numpad-button-1") self.two_button = SilentButton(self.driver, accessibility_id="numpad-button-2") @@ -24,8 +25,11 @@ class KeycardView(BaseView): def enter_default_pin(self): self.driver.info("**Enter default pin 111111**") - for _ in range(6): - self.one_button.click() + [self.one_button.click() for _ in range(6)] + + def enter_default_puk(self): + self.driver.info("**Enter default pin 1111 1111 1111**") + [self.one_button.click() for _ in range(12)] def enter_another_pin(self): self.driver.info("**Enter not-default pin 222222**") diff --git a/test/appium/views/sign_in_view.py b/test/appium/views/sign_in_view.py index 5f5578f559..ada3137d10 100644 --- a/test/appium/views/sign_in_view.py +++ b/test/appium/views/sign_in_view.py @@ -159,6 +159,7 @@ class SignInView(BaseView): self.manage_keys_and_storage_button = Button(self.driver, accessibility_id="manage-keys-and-storage-button") self.multi_account_on_login_button = MultiAccountOnLoginButton(self.driver) self.move_keystore_file_option = Button(self.driver, accessibility_id="move-keystore-file") + self.reset_database_checkbox = Button(self.driver, translation_id="reset-database") self.move_and_reset_button = MoveAndResetButton(self.driver) self.choose_storage_button = Button(self.driver, translation_id="choose-storage") self.enter_seed_phrase_next_button = Button(self.driver, translation_id="enter-seed-phrase")