2023-08-04 18:27:03 +00:00
|
|
|
import logging
|
2023-11-16 10:48:17 +00:00
|
|
|
import os
|
2023-08-10 06:58:50 +00:00
|
|
|
|
2023-08-04 18:27:03 +00:00
|
|
|
import allure
|
|
|
|
import pytest
|
|
|
|
from allure import step
|
2023-12-07 16:47:34 +00:00
|
|
|
from . import marks
|
2023-08-04 18:27:03 +00:00
|
|
|
|
|
|
|
import configs.timeouts
|
2023-08-29 14:43:00 +00:00
|
|
|
from gui.components.onboarding.before_started_popup import BeforeStartedPopUp
|
2023-09-22 03:58:45 +00:00
|
|
|
from gui.components.onboarding.beta_consent_popup import BetaConsentPopup
|
2023-08-29 14:43:00 +00:00
|
|
|
from gui.components.picture_edit_popup import shift_image
|
2023-08-04 18:27:03 +00:00
|
|
|
from gui.components.splash_screen import SplashScreen
|
2023-09-22 03:58:45 +00:00
|
|
|
from gui.screens.onboarding import AllowNotificationsView, WelcomeToStatusView, BiometricsView, KeysView
|
2023-08-04 18:27:03 +00:00
|
|
|
|
2023-12-07 16:47:34 +00:00
|
|
|
pytestmark = marks
|
2023-08-04 18:27:03 +00:00
|
|
|
|
|
|
|
|
2023-08-10 11:43:17 +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()
|
2023-10-26 11:19:32 +00:00
|
|
|
welcome_screen = WelcomeToStatusView().wait_until_appears()
|
|
|
|
return welcome_screen.get_keys()
|
2023-08-10 11:43:17 +00:00
|
|
|
|
|
|
|
|
2023-08-04 18:27:03 +00:00
|
|
|
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703421', 'Generate new keys')
|
|
|
|
@pytest.mark.case(703421)
|
2023-08-10 06:58:50 +00:00
|
|
|
@pytest.mark.parametrize('user_name, password, user_image, zoom, shift', [
|
2023-12-08 13:21:18 +00:00
|
|
|
pytest.param('Test-User _1', '*P@ssw0rd*', None, None, None, marks=pytest.mark.critical),
|
2023-08-10 06:58:50 +00:00
|
|
|
pytest.param('Test-User', '*P@ssw0rd*', 'tv_signal.png', 5, shift_image(0, 0, 0, 0)),
|
2023-12-08 13:21:18 +00:00
|
|
|
pytest.param('_1Test-User', '*P@ssw0rd*', 'tv_signal.jpeg', 5, shift_image(0, 1000, 1000, 0))
|
2023-08-04 18:27:03 +00:00
|
|
|
])
|
2023-08-10 11:43:17 +00:00
|
|
|
def test_generate_new_keys(main_window, keys_screen, user_name: str, password, user_image: str, zoom: int, shift):
|
2023-08-04 18:27:03 +00:00
|
|
|
with step(f'Setup profile with name: {user_name} and image: {user_image}'):
|
2023-08-10 06:58:50 +00:00
|
|
|
|
2023-11-27 10:44:08 +00:00
|
|
|
keys_screen.generate_new_keys().back()
|
2023-08-04 18:27:03 +00:00
|
|
|
profile_view = keys_screen.generate_new_keys()
|
2023-11-27 10:44:08 +00:00
|
|
|
assert profile_view.is_next_button_enabled is False
|
2023-08-04 18:27:03 +00:00
|
|
|
profile_view.set_display_name(user_name)
|
|
|
|
if user_image is not None:
|
|
|
|
profile_picture_popup = profile_view.set_user_image(configs.testpath.TEST_FILES / user_image)
|
2023-08-29 14:43:00 +00:00
|
|
|
profile_picture_popup.make_picture(zoom=zoom, shift=shift)
|
2023-08-04 18:27:03 +00:00
|
|
|
assert not profile_view.error_message
|
|
|
|
|
2023-08-10 06:58:50 +00:00
|
|
|
with step('Open Profile details view and verify user info'):
|
2023-08-04 18:27:03 +00:00
|
|
|
|
2023-08-10 06:58:50 +00:00
|
|
|
details_view = profile_view.next()
|
2023-08-04 18:27:03 +00:00
|
|
|
chat_key = details_view.chat_key
|
|
|
|
emoji_hash = details_view.emoji_hash
|
|
|
|
assert details_view.is_identicon_ring_visible
|
2023-11-27 10:44:08 +00:00
|
|
|
details_view.back().next()
|
2023-08-04 18:27:03 +00:00
|
|
|
|
2023-08-10 06:58:50 +00:00
|
|
|
with step('Finalize onboarding and open main screen'):
|
|
|
|
|
2023-08-04 18:27:03 +00:00
|
|
|
create_password_view = details_view.next()
|
2023-11-27 10:44:08 +00:00
|
|
|
create_password_view.back().next()
|
2023-08-04 18:27:03 +00:00
|
|
|
assert not create_password_view.is_create_password_button_enabled
|
|
|
|
confirm_password_view = create_password_view.create_password(password)
|
2023-11-27 10:44:08 +00:00
|
|
|
confirm_password_view.back().click_create_password()
|
2023-08-04 18:27:03 +00:00
|
|
|
confirm_password_view.confirm_password(password)
|
|
|
|
if configs.system.IS_MAC:
|
2023-09-22 03:58:45 +00:00
|
|
|
assert BiometricsView().is_touch_id_button_visible(), f"TouchID button is not found"
|
|
|
|
BiometricsView().wait_until_appears().prefer_password()
|
2023-08-04 18:27:03 +00:00
|
|
|
SplashScreen().wait_until_appears().wait_until_hidden()
|
2023-12-12 12:43:47 +00:00
|
|
|
if not configs.system.TEST_MODE:
|
|
|
|
BetaConsentPopup().confirm()
|
2023-08-04 18:27:03 +00:00
|
|
|
|
2023-08-10 06:58:50 +00:00
|
|
|
with step('Open User Canvas and verify user info'):
|
|
|
|
|
2023-12-13 08:20:56 +00:00
|
|
|
user_canvas = main_window.left_panel.open_online_identifier()
|
2023-08-04 18:27:03 +00:00
|
|
|
assert user_canvas.user_name == user_name
|
|
|
|
|
2023-08-10 06:58:50 +00:00
|
|
|
with step('Open Profile popup and verify user info'):
|
|
|
|
|
2023-12-12 15:43:22 +00:00
|
|
|
profile_popup = user_canvas.open_profile_popup_from_online_identifier()
|
2023-08-04 18:27:03 +00:00
|
|
|
assert profile_popup.user_name == user_name
|
|
|
|
assert profile_popup.chat_key == chat_key
|