|
14 | 14 | from scripts.utils.generators import random_mnemonic |
15 | 15 |
|
16 | 16 |
|
17 | | -@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703625', |
18 | | - 'Import or restore a Keycard via a seed phrase') |
19 | | -@pytest.mark.case(703625) |
20 | | -@pytest.mark.keycard |
21 | | -def test_import_restore_keycard_via_seed_phrase(main_screen: MainWindow): |
22 | | - timeout = configs.timeouts.UI_LOAD_TIMEOUT_MSEC |
23 | | - pin = Keycard.KEYCARD_PIN.value |
24 | | - keycard_name = Keycard.KEYCARD_NAME.value |
25 | | - account_name = Keycard.ACCOUNT_NAME.value |
26 | | - |
27 | | - with step('Choose option Import or restore account via seed phrase in settings'): |
28 | | - main_screen.prepare() |
29 | | - keycard_settings = main_screen.left_panel.open_settings().left_panel.open_keycard_settings() |
30 | | - keycard_popup = keycard_settings.click_import_restore_via_seed_phrase() |
31 | | - |
32 | | - with step('Verify that header, instructions and image path are correct'): |
33 | | - actual_keycard_header = keycard_popup.keycard_header |
34 | | - actual_instructions = keycard_popup.keycard_instructions |
35 | | - actual_image_path = keycard_popup.keycard_image_source_path |
36 | | - assert actual_keycard_header == Keycard.KEYCARD_POPUP_HEADER_IMPORT_SEED.value, f"The header is incorrect {actual_keycard_header}" |
37 | | - assert Keycard.KEYCARD_INSTRUCTIONS_PLUG_IN.value in actual_instructions, f"There is no correct keycard instruction in {actual_instructions}" |
38 | | - assert PLUG_IN_KEYCARD_IMAGE_PATH == actual_image_path |
39 | | - |
40 | | - with step('Plug in reader'): |
41 | | - main_screen.hide() |
42 | | - keycard_controller = MockedKeycardController().wait_until_appears(10000) |
43 | | - keycard_controller.plugin_reader() |
44 | | - main_screen.show() |
45 | | - |
46 | | - with step('Verify displayed keycard popup instructions and image path are correct'): |
47 | | - assert driver.waitFor( |
48 | | - lambda: Keycard.KEYCARD_INSTRUCTIONS_INSERT_KEYCARD.value in keycard_popup.keycard_instructions, |
49 | | - timeout), "There is no correct keycard instruction" |
50 | | - time.sleep(2) |
51 | | - assert INSERT_KEYCARD_IMAGE_PATH == keycard_popup.keycard_image_source_path |
52 | | - |
53 | | - with step('Register and insert keycard'): |
54 | | - main_screen.hide() |
55 | | - keycard_controller.register_keycard().insert_keycard_1() |
56 | | - main_screen.show() |
57 | | - |
58 | | - with step('Verify displayed keycard popup instructions are correct'): |
59 | | - assert driver.waitFor(lambda: Keycard.KEYCARD_RECOGNIZED.value in keycard_popup.keycard_instructions, |
60 | | - timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}" |
61 | | - |
62 | | - with step('Import keycard via seed phrase'): |
63 | | - keycard_popup.import_keycard_via_seed_phrase(random_mnemonic().split(), pin, keycard_name, account_name) |
64 | | - |
65 | | - with step('Verify that preview shows correct keycard and account name and color and instructions are correct'): |
66 | | - assert driver.waitFor(lambda: Keycard.KEYCARD_READY.value in keycard_popup.keycard_instructions), \ |
67 | | - f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}" |
68 | | - |
69 | | - assert keycard_popup.keypair_name == keycard_name, "Keycard name in preview is incorrect" |
70 | | - assert keycard_popup.keypair_account_name == account_name, "Account name in preview is incorrect" |
71 | | - assert keycard_popup.keypair_account_color == ColorCodes.BLUE.value, "Color in preview is incorrect" |
72 | | - |
73 | | - with step('Keycard image source path is correct'): |
74 | | - time.sleep(2) |
75 | | - assert KEYCARD_SUCCESS_IMAGE_PATH == keycard_popup.keycard_image_source_path |
| 17 | +# @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703625', |
| 18 | +# 'Import or restore a Keycard via a seed phrase') |
| 19 | +# @pytest.mark.case(703625) |
| 20 | +# @pytest.mark.keycard |
| 21 | +# def test_import_restore_keycard_via_seed_phrase(main_screen: MainWindow): |
| 22 | +# timeout = configs.timeouts.UI_LOAD_TIMEOUT_MSEC |
| 23 | +# pin = Keycard.KEYCARD_PIN.value |
| 24 | +# keycard_name = Keycard.KEYCARD_NAME.value |
| 25 | +# account_name = Keycard.ACCOUNT_NAME.value |
| 26 | +# |
| 27 | +# with step('Choose option Import or restore account via seed phrase in settings'): |
| 28 | +# main_screen.prepare() |
| 29 | +# keycard_settings = main_screen.left_panel.open_settings().left_panel.open_keycard_settings() |
| 30 | +# keycard_popup = keycard_settings.click_import_restore_via_seed_phrase() |
| 31 | +# |
| 32 | +# with step('Verify that header, instructions and image path are correct'): |
| 33 | +# actual_keycard_header = keycard_popup.keycard_header |
| 34 | +# actual_instructions = keycard_popup.keycard_instructions |
| 35 | +# actual_image_path = keycard_popup.keycard_image_source_path |
| 36 | +# assert actual_keycard_header == Keycard.KEYCARD_POPUP_HEADER_IMPORT_SEED.value, f"The header is incorrect {actual_keycard_header}" |
| 37 | +# assert Keycard.KEYCARD_INSTRUCTIONS_PLUG_IN.value in actual_instructions, f"There is no correct keycard instruction in {actual_instructions}" |
| 38 | +# assert PLUG_IN_KEYCARD_IMAGE_PATH == actual_image_path |
| 39 | +# |
| 40 | +# with step('Plug in reader'): |
| 41 | +# main_screen.hide() |
| 42 | +# keycard_controller = MockedKeycardController().wait_until_appears(10000) |
| 43 | +# keycard_controller.plugin_reader() |
| 44 | +# main_screen.show() |
| 45 | +# |
| 46 | +# with step('Verify displayed keycard popup instructions and image path are correct'): |
| 47 | +# assert driver.waitFor( |
| 48 | +# lambda: Keycard.KEYCARD_INSTRUCTIONS_INSERT_KEYCARD.value in keycard_popup.keycard_instructions, |
| 49 | +# timeout), "There is no correct keycard instruction" |
| 50 | +# time.sleep(2) |
| 51 | +# assert INSERT_KEYCARD_IMAGE_PATH == keycard_popup.keycard_image_source_path |
| 52 | +# |
| 53 | +# with step('Register and insert keycard'): |
| 54 | +# main_screen.hide() |
| 55 | +# keycard_controller.register_keycard().insert_keycard_1() |
| 56 | +# main_screen.show() |
| 57 | +# |
| 58 | +# with step('Verify displayed keycard popup instructions are correct'): |
| 59 | +# assert driver.waitFor(lambda: Keycard.KEYCARD_RECOGNIZED.value in keycard_popup.keycard_instructions, |
| 60 | +# timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}" |
| 61 | +# |
| 62 | +# with step('Import keycard via seed phrase'): |
| 63 | +# keycard_popup.import_keycard_via_seed_phrase(random_mnemonic().split(), pin, keycard_name, account_name) |
| 64 | +# |
| 65 | +# with step('Verify that preview shows correct keycard and account name and color and instructions are correct'): |
| 66 | +# assert driver.waitFor(lambda: Keycard.KEYCARD_READY.value in keycard_popup.keycard_instructions), \ |
| 67 | +# f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}" |
| 68 | +# |
| 69 | +# assert keycard_popup.keypair_name == keycard_name, "Keycard name in preview is incorrect" |
| 70 | +# assert keycard_popup.keypair_account_name == account_name, "Account name in preview is incorrect" |
| 71 | +# assert keycard_popup.keypair_account_color == ColorCodes.BLUE.value, "Color in preview is incorrect" |
| 72 | +# |
| 73 | +# with step('Keycard image source path is correct'): |
| 74 | +# time.sleep(2) |
| 75 | +# assert KEYCARD_SUCCESS_IMAGE_PATH == keycard_popup.keycard_image_source_path |
0 commit comments