2023-11-16 10:48:17 +00:00
|
|
|
import os
|
|
|
|
|
2023-10-06 11:32:08 +00:00
|
|
|
import allure
|
|
|
|
import pytest
|
|
|
|
from allure_commons._allure import step
|
2023-12-07 16:47:34 +00:00
|
|
|
from . import marks
|
2023-10-06 11:32:08 +00:00
|
|
|
|
|
|
|
import configs.system
|
|
|
|
import constants
|
|
|
|
from driver.aut import AUT
|
|
|
|
from gui.components.onboarding.before_started_popup import BeforeStartedPopUp
|
|
|
|
from gui.components.onboarding.beta_consent_popup import BetaConsentPopup
|
|
|
|
from gui.components.splash_screen import SplashScreen
|
2023-11-17 05:53:17 +00:00
|
|
|
from gui.main_window import LeftPanel
|
|
|
|
from gui.mocked_keycard_controller import MockedKeycardController
|
2023-10-06 11:32:08 +00:00
|
|
|
from gui.screens.onboarding import BiometricsView, AllowNotificationsView, WelcomeToStatusView, KeysView
|
|
|
|
|
2023-12-07 16:47:34 +00:00
|
|
|
pytestmark = marks
|
2023-10-06 11:32:08 +00:00
|
|
|
|
2024-02-15 10:37:40 +00:00
|
|
|
|
2023-10-06 11:32:08 +00:00
|
|
|
@pytest.fixture
|
|
|
|
def keys_screen(main_window) -> KeysView:
|
|
|
|
with step('Open Generate new keys view'):
|
|
|
|
if configs.system.IS_MAC:
|
|
|
|
AllowNotificationsView().wait_until_appears().allow()
|
|
|
|
BeforeStartedPopUp().get_started()
|
|
|
|
wellcome_screen = WelcomeToStatusView().wait_until_appears()
|
|
|
|
return wellcome_screen.get_keys()
|
|
|
|
|
|
|
|
|
|
|
|
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703040', 'Import: 12 word seed phrase')
|
|
|
|
@pytest.mark.case(703040)
|
2023-10-11 11:28:34 +00:00
|
|
|
@pytest.mark.parametrize('user_account', [constants.user.user_account_one])
|
2024-02-29 12:55:33 +00:00
|
|
|
@pytest.mark.parametrize('autocomplete, default_name', [
|
|
|
|
pytest.param(False, 'Account 1'),
|
|
|
|
pytest.param(True, 'Account 1', marks=pytest.mark.critical)
|
2023-10-11 11:28:34 +00:00
|
|
|
])
|
2024-03-04 10:45:06 +00:00
|
|
|
def test_import_seed_phrase(aut: AUT, keys_screen, main_window, user_account, default_name: str, autocomplete: bool):
|
2023-10-06 11:32:08 +00:00
|
|
|
with step('Open import seed phrase view and enter seed phrase'):
|
|
|
|
input_view = keys_screen.open_import_seed_phrase_view().open_seed_phrase_input_view()
|
2023-10-17 14:57:39 +00:00
|
|
|
input_view.input_seed_phrase(user_account.seed_phrase, autocomplete)
|
|
|
|
profile_view = input_view.import_seed_phrase()
|
2023-10-06 11:32:08 +00:00
|
|
|
profile_view.set_display_name(user_account.name)
|
|
|
|
|
|
|
|
with step('Finalize onboarding and open main screen'):
|
|
|
|
details_view = profile_view.next()
|
|
|
|
create_password_view = details_view.next()
|
|
|
|
confirm_password_view = create_password_view.create_password(user_account.password)
|
|
|
|
confirm_password_view.confirm_password(user_account.password)
|
|
|
|
if configs.system.IS_MAC:
|
|
|
|
BiometricsView().wait_until_appears().prefer_password()
|
|
|
|
SplashScreen().wait_until_appears().wait_until_hidden()
|
2023-11-16 10:48:17 +00:00
|
|
|
if not configs.system.TEST_MODE:
|
2023-10-06 11:32:08 +00:00
|
|
|
BetaConsentPopup().confirm()
|
|
|
|
|
2023-10-23 15:43:17 +00:00
|
|
|
with (step('Verify that restored account reveals correct status wallet address')):
|
2024-03-04 10:45:06 +00:00
|
|
|
status_account_index = 0
|
2023-10-23 15:43:17 +00:00
|
|
|
status_acc_view = (
|
2024-03-04 10:45:06 +00:00
|
|
|
LeftPanel().open_settings().left_panel.open_wallet_settings().open_account_in_settings(default_name,
|
|
|
|
status_account_index))
|
2023-10-23 15:43:17 +00:00
|
|
|
address = status_acc_view.get_account_address_value()
|
|
|
|
assert address == user_account.status_address, \
|
|
|
|
f"Recovered account should have address {user_account.status_address}, but has {address}"
|
|
|
|
|
2023-10-06 11:32:08 +00:00
|
|
|
with step('Verify that the user logged in via seed phrase correctly'):
|
2023-12-13 08:20:56 +00:00
|
|
|
user_canvas = main_window.left_panel.open_online_identifier()
|
2023-12-12 15:43:22 +00:00
|
|
|
profile_popup = user_canvas.open_profile_popup_from_online_identifier()
|
2023-10-06 11:32:08 +00:00
|
|
|
assert profile_popup.user_name == user_account.name
|