chore: tests ordering and tesseract removal (#145)
|
@ -2,3 +2,4 @@ from . import commands
|
|||
from .colors import *
|
||||
from .tesseract import *
|
||||
from .user import *
|
||||
from .social_links import *
|
||||
|
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 971 B After Width: | Height: | Size: 971 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 971 B After Width: | Height: | Size: 971 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 930 B After Width: | Height: | Size: 930 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
@ -1,8 +1,8 @@
|
|||
import allure
|
||||
|
||||
from gui.components.base_popup import BasePopup
|
||||
from gui.elements.qt.button import Button
|
||||
from gui.elements.qt.text_edit import TextEdit
|
||||
from gui.elements.button import Button
|
||||
from gui.elements.text_edit import TextEdit
|
||||
|
||||
|
||||
class EditGroupNameAndImagePopup(BasePopup):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import allure
|
||||
|
||||
from gui.components.base_popup import BasePopup
|
||||
from gui.elements.qt.button import Button
|
||||
from gui.elements.button import Button
|
||||
|
||||
|
||||
class LeaveGroupPopup(BasePopup):
|
||||
|
|
|
@ -15,7 +15,7 @@ class SocialLinksPopup(BasePopup):
|
|||
super(SocialLinksPopup, self).__init__()
|
||||
self._add_social_link_list_item = QObject('socialLink_StatusListItem')
|
||||
self._social_link_text_field = TextEdit('edit_TextEdit')
|
||||
self._add_button = Button('add_StatusButton')
|
||||
self._add_button = Button('o_StatusBackButton')
|
||||
|
||||
@allure.step('Get social link')
|
||||
def _get_list_item(self, title: str) -> QObject:
|
||||
|
|
|
@ -7,11 +7,15 @@ import allure
|
|||
import configs
|
||||
import driver
|
||||
from driver.objects_access import walk_children
|
||||
from gui.components.context_menu import ContextMenu
|
||||
from gui.components.messaging.edit_group_name_and_image_popup import EditGroupNameAndImagePopup
|
||||
from gui.components.messaging.leave_group_popup import LeaveGroupPopup
|
||||
from gui.elements.button import Button
|
||||
from gui.elements.list import List
|
||||
from gui.elements.object import QObject
|
||||
from gui.elements.scroll import Scroll
|
||||
from gui.elements.text_edit import TextEdit
|
||||
from gui.elements.text_label import TextLabel
|
||||
from gui.screens.community import CommunityScreen
|
||||
from scripts.tools.image import Image
|
||||
|
||||
|
|
|
@ -5,9 +5,7 @@ import pytest
|
|||
from allure import step
|
||||
|
||||
import configs.timeouts
|
||||
import constants
|
||||
import driver
|
||||
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.picture_edit_popup import shift_image
|
||||
|
@ -50,18 +48,19 @@ def test_generate_new_keys(main_window, keys_screen, user_name: str, password, u
|
|||
with step('Open Profile details view and verify user info'):
|
||||
|
||||
details_view = profile_view.next()
|
||||
if user_image is None:
|
||||
assert not details_view.is_user_image_background_white()
|
||||
assert driver.waitFor(
|
||||
lambda: details_view.is_user_image_contains(user_name[:2]),
|
||||
configs.timeouts.UI_LOAD_TIMEOUT_MSEC
|
||||
)
|
||||
else:
|
||||
image.compare(
|
||||
details_view.cropped_profile_image,
|
||||
f'{user_image.split(".")[1]}_onboarding.png',
|
||||
threshold=0.9
|
||||
)
|
||||
# TODO: temp removing tesseract usage because it is not stable
|
||||
#if user_image is None:
|
||||
# assert not details_view.is_user_image_background_white()
|
||||
# assert driver.waitFor(
|
||||
# lambda: details_view.is_user_image_contains(user_name[:2]),
|
||||
# configs.timeouts.UI_LOAD_TIMEOUT_MSEC
|
||||
# )
|
||||
#else:
|
||||
# image.compare(
|
||||
# details_view.cropped_profile_image,
|
||||
# f'{user_image.split(".")[1]}_onboarding.png',
|
||||
# threshold=0.9
|
||||
# )
|
||||
chat_key = details_view.chat_key
|
||||
emoji_hash = details_view.emoji_hash
|
||||
assert details_view.is_identicon_ring_visible
|
||||
|
@ -83,11 +82,12 @@ def test_generate_new_keys(main_window, keys_screen, user_name: str, password, u
|
|||
|
||||
user_canvas = main_window.left_panel.open_user_canvas()
|
||||
assert user_canvas.user_name == user_name
|
||||
if user_image is None:
|
||||
assert driver.waitFor(
|
||||
lambda: user_canvas.is_user_image_contains(user_name[:2]),
|
||||
configs.timeouts.UI_LOAD_TIMEOUT_MSEC
|
||||
)
|
||||
# TODO: temp removing tesseract usage because it is not stable
|
||||
# if user_image is None:
|
||||
# assert driver.waitFor(
|
||||
# lambda: user_canvas.is_user_image_contains(user_name[:2]),
|
||||
# configs.timeouts.UI_LOAD_TIMEOUT_MSEC
|
||||
# )
|
||||
|
||||
with step('Open Profile popup and verify user info'):
|
||||
|
||||
|
@ -95,43 +95,15 @@ def test_generate_new_keys(main_window, keys_screen, user_name: str, password, u
|
|||
assert profile_popup.user_name == user_name
|
||||
assert profile_popup.chat_key == chat_key
|
||||
assert profile_popup.emoji_hash.compare(emoji_hash.view, threshold=0.9)
|
||||
if user_image is None:
|
||||
assert driver.waitFor(
|
||||
lambda: profile_popup.is_user_image_contains(user_name[:2]),
|
||||
configs.timeouts.UI_LOAD_TIMEOUT_MSEC
|
||||
)
|
||||
else:
|
||||
image.compare(
|
||||
profile_popup.cropped_profile_image,
|
||||
f'{user_image.split(".")[1]}_profile.png',
|
||||
threshold=0.9
|
||||
)
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703040', 'Import: 12 word seed phrase')
|
||||
@pytest.mark.case(703040)
|
||||
@pytest.mark.parametrize('user_account', [constants.user.user_account_two])
|
||||
def test_import_seed_phrase(aut: AUT, keys_screen, main_window, user_account):
|
||||
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()
|
||||
profile_view = input_view.input_seed_phrase(user_account.seed_phrase)
|
||||
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()
|
||||
if not configs.DEV_BUILD:
|
||||
BetaConsentPopup().confirm()
|
||||
|
||||
with step('Verify that the user logged in via seed phrase correctly'):
|
||||
user_canvas = main_window.left_panel.open_user_canvas()
|
||||
profile_popup = user_canvas.open_profile_popup()
|
||||
assert profile_popup.user_name == user_account.name
|
||||
|
||||
aut.restart()
|
||||
main_window.authorize_user(user_account)
|
||||
# TODO: temp removing tesseract usage because it is not stable
|
||||
#if user_image is None:
|
||||
# assert driver.waitFor(
|
||||
# lambda: profile_popup.is_user_image_contains(user_name[:2]),
|
||||
# configs.timeouts.UI_LOAD_TIMEOUT_MSEC
|
||||
# )
|
||||
#else:
|
||||
# image.compare(
|
||||
# profile_popup.cropped_profile_image,
|
||||
# f'{user_image.split(".")[1]}_profile.png',
|
||||
# threshold=0.9
|
||||
# )
|
|
@ -0,0 +1,50 @@
|
|||
import allure
|
||||
import pytest
|
||||
from allure_commons._allure import step
|
||||
|
||||
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
|
||||
from gui.screens.onboarding import BiometricsView, AllowNotificationsView, WelcomeToStatusView, KeysView
|
||||
|
||||
|
||||
@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)
|
||||
@pytest.mark.parametrize('user_account', [constants.user.user_account_two])
|
||||
def test_import_seed_phrase(aut: AUT, keys_screen, main_window, user_account):
|
||||
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()
|
||||
profile_view = input_view.input_seed_phrase(user_account.seed_phrase)
|
||||
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()
|
||||
if not configs.DEV_BUILD:
|
||||
BetaConsentPopup().confirm()
|
||||
|
||||
with step('Verify that the user logged in via seed phrase correctly'):
|
||||
user_canvas = main_window.left_panel.open_user_canvas()
|
||||
profile_popup = user_canvas.open_profile_popup()
|
||||
assert profile_popup.user_name == user_account.name
|
||||
|
||||
aut.restart()
|
||||
main_window.authorize_user(user_account)
|
|
@ -31,6 +31,7 @@ def sync_screen(main_window) -> SyncCodeView:
|
|||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703592', 'Sync device during onboarding')
|
||||
@pytest.mark.case(703592)
|
||||
@pytest.mark.parametrize('user_data', [configs.testpath.TEST_USER_DATA / 'user_account_one'])
|
||||
@pytest.mark.skip(reason = "https://github.com/status-im/desktop-qa-automation/issues/147")
|
||||
def test_sync_device_during_onboarding(multiple_instance, user_data):
|
||||
user: UserAccount = constants.user_account_one
|
||||
main_window = MainWindow()
|
||||
|
@ -84,10 +85,11 @@ def test_sync_device_during_onboarding(multiple_instance, user_data):
|
|||
user_canvas = main_window.left_panel.open_user_canvas()
|
||||
user_canvas_name = user_canvas.user_name
|
||||
assert user_canvas_name == user.name
|
||||
assert driver.waitFor(
|
||||
lambda: user_canvas.is_user_image_contains(user.name[:2]),
|
||||
configs.timeouts.UI_LOAD_TIMEOUT_MSEC
|
||||
)
|
||||
# TODO: temp removing tesseract usage because it is not stable
|
||||
#assert driver.waitFor(
|
||||
# lambda: user_canvas.is_user_image_contains(user.name[:2]),
|
||||
# configs.timeouts.UI_LOAD_TIMEOUT_MSEC
|
||||
#)
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703631', 'Wrong sync code')
|
|
@ -0,0 +1,76 @@
|
|||
import allure
|
||||
import pytest
|
||||
from allure import step
|
||||
|
||||
import constants
|
||||
from driver.aut import AUT
|
||||
from gui.main_window import MainWindow
|
||||
|
||||
pytestmark = allure.suite("Settings")
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703007',
|
||||
'Change own display name in profile popup')
|
||||
@pytest.mark.case(703007)
|
||||
@pytest.mark.parametrize('user_account', [constants.user.user_account_one])
|
||||
@pytest.mark.parametrize('new_name', [pytest.param('NewUserName')])
|
||||
def test_change_own_display_name(main_screen: MainWindow, user_account, new_name):
|
||||
with step('Open own profile popup and check name of user is correct'):
|
||||
profile = main_screen.left_panel.open_user_canvas()
|
||||
profile_popup = profile.open_profile_popup()
|
||||
assert profile_popup.user_name == user_account.name
|
||||
|
||||
with step('Go to edit profile settings and change the name of the user'):
|
||||
profile_popup.edit_profile().set_name(new_name)
|
||||
|
||||
with step('Open own profile popup and check name of user is correct'):
|
||||
assert main_screen.left_panel.open_user_canvas().open_profile_popup().user_name == new_name
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703002', 'Switch state to offline')
|
||||
@pytest.mark.case(703002)
|
||||
def test_switch_states_between_offline_and_online(aut: AUT, main_screen: MainWindow, user_account):
|
||||
with (step('Open settings and switch state to offline')):
|
||||
settings = main_screen.left_panel
|
||||
settings.set_user_to_offline()
|
||||
|
||||
with step('Verify user appears offline'):
|
||||
assert settings.user_is_offline()
|
||||
|
||||
with step('Restart application'):
|
||||
aut.restart()
|
||||
main_screen.authorize_user(user_account)
|
||||
|
||||
with step('Verify user appears offline'):
|
||||
assert settings.user_is_offline()
|
||||
|
||||
with (step('Open settings and switch state to online')):
|
||||
settings = main_screen.left_panel
|
||||
settings.set_user_to_online()
|
||||
|
||||
with step('Restart application'):
|
||||
aut.restart()
|
||||
main_screen.authorize_user(user_account)
|
||||
|
||||
with step('Verify user appears online'):
|
||||
assert settings.user_is_online()
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703004', 'Switch state to automatic')
|
||||
@pytest.mark.case(703004)
|
||||
def test_switch_state_to_automatic(aut: AUT, main_screen: MainWindow, user_account):
|
||||
with step('Open settings and switch state to automatic'):
|
||||
settings = main_screen.left_panel
|
||||
settings.set_user_to_automatic()
|
||||
|
||||
with step('Verify user status set automatically to online'):
|
||||
assert settings.user_is_set_to_automatic()
|
||||
|
||||
with step('Restart application'):
|
||||
aut.restart()
|
||||
main_screen.authorize_user(user_account)
|
||||
|
||||
with step('Verify user status set automatically to online'):
|
||||
assert settings.user_is_set_to_automatic()
|
||||
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
import allure
|
||||
import pytest
|
||||
from allure_commons._allure import step
|
||||
|
||||
import constants
|
||||
from driver.aut import AUT
|
||||
from gui.main_window import MainWindow
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703005',
|
||||
'Change the password and login with new password')
|
||||
@pytest.mark.case(703005)
|
||||
@pytest.mark.parametrize('user_account, user_account_new',
|
||||
[pytest.param(constants.user.user_account_one, constants.user.user_account_one_changed_name)])
|
||||
def test_change_password_and_login(aut: AUT, main_screen: MainWindow, user_account, user_account_new):
|
||||
with step('Open profile settings and change password'):
|
||||
main_screen.left_panel.open_settings().left_panel.open_profile_settings().open_change_password_popup().change_password(
|
||||
user_account.password, user_account_new.password)
|
||||
|
||||
with step('Restart application'):
|
||||
aut.restart()
|
||||
main_screen.authorize_user(user_account_new)
|
||||
|
||||
with step('Verify that the user logged in correctly'):
|
||||
user_canvas = main_screen.left_panel.open_user_canvas()
|
||||
profile_popup = user_canvas.open_profile_popup()
|
||||
assert profile_popup.user_name == user_account_new.name
|
|
@ -0,0 +1,40 @@
|
|||
import allure
|
||||
import pytest
|
||||
from allure_commons._allure import step
|
||||
|
||||
import constants
|
||||
from driver.aut import AUT
|
||||
from gui.components.settings.changes_detected_popup import ChangesDetectedToastMessage
|
||||
from gui.main_window import MainWindow
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703006',
|
||||
'Set display name, bio and social links')
|
||||
@pytest.mark.case(703006)
|
||||
@pytest.mark.parametrize('user_account, user_account_changed',
|
||||
[pytest.param(constants.user.user_account_one, constants.user.user_account_one_changed_name)])
|
||||
@pytest.mark.parametrize('bio, links', [pytest.param('This is my bio', constants.social_links)])
|
||||
@pytest.mark.skip(reason = "https://github.com/status-im/desktop-qa-automation/issues/146")
|
||||
def test_set_name_bio_social_links(main_screen: MainWindow, aut: AUT, user_account, user_account_changed, bio, links):
|
||||
with step('Open profile settings and check name, bio and links'):
|
||||
profile_settings = main_screen.left_panel.open_settings().left_panel.open_profile_settings()
|
||||
assert profile_settings.display_name == user_account.name
|
||||
assert profile_settings.bio == ''
|
||||
for value in profile_settings.social_links.values():
|
||||
assert value == ''
|
||||
|
||||
with step('Set new name, bio and links'):
|
||||
profile_settings.set_name(user_account_changed.name)
|
||||
profile_settings.bio = bio
|
||||
profile_settings.social_links = links
|
||||
ChangesDetectedToastMessage().save()
|
||||
|
||||
with step('Restart application'):
|
||||
aut.restart()
|
||||
main_screen.authorize_user(user_account_changed)
|
||||
|
||||
with step('Open profile settings and check new name, bio and links'):
|
||||
profile_settings = main_screen.left_panel.open_settings().left_panel.open_profile_settings()
|
||||
assert profile_settings.display_name == user_account_changed.name
|
||||
assert profile_settings.bio == bio
|
||||
profile_settings.verify_social_links(links)
|
|
@ -0,0 +1,94 @@
|
|||
import allure
|
||||
import pytest
|
||||
from allure_commons._allure import step
|
||||
|
||||
import driver
|
||||
from gui.components.signing_phrase_popup import SigningPhrasePopup
|
||||
from gui.components.wallet.authenticate_popup import AuthenticatePopup
|
||||
from gui.main_window import MainWindow
|
||||
from scripts.tools import image
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703415',
|
||||
'Account order: account order could be changed with drag&drop')
|
||||
@pytest.mark.case(703415)
|
||||
@pytest.mark.parametrize('address, default_name, name, color, emoji, second_name, second_color, second_emoji', [
|
||||
pytest.param('0xea123F7beFF45E3C9fdF54B324c29DBdA14a639A', 'Status account',
|
||||
'WatchOnly', '#2a4af5', 'sunglasses', 'Generated', '#216266', 'thumbsup')
|
||||
])
|
||||
def test_change_account_order_by_drag_and_drop(main_screen: MainWindow, user_account, address: str, default_name,
|
||||
name: str, color: str, emoji: str, second_name: str, second_color: str,
|
||||
second_emoji: str):
|
||||
with step('Create watch-only wallet account'):
|
||||
wallet = main_screen.left_panel.open_wallet()
|
||||
SigningPhrasePopup().wait_until_appears().confirm_phrase()
|
||||
account_popup = wallet.left_panel.open_add_account_popup()
|
||||
account_popup.set_name(name).set_emoji(emoji).set_color(color).set_origin_eth_address(address).save()
|
||||
account_popup.wait_until_hidden()
|
||||
|
||||
with step('Create generated wallet account'):
|
||||
account_popup = wallet.left_panel.open_add_account_popup()
|
||||
account_popup.set_name(second_name).set_emoji(second_emoji).set_color(second_color).save()
|
||||
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
|
||||
account_popup.wait_until_hidden()
|
||||
|
||||
with step('Verify accounts in wallet settings'):
|
||||
account_order = main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_account_order()
|
||||
with step('Account order is correct'):
|
||||
assert account_order.accounts[0].name == default_name
|
||||
assert account_order.accounts[1].name == name
|
||||
assert account_order.accounts[2].name == second_name
|
||||
with step('Eye icon is displayed on watch-only account'):
|
||||
account_order.get_eye_icon(name)
|
||||
with step('Icons on accounts are correct'):
|
||||
image.compare(account_order.accounts[1].icon, 'watch_only_account_icon.png')
|
||||
image.compare(account_order.accounts[2].icon, 'generated_account_icon.png')
|
||||
|
||||
with step('Drag first account to the end of the list'):
|
||||
account_order.drag_account(default_name, 2)
|
||||
|
||||
with step('Verify the account order'):
|
||||
with step('Account order is correct in wallet settings'):
|
||||
assert driver.waitFor(lambda: account_order.accounts[0].name == name)
|
||||
assert driver.waitFor(lambda: account_order.accounts[1].name == second_name)
|
||||
assert driver.waitFor(lambda: account_order.accounts[2].name == default_name)
|
||||
with step('Account order is correct in wallet'):
|
||||
wallet = main_screen.left_panel.open_wallet()
|
||||
assert driver.waitFor(lambda: wallet.left_panel.accounts[0].name == name)
|
||||
assert driver.waitFor(lambda: wallet.left_panel.accounts[1].name == second_name)
|
||||
assert driver.waitFor(lambda: wallet.left_panel.accounts[2].name == default_name)
|
||||
|
||||
with step('Drag second account to the top of the list'):
|
||||
account_order = main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_account_order()
|
||||
account_order.drag_account(second_name, 0)
|
||||
|
||||
with step('Verify the account order'):
|
||||
with step('Account order is correct in wallet settings'):
|
||||
assert driver.waitFor(lambda: account_order.accounts[0].name == second_name)
|
||||
assert driver.waitFor(lambda: account_order.accounts[1].name == name)
|
||||
assert driver.waitFor(lambda: account_order.accounts[2].name == default_name)
|
||||
with step('Account order is correct in wallet'):
|
||||
wallet = main_screen.left_panel.open_wallet()
|
||||
assert driver.waitFor(lambda: wallet.left_panel.accounts[0].name == second_name)
|
||||
assert driver.waitFor(lambda: wallet.left_panel.accounts[1].name == name)
|
||||
assert driver.waitFor(lambda: wallet.left_panel.accounts[2].name == default_name)
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/edit/703416',
|
||||
'Account order: reordering is not possible having a single account')
|
||||
@pytest.mark.case(703416)
|
||||
@pytest.mark.parametrize('default_name, text_on_top', [
|
||||
pytest.param('Status account', 'This account looks a little lonely. Add another account'
|
||||
' to enable re-ordering.')
|
||||
])
|
||||
def test_change_account_order_not_possible(main_screen: MainWindow, default_name: str, text_on_top: str):
|
||||
with step('Open edit account order view'):
|
||||
account_order = main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_account_order()
|
||||
|
||||
with step('Verify that only default account displayed'):
|
||||
assert len(account_order.accounts) == 1
|
||||
assert account_order.accounts[0].name == default_name
|
||||
|
||||
with step('Back button is present and text on top is correct'):
|
||||
assert account_order.account_recommendations[0] == text_on_top
|
||||
assert account_order.is_back_button_present() is True
|
|
@ -0,0 +1,45 @@
|
|||
import time
|
||||
|
||||
import allure
|
||||
import pytest
|
||||
from allure_commons._allure import step
|
||||
|
||||
import constants
|
||||
from gui.components.signing_phrase_popup import SigningPhrasePopup
|
||||
from gui.components.wallet.authenticate_popup import AuthenticatePopup
|
||||
from gui.main_window import MainWindow
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/edit/703598',
|
||||
'Add new account from wallet settings screen')
|
||||
@pytest.mark.case(703598)
|
||||
@pytest.mark.parametrize('user_account', [constants.user.user_account_one])
|
||||
@pytest.mark.parametrize('name, color, emoji, emoji_unicode, '
|
||||
'new_name, new_color, new_emoji, new_emoji_unicode', [
|
||||
pytest.param('GenAcc1', '#2a4af5', 'sunglasses', '1f60e',
|
||||
'GenAcc1edited', '#216266', 'thumbsup', '1f44d')
|
||||
])
|
||||
def test_add_new_account_from_wallet_settings(main_screen: MainWindow, user_account,
|
||||
color: str, emoji: str, emoji_unicode: str,
|
||||
name: str, new_name: str, new_color: str, new_emoji: str,
|
||||
new_emoji_unicode: str):
|
||||
with step('Open add account pop up from wallet settings'):
|
||||
add_account_popup = \
|
||||
main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_add_account_pop_up()
|
||||
|
||||
with step('Add a new generated account from wallet settings screen'):
|
||||
|
||||
add_account_popup.set_name(name).set_emoji(emoji).set_color(color).save()
|
||||
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
|
||||
add_account_popup.wait_until_hidden()
|
||||
|
||||
with step('Verify that the account is correctly displayed in accounts list'):
|
||||
|
||||
wallet = main_screen.left_panel.open_wallet()
|
||||
SigningPhrasePopup().wait_until_appears().confirm_phrase()
|
||||
expected_account = constants.user.account_list_item(name, color.lower(), emoji_unicode)
|
||||
started_at = time.monotonic()
|
||||
while expected_account not in wallet.left_panel.accounts:
|
||||
time.sleep(1)
|
||||
if time.monotonic() - started_at > 15:
|
||||
raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}')
|
|
@ -0,0 +1,71 @@
|
|||
import allure
|
||||
import pytest
|
||||
from allure_commons._allure import step
|
||||
|
||||
import driver
|
||||
from constants.wallet import WalletNetworkNaming, WalletEditNetworkErrorMessages, WalletNetworkSettings, \
|
||||
WalletNetworkDefaultValues
|
||||
from gui.main_window import MainWindow
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703515',
|
||||
'Network: Network: Editing network -> Restore defaults')
|
||||
@pytest.mark.case(703515)
|
||||
def test_settings_networks_edit_restore_defaults(main_screen: MainWindow):
|
||||
networks = main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_networks()
|
||||
|
||||
with step('Check network items titles'):
|
||||
assert networks.get_network_item_attribute_by_id_and_attr_name('title',
|
||||
WalletNetworkNaming.ETHEREUM_MAINNET_NETWORK_ID.value) == WalletNetworkNaming.LAYER1_ETHEREUM.value
|
||||
assert networks.get_network_item_attribute_by_id_and_attr_name('title',
|
||||
WalletNetworkNaming.OPTIMISM_MAINNET_NETWORK_ID.value) == WalletNetworkNaming.LAYER2_OPTIMISIM.value
|
||||
assert networks.get_network_item_attribute_by_id_and_attr_name('title',
|
||||
WalletNetworkNaming.ARBITRUM_MAINNET_NETWORK_ID.value) == WalletNetworkNaming.LAYER2_ARBITRUM.value
|
||||
|
||||
with step('Open Ethereum Mainnet network item to edit'):
|
||||
edit_network_form = networks.click_network_item_to_open_edit_view(
|
||||
WalletNetworkNaming.ETHEREUM_MAINNET_NETWORK_ID.value)
|
||||
|
||||
with step('Check the elements on the form'):
|
||||
edit_network_form.wait_until_appears().check_available_elements_on_edit_view()
|
||||
|
||||
with step('Click in Main JSON RPC URL and paste incorrect URL'):
|
||||
edit_network_form.edit_network_main_json_rpc_url_input("https://eth-archival.gateway.pokt.network/v1/lb/")
|
||||
|
||||
with step('Check error message for Main JSON RPC URL input'):
|
||||
assert driver.waitFor(
|
||||
lambda: edit_network_form.get_main_rpc_url_error_message_text() == WalletEditNetworkErrorMessages.PINGUNSUCCESSFUL.value)
|
||||
|
||||
with step('Click in Failover JSON RPC URL and paste incorrect URL'):
|
||||
edit_network_form.edit_network_failover_json_rpc_url_input("https://eth-archival.gateway.pokt.network/v1/lb/")
|
||||
|
||||
with step('Check error message for Failover JSON RPC URL input'):
|
||||
assert driver.waitFor(
|
||||
lambda: edit_network_form.get_failover_rpc_url_error_message_text() == WalletEditNetworkErrorMessages.PINGUNSUCCESSFUL.value)
|
||||
|
||||
with step('Check the acknowledgment checkbox'):
|
||||
edit_network_form.check_acknowledgement_checkbox(True)
|
||||
|
||||
with step('Check the acknowledgment text'):
|
||||
assert edit_network_form.get_acknowledgement_checkbox_text(
|
||||
'text') == WalletNetworkSettings.ACKNOWLEDGMENT_CHECKBOX_TEXT.value
|
||||
|
||||
with step('Click Revert to default button and restore values'):
|
||||
edit_network_form.revert_to_default()
|
||||
|
||||
with step('Check value in Main JSON RPC URL input'):
|
||||
assert edit_network_form.get_edit_network_main_json_rpc_url_value() == WalletNetworkDefaultValues.ETHEREUM_LIVE_MAIN.value
|
||||
|
||||
with step('Check successful connection message for Main JSON RPC URL input'):
|
||||
assert driver.waitFor(
|
||||
lambda: edit_network_form.get_main_rpc_url_error_message_text() == WalletEditNetworkErrorMessages.PINGVERIFIED.value)
|
||||
|
||||
with (step('Check value in Failover JSON RPC URL input')):
|
||||
assert edit_network_form.get_edit_network_failover_json_rpc_url_value() == WalletNetworkDefaultValues.ETHEREUM_LIVE_FAILOVER.value
|
||||
|
||||
with step('Check successful connection message for Failover JSON RPC URL input'):
|
||||
assert driver.waitFor(
|
||||
lambda: edit_network_form.get_failover_rpc_url_error_message_text() == WalletEditNetworkErrorMessages.PINGVERIFIED.value)
|
||||
|
||||
with step('Verify the acknowledgment checkbox is unchecked'):
|
||||
assert edit_network_form.check_acknowledgement_checkbox(False)
|
|
@ -0,0 +1,111 @@
|
|||
import allure
|
||||
import pytest
|
||||
from allure import step
|
||||
|
||||
from constants.wallet import WalletNetworkSettings, WalletNetworkNaming
|
||||
from gui.components.wallet.testnet_mode_banner import TestnetModeBanner
|
||||
from gui.components.wallet.wallet_toast_message import WalletToastMessage
|
||||
from gui.main_window import MainWindow
|
||||
|
||||
pytestmark = allure.suite("Wallet")
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703505', 'Network: Testnet switching')
|
||||
@pytest.mark.case(703505)
|
||||
def test_switch_testnet_mode(main_screen: MainWindow):
|
||||
with step('Verify that Testnet toggle has subtitle'):
|
||||
networks = main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_networks()
|
||||
subtitle = networks.get_testnet_toggle_subtitle()
|
||||
assert subtitle == WalletNetworkSettings.TESTNET_SUBTITLE.value, \
|
||||
f"Testnet title is incorrect, current subtitle is {subtitle}"
|
||||
|
||||
with step('Verify back to Wallet settings button is present and text on top is correct'):
|
||||
assert networks.is_back_to_wallet_settings_button_present(), \
|
||||
f"Back to Wallet settings button is not visible on Networks screen"
|
||||
|
||||
with step('Verify that Testnet mode toggle is turned off'):
|
||||
assert not networks.is_testnet_mode_toggle_checked(), f"Testnet toggle is on when it should not"
|
||||
|
||||
with step('Turn on Testnet mode'):
|
||||
networks.switch_testnet_mode_toggle().click_turn_on_testnet_mode_in_testnet_modal()
|
||||
|
||||
with step('Verify that Testnet mode turned on'):
|
||||
WalletToastMessage().get_toast_message(WalletNetworkSettings.TESTNET_ENABLED_TOAST_MESSAGE.value)
|
||||
TestnetModeBanner().wait_until_appears()
|
||||
assert networks.is_testnet_mode_toggle_checked(), f"Testnet toggle if off when it should not"
|
||||
|
||||
with step('Verify networks are switched to testnets'):
|
||||
assert networks.get_network_item_attribute_by_id_and_attr_name('title',
|
||||
WalletNetworkNaming.ETHEREUM_GOERLI_NETWORK_ID.value) == WalletNetworkNaming.LAYER1_ETHEREUM.value
|
||||
assert networks.get_network_item_attribute_by_id_and_attr_name('title',
|
||||
WalletNetworkNaming.OPTIMISM_GOERLI_NETWORK_ID.value) == WalletNetworkNaming.LAYER2_OPTIMISIM.value
|
||||
assert networks.get_network_item_attribute_by_id_and_attr_name('title',
|
||||
WalletNetworkNaming.ARBITRUM_GOERLI_NETWORK_ID.value) == WalletNetworkNaming.LAYER2_ARBITRUM.value
|
||||
# TODO: add verificatin for test net label
|
||||
|
||||
with step('Turn off Testnet mode in wallet settings'):
|
||||
networks.switch_testnet_mode_toggle().turn_off_testnet_mode_in_testnet_modal()
|
||||
|
||||
with step('Verify that Testnet mode turned off'):
|
||||
WalletToastMessage().get_toast_message(WalletNetworkSettings.TESTNET_DISABLED_TOAST_MESSAGE.value)
|
||||
TestnetModeBanner().wait_until_hidden()
|
||||
assert not networks.is_testnet_mode_toggle_checked(), f"Testnet toggle is on when it should not"
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703621',
|
||||
'Network: Enable testnet toggle and click cross button in confirmation')
|
||||
@pytest.mark.case(703621)
|
||||
def test_toggle_testnet_toggle_on_and_close_the_confirmation(main_screen: MainWindow):
|
||||
networks = main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_networks()
|
||||
|
||||
with step('Verify that Testnet mode toggle is turned off'):
|
||||
assert not networks.is_testnet_mode_toggle_checked(), f"Testnet toggle is enabled when it should not"
|
||||
|
||||
with step('Check Mainnet network item title'):
|
||||
networks.get_network_item_attribute_by_id_and_attr_name('title',
|
||||
WalletNetworkNaming.ETHEREUM_MAINNET_NETWORK_ID.value)
|
||||
|
||||
with step('Toggle the Testnet mode toggle ON'):
|
||||
testnet_modal = networks.switch_testnet_mode_toggle()
|
||||
|
||||
with step('Click cross button on the Testnet modal'):
|
||||
testnet_modal.close_testnet_modal_with_cross_button()
|
||||
assert not networks.is_testnet_mode_toggle_checked()
|
||||
|
||||
with step('Verify that Testnet mode is not turned off'):
|
||||
assert not WalletToastMessage().is_visible
|
||||
assert not TestnetModeBanner().is_visible, f"Testnet banner is present when it should not"
|
||||
assert not networks.is_testnet_mode_toggle_checked(), \
|
||||
f"Testnet toggle is turned on when it should not"
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703622',
|
||||
'Network: Network: Enable Testnets, toggle testnet toggle OFF, click cancel in confirmation')
|
||||
@pytest.mark.case(703621)
|
||||
# @pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/12247"), bug is now fixed
|
||||
def test_switch_testnet_off_by_toggle_and_cancel_in_confirmation(main_screen: MainWindow):
|
||||
networks = main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_networks()
|
||||
|
||||
with step('Verify that Testnet mode toggle is turned off'):
|
||||
assert not networks.is_testnet_mode_toggle_checked(), f"Testnet toggle is enabled when it should not"
|
||||
|
||||
with step('Toggle the Testnet mode toggle ON'):
|
||||
testnet_modal = networks.switch_testnet_mode_toggle()
|
||||
|
||||
with step('Confirm enabling testnet mode in testnet modal'):
|
||||
testnet_modal.click_turn_on_testnet_mode_in_testnet_modal()
|
||||
|
||||
with step('Verify testnet mode is enabled'):
|
||||
WalletToastMessage().get_toast_message(WalletNetworkSettings.TESTNET_ENABLED_TOAST_MESSAGE.value)
|
||||
TestnetModeBanner().wait_until_appears()
|
||||
assert networks.is_testnet_mode_toggle_checked(), f"testnet toggle is off"
|
||||
|
||||
with step('Toggle the Testnet mode toggle Off'):
|
||||
testnet_modal = networks.switch_testnet_mode_toggle()
|
||||
|
||||
with step('Click Cancel button on the Testnet modal'):
|
||||
testnet_modal.click_cancel_button_in_testnet_modal()
|
||||
assert networks.is_testnet_mode_toggle_checked(), f"Testnet toggle is turned OFF when it should not"
|
||||
|
||||
with step('Verify that Testnet mode is not turned off'):
|
||||
assert TestnetModeBanner().is_visible, f"Testnet banner is not present when it should"
|
|
@ -0,0 +1,17 @@
|
|||
import allure
|
||||
import pytest
|
||||
from allure_commons._allure import step
|
||||
|
||||
from gui.components.back_up_your_seed_phrase_banner import BackUpSeedPhraseBanner
|
||||
from gui.main_window import MainWindow
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703001','Backup seed phrase')
|
||||
@pytest.mark.case(703001)
|
||||
def test_back_up_seed_phrase(main_screen: MainWindow):
|
||||
with step('Open back up seed phrase in settings'):
|
||||
settings = main_screen.left_panel.open_settings()
|
||||
back_up = settings.left_panel.open_back_up_seed_phrase()
|
||||
back_up.back_up_seed_phrase()
|
||||
with step('Verify back up seed phrase banner disappeared'):
|
||||
assert not BackUpSeedPhraseBanner().is_visible, 'Secure your seed phrase banner visible'
|
|
@ -1,141 +0,0 @@
|
|||
import time
|
||||
|
||||
import allure
|
||||
import pytest
|
||||
from allure import step
|
||||
|
||||
import constants
|
||||
from constants.social_links import social_links
|
||||
from driver.aut import AUT
|
||||
from gui.components.back_up_your_seed_phrase_banner import BackUpSeedPhraseBanner
|
||||
from gui.components.settings.changes_detected_popup import ChangesDetectedToastMessage
|
||||
from gui.main_window import MainWindow
|
||||
|
||||
pytestmark = allure.suite("Settings")
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703007',
|
||||
'Change own display name in profile popup')
|
||||
@pytest.mark.case(703007)
|
||||
@pytest.mark.parametrize('user_account', [constants.user.user_account_one])
|
||||
@pytest.mark.parametrize('new_name', [pytest.param('NewUserName')])
|
||||
def test_change_own_display_name(main_screen: MainWindow, user_account, new_name):
|
||||
with step('Open own profile popup and check name of user is correct'):
|
||||
profile = main_screen.left_panel.open_user_canvas()
|
||||
profile_popup = profile.open_profile_popup()
|
||||
assert profile_popup.user_name == user_account.name
|
||||
|
||||
with step('Go to edit profile settings and change the name of the user'):
|
||||
profile_popup.edit_profile().set_name(new_name)
|
||||
|
||||
with step('Open own profile popup and check name of user is correct'):
|
||||
assert main_screen.left_panel.open_user_canvas().open_profile_popup().user_name == new_name
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703002', 'Switch state to offline')
|
||||
@pytest.mark.case(703002)
|
||||
def test_switch_states_between_offline_and_online(aut: AUT, main_screen: MainWindow, user_account):
|
||||
with (step('Open settings and switch state to offline')):
|
||||
settings = main_screen.left_panel
|
||||
settings.set_user_to_offline()
|
||||
|
||||
with step('Verify user appears offline'):
|
||||
assert settings.user_is_offline()
|
||||
|
||||
with step('Restart application'):
|
||||
aut.restart()
|
||||
main_screen.authorize_user(user_account)
|
||||
|
||||
with step('Verify user appears offline'):
|
||||
assert settings.user_is_offline()
|
||||
|
||||
with (step('Open settings and switch state to online')):
|
||||
settings = main_screen.left_panel
|
||||
settings.set_user_to_online()
|
||||
|
||||
with step('Restart application'):
|
||||
aut.restart()
|
||||
main_screen.authorize_user(user_account)
|
||||
|
||||
with step('Verify user appears online'):
|
||||
assert settings.user_is_online()
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703004', 'Switch state to automatic')
|
||||
@pytest.mark.case(703004)
|
||||
def test_switch_state_to_automatic(aut: AUT, main_screen: MainWindow, user_account):
|
||||
with step('Open settings and switch state to automatic'):
|
||||
settings = main_screen.left_panel
|
||||
settings.set_user_to_automatic()
|
||||
|
||||
with step('Verify user status set automatically to online'):
|
||||
assert settings.user_is_set_to_automatic()
|
||||
|
||||
with step('Restart application'):
|
||||
aut.restart()
|
||||
main_screen.authorize_user(user_account)
|
||||
|
||||
with step('Verify user status set automatically to online'):
|
||||
assert settings.user_is_set_to_automatic()
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703005',
|
||||
'Change the password and login with new password')
|
||||
@pytest.mark.case(703005)
|
||||
@pytest.mark.parametrize('user_account, user_account_new',
|
||||
[pytest.param(constants.user.user_account_one, constants.user.user_account_one_changed_name)])
|
||||
def test_change_password_and_login(aut: AUT, main_screen: MainWindow, user_account, user_account_new):
|
||||
with step('Open profile settings and change password'):
|
||||
main_screen.left_panel.open_settings().left_panel.open_profile_settings().open_change_password_popup().change_password(
|
||||
user_account.password, user_account_new.password)
|
||||
|
||||
with step('Restart application'):
|
||||
aut.restart()
|
||||
main_screen.authorize_user(user_account_new)
|
||||
|
||||
with step('Verify that the user logged in correctly'):
|
||||
user_canvas = main_screen.left_panel.open_user_canvas()
|
||||
profile_popup = user_canvas.open_profile_popup()
|
||||
assert profile_popup.user_name == user_account_new.name
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703001','Backup seed phrase')
|
||||
@pytest.mark.case(703001)
|
||||
def test_back_up_seed_phrase(main_screen: MainWindow):
|
||||
with step('Open back up seed phrase in settings'):
|
||||
settings = main_screen.left_panel.open_settings()
|
||||
back_up = settings.left_panel.open_back_up_seed_phrase()
|
||||
back_up.back_up_seed_phrase()
|
||||
with step('Verify back up seed phrase banner disappeared'):
|
||||
assert not BackUpSeedPhraseBanner().is_visible, 'Secure your seed phrase banner visible'
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703006',
|
||||
'Set display name, bio and social links')
|
||||
@pytest.mark.case(703006)
|
||||
@pytest.mark.parametrize('user_account, user_account_changed',
|
||||
[pytest.param(constants.user.user_account_one, constants.user.user_account_one_changed_name)])
|
||||
@pytest.mark.parametrize('bio, links', [pytest.param('This is my bio', constants.social_links.social_links)])
|
||||
def test_set_name_bio_social_links(main_screen: MainWindow, aut: AUT, user_account, user_account_changed, bio, links):
|
||||
with step('Open profile settings and check name, bio and links'):
|
||||
profile_settings = main_screen.left_panel.open_settings().left_panel.open_profile_settings()
|
||||
assert profile_settings.display_name == user_account.name
|
||||
assert profile_settings.bio == ''
|
||||
for value in profile_settings.social_links.values():
|
||||
assert value == ''
|
||||
|
||||
with step('Set new name, bio and links'):
|
||||
profile_settings.set_name(user_account_changed.name)
|
||||
profile_settings.bio = bio
|
||||
profile_settings.social_links = links
|
||||
ChangesDetectedToastMessage().save()
|
||||
|
||||
with step('Restart application'):
|
||||
aut.restart()
|
||||
main_screen.authorize_user(user_account_changed)
|
||||
|
||||
with step('Open profile settings and check new name, bio and links'):
|
||||
profile_settings = main_screen.left_panel.open_settings().left_panel.open_profile_settings()
|
||||
assert profile_settings.display_name == user_account_changed.name
|
||||
assert profile_settings.bio == bio
|
||||
profile_settings.verify_social_links(links)
|
|
@ -1,302 +0,0 @@
|
|||
import time
|
||||
|
||||
import allure
|
||||
import pytest
|
||||
from allure import step
|
||||
|
||||
import configs
|
||||
import constants
|
||||
import driver
|
||||
from constants.wallet import WalletNetworkSettings, WalletNetworkNaming, WalletNetworkDefaultValues, \
|
||||
WalletEditNetworkErrorMessages
|
||||
from gui.components.signing_phrase_popup import SigningPhrasePopup
|
||||
from gui.components.wallet.authenticate_popup import AuthenticatePopup
|
||||
from gui.components.wallet.testnet_mode_banner import TestnetModeBanner
|
||||
from gui.components.wallet.wallet_toast_message import WalletToastMessage
|
||||
from gui.main_window import MainWindow
|
||||
from scripts.tools import image
|
||||
|
||||
pytestmark = allure.suite("Wallet")
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703505', 'Network: Testnet switching')
|
||||
@pytest.mark.case(703505)
|
||||
def test_switch_testnet_mode(main_screen: MainWindow):
|
||||
with step('Verify that Testnet toggle has subtitle'):
|
||||
networks = main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_networks()
|
||||
subtitle = networks.get_testnet_toggle_subtitle()
|
||||
assert subtitle == WalletNetworkSettings.TESTNET_SUBTITLE.value, \
|
||||
f"Testnet title is incorrect, current subtitle is {subtitle}"
|
||||
|
||||
with step('Verify back to Wallet settings button is present and text on top is correct'):
|
||||
assert networks.is_back_to_wallet_settings_button_present(), \
|
||||
f"Back to Wallet settings button is not visible on Networks screen"
|
||||
|
||||
with step('Verify that Testnet mode toggle is turned off'):
|
||||
assert not networks.is_testnet_mode_toggle_checked(), f"Testnet toggle is on when it should not"
|
||||
|
||||
with step('Turn on Testnet mode'):
|
||||
networks.switch_testnet_mode_toggle().click_turn_on_testnet_mode_in_testnet_modal()
|
||||
|
||||
with step('Verify that Testnet mode turned on'):
|
||||
WalletToastMessage().get_toast_message(WalletNetworkSettings.TESTNET_ENABLED_TOAST_MESSAGE.value)
|
||||
TestnetModeBanner().wait_until_appears()
|
||||
assert networks.is_testnet_mode_toggle_checked(), f"Testnet toggle if off when it should not"
|
||||
|
||||
with step('Verify networks are switched to testnets'):
|
||||
assert networks.get_network_item_attribute_by_id_and_attr_name('title',
|
||||
WalletNetworkNaming.ETHEREUM_GOERLI_NETWORK_ID.value) == WalletNetworkNaming.LAYER1_ETHEREUM.value
|
||||
assert networks.get_network_item_attribute_by_id_and_attr_name('title',
|
||||
WalletNetworkNaming.OPTIMISM_GOERLI_NETWORK_ID.value) == WalletNetworkNaming.LAYER2_OPTIMISIM.value
|
||||
assert networks.get_network_item_attribute_by_id_and_attr_name('title',
|
||||
WalletNetworkNaming.ARBITRUM_GOERLI_NETWORK_ID.value) == WalletNetworkNaming.LAYER2_ARBITRUM.value
|
||||
# TODO: add verificatin for test net label
|
||||
|
||||
with step('Turn off Testnet mode in wallet settings'):
|
||||
networks.switch_testnet_mode_toggle().turn_off_testnet_mode_in_testnet_modal()
|
||||
|
||||
with step('Verify that Testnet mode turned off'):
|
||||
WalletToastMessage().get_toast_message(WalletNetworkSettings.TESTNET_DISABLED_TOAST_MESSAGE.value)
|
||||
TestnetModeBanner().wait_until_hidden()
|
||||
assert not networks.is_testnet_mode_toggle_checked(), f"Testnet toggle is on when it should not"
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703621',
|
||||
'Network: Enable testnet toggle and click cross button in confirmation')
|
||||
@pytest.mark.case(703621)
|
||||
def test_toggle_testnet_toggle_on_and_close_the_confirmation(main_screen: MainWindow):
|
||||
networks = main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_networks()
|
||||
|
||||
with step('Verify that Testnet mode toggle is turned off'):
|
||||
assert not networks.is_testnet_mode_toggle_checked(), f"Testnet toggle is enabled when it should not"
|
||||
|
||||
with step('Check Mainnet network item title'):
|
||||
networks.get_network_item_attribute_by_id_and_attr_name('title',
|
||||
WalletNetworkNaming.ETHEREUM_MAINNET_NETWORK_ID.value)
|
||||
|
||||
with step('Toggle the Testnet mode toggle ON'):
|
||||
testnet_modal = networks.switch_testnet_mode_toggle()
|
||||
|
||||
with step('Click cross button on the Testnet modal'):
|
||||
testnet_modal.close_testnet_modal_with_cross_button()
|
||||
assert not networks.is_testnet_mode_toggle_checked()
|
||||
|
||||
with step('Verify that Testnet mode is not turned off'):
|
||||
assert not WalletToastMessage().is_visible
|
||||
assert not TestnetModeBanner().is_visible, f"Testnet banner is present when it should not"
|
||||
assert not networks.is_testnet_mode_toggle_checked(), \
|
||||
f"Testnet toggle is turned on when it should not"
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703622',
|
||||
'Network: Network: Enable Testnets, toggle testnet toggle OFF, click cancel in confirmation')
|
||||
@pytest.mark.case(703621)
|
||||
# @pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/12247"), bug is now fixed
|
||||
def test_switch_testnet_off_by_toggle_and_cancel_in_confirmation(main_screen: MainWindow):
|
||||
networks = main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_networks()
|
||||
|
||||
with step('Verify that Testnet mode toggle is turned off'):
|
||||
assert not networks.is_testnet_mode_toggle_checked(), f"Testnet toggle is enabled when it should not"
|
||||
|
||||
with step('Toggle the Testnet mode toggle ON'):
|
||||
testnet_modal = networks.switch_testnet_mode_toggle()
|
||||
|
||||
with step('Confirm enabling testnet mode in testnet modal'):
|
||||
testnet_modal.click_turn_on_testnet_mode_in_testnet_modal()
|
||||
|
||||
with step('Verify testnet mode is enabled'):
|
||||
WalletToastMessage().get_toast_message(WalletNetworkSettings.TESTNET_ENABLED_TOAST_MESSAGE.value)
|
||||
TestnetModeBanner().wait_until_appears()
|
||||
assert networks.is_testnet_mode_toggle_checked(), f"testnet toggle is off"
|
||||
|
||||
with step('Toggle the Testnet mode toggle Off'):
|
||||
testnet_modal = networks.switch_testnet_mode_toggle()
|
||||
|
||||
with step('Click Cancel button on the Testnet modal'):
|
||||
testnet_modal.click_cancel_button_in_testnet_modal()
|
||||
assert networks.is_testnet_mode_toggle_checked(), f"Testnet toggle is turned OFF when it should not"
|
||||
|
||||
with step('Verify that Testnet mode is not turned off'):
|
||||
assert TestnetModeBanner().is_visible, f"Testnet banner is not present when it should"
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703515',
|
||||
'Network: Network: Editing network -> Restore defaults')
|
||||
@pytest.mark.case(703515)
|
||||
def test_settings_networks_edit_restore_defaults(main_screen: MainWindow):
|
||||
networks = main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_networks()
|
||||
|
||||
with step('Check network items titles'):
|
||||
assert networks.get_network_item_attribute_by_id_and_attr_name('title',
|
||||
WalletNetworkNaming.ETHEREUM_MAINNET_NETWORK_ID.value) == WalletNetworkNaming.LAYER1_ETHEREUM.value
|
||||
assert networks.get_network_item_attribute_by_id_and_attr_name('title',
|
||||
WalletNetworkNaming.OPTIMISM_MAINNET_NETWORK_ID.value) == WalletNetworkNaming.LAYER2_OPTIMISIM.value
|
||||
assert networks.get_network_item_attribute_by_id_and_attr_name('title',
|
||||
WalletNetworkNaming.ARBITRUM_MAINNET_NETWORK_ID.value) == WalletNetworkNaming.LAYER2_ARBITRUM.value
|
||||
|
||||
with step('Open Ethereum Mainnet network item to edit'):
|
||||
edit_network_form = networks.click_network_item_to_open_edit_view(
|
||||
WalletNetworkNaming.ETHEREUM_MAINNET_NETWORK_ID.value)
|
||||
|
||||
with step('Check the elements on the form'):
|
||||
edit_network_form.wait_until_appears().check_available_elements_on_edit_view()
|
||||
|
||||
with step('Click in Main JSON RPC URL and paste incorrect URL'):
|
||||
edit_network_form.edit_network_main_json_rpc_url_input("https://eth-archival.gateway.pokt.network/v1/lb/")
|
||||
|
||||
# with step('Check error message'):
|
||||
# assert edit_network_form._network_edit_error_message() == 'test'
|
||||
|
||||
with step('Click in Failover JSON RPC URL and paste incorrect URL'):
|
||||
edit_network_form.edit_network_failover_json_rpc_url_input("https://eth-archival.gateway.pokt.network/v1/lb/")
|
||||
|
||||
with step('Check error message for Failover JSON RPC URL input'):
|
||||
assert driver.waitFor(
|
||||
lambda: edit_network_form.get_failover_rpc_url_error_message_text() == WalletEditNetworkErrorMessages.PINGUNSUCCESSFUL.value)
|
||||
|
||||
with step('Check the acknowledgment checkbox'):
|
||||
edit_network_form.check_acknowledgement_checkbox(True)
|
||||
|
||||
with step('Check the acknowledgment text'):
|
||||
assert edit_network_form.get_acknowledgement_checkbox_text(
|
||||
'text') == WalletNetworkSettings.ACKNOWLEDGMENT_CHECKBOX_TEXT.value
|
||||
|
||||
with step('Click Revert to default button and restore values'):
|
||||
edit_network_form.revert_to_default()
|
||||
|
||||
with step('Check value in Main JSON RPC URL input'):
|
||||
assert edit_network_form.get_edit_network_main_json_rpc_url_value() == WalletNetworkDefaultValues.ETHEREUM_LIVE_MAIN.value
|
||||
|
||||
with step('Check successful connection message for Main JSON RPC URL input'):
|
||||
assert driver.waitFor(
|
||||
lambda: edit_network_form.get_main_rpc_url_error_message_text() == WalletEditNetworkErrorMessages.PINGVERIFIED.value)
|
||||
|
||||
with (step('Check value in Failover JSON RPC URL input')):
|
||||
assert edit_network_form.get_edit_network_failover_json_rpc_url_value() == WalletNetworkDefaultValues.ETHEREUM_LIVE_FAILOVER.value
|
||||
|
||||
with step('Check successful connection message for Failover JSON RPC URL input'):
|
||||
assert driver.waitFor(
|
||||
lambda: edit_network_form.get_failover_rpc_url_error_message_text() == WalletEditNetworkErrorMessages.PINGVERIFIED.value)
|
||||
|
||||
with step('Verify the acknowledgment checkbox is unchecked'):
|
||||
assert edit_network_form.check_acknowledgement_checkbox(False)
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703415',
|
||||
'Account order: account order could be changed with drag&drop')
|
||||
@pytest.mark.case(703415)
|
||||
@pytest.mark.parametrize('address, default_name, name, color, emoji, second_name, second_color, second_emoji', [
|
||||
pytest.param('0xea123F7beFF45E3C9fdF54B324c29DBdA14a639A', 'Status account',
|
||||
'WatchOnly', '#2a4af5', 'sunglasses', 'Generated', '#216266', 'thumbsup')
|
||||
])
|
||||
def test_change_account_order_by_drag_and_drop(main_screen: MainWindow, user_account, address: str, default_name,
|
||||
name: str, color: str, emoji: str, second_name: str, second_color: str,
|
||||
second_emoji: str):
|
||||
with step('Create watch-only wallet account'):
|
||||
wallet = main_screen.left_panel.open_wallet()
|
||||
SigningPhrasePopup().wait_until_appears().confirm_phrase()
|
||||
account_popup = wallet.left_panel.open_add_account_popup()
|
||||
account_popup.set_name(name).set_emoji(emoji).set_color(color).set_origin_eth_address(address).save()
|
||||
account_popup.wait_until_hidden()
|
||||
|
||||
with step('Create generated wallet account'):
|
||||
account_popup = wallet.left_panel.open_add_account_popup()
|
||||
account_popup.set_name(second_name).set_emoji(second_emoji).set_color(second_color).save()
|
||||
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
|
||||
account_popup.wait_until_hidden()
|
||||
|
||||
with step('Verify accounts in wallet settings'):
|
||||
account_order = main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_account_order()
|
||||
with step('Account order is correct'):
|
||||
assert account_order.accounts[0].name == default_name
|
||||
assert account_order.accounts[1].name == name
|
||||
assert account_order.accounts[2].name == second_name
|
||||
with step('Eye icon is displayed on watch-only account'):
|
||||
account_order.get_eye_icon(name)
|
||||
with step('Icons on accounts are correct'):
|
||||
image.compare(account_order.accounts[1].icon, 'watch_only_account_icon.png')
|
||||
image.compare(account_order.accounts[2].icon, 'generated_account_icon.png')
|
||||
|
||||
with step('Drag first account to the end of the list'):
|
||||
account_order.drag_account(default_name, 2)
|
||||
|
||||
with step('Verify the account order'):
|
||||
with step('Account order is correct in wallet settings'):
|
||||
assert driver.waitFor(lambda: account_order.accounts[0].name == name)
|
||||
assert driver.waitFor(lambda: account_order.accounts[1].name == second_name)
|
||||
assert driver.waitFor(lambda: account_order.accounts[2].name == default_name)
|
||||
with step('Account order is correct in wallet'):
|
||||
wallet = main_screen.left_panel.open_wallet()
|
||||
assert driver.waitFor(lambda: wallet.left_panel.accounts[0].name == name)
|
||||
assert driver.waitFor(lambda: wallet.left_panel.accounts[1].name == second_name)
|
||||
assert driver.waitFor(lambda: wallet.left_panel.accounts[2].name == default_name)
|
||||
|
||||
with step('Drag second account to the top of the list'):
|
||||
account_order = main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_account_order()
|
||||
account_order.drag_account(second_name, 0)
|
||||
|
||||
with step('Verify the account order'):
|
||||
with step('Account order is correct in wallet settings'):
|
||||
assert driver.waitFor(lambda: account_order.accounts[0].name == second_name)
|
||||
assert driver.waitFor(lambda: account_order.accounts[1].name == name)
|
||||
assert driver.waitFor(lambda: account_order.accounts[2].name == default_name)
|
||||
with step('Account order is correct in wallet'):
|
||||
wallet = main_screen.left_panel.open_wallet()
|
||||
assert driver.waitFor(lambda: wallet.left_panel.accounts[0].name == second_name)
|
||||
assert driver.waitFor(lambda: wallet.left_panel.accounts[1].name == name)
|
||||
assert driver.waitFor(lambda: wallet.left_panel.accounts[2].name == default_name)
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/edit/703416',
|
||||
'Account order: reordering is not possible having a single account')
|
||||
@pytest.mark.case(703416)
|
||||
@pytest.mark.parametrize('default_name, text_on_top', [
|
||||
pytest.param('Status account', 'This account looks a little lonely. Add another account'
|
||||
' to enable re-ordering.')
|
||||
])
|
||||
def test_change_account_order_not_possible(main_screen: MainWindow, default_name: str, text_on_top: str):
|
||||
with step('Open edit account order view'):
|
||||
account_order = main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_account_order()
|
||||
|
||||
with step('Verify that only default account displayed'):
|
||||
assert len(account_order.accounts) == 1
|
||||
assert account_order.accounts[0].name == default_name
|
||||
|
||||
with step('Back button is present and text on top is correct'):
|
||||
assert account_order.account_recommendations[0] == text_on_top
|
||||
assert account_order.is_back_button_present() is True
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/edit/703598',
|
||||
'Add new account from wallet settings screen')
|
||||
@pytest.mark.case(703598)
|
||||
@pytest.mark.parametrize('user_account', [constants.user.user_account_one])
|
||||
@pytest.mark.parametrize('name, color, emoji, emoji_unicode, '
|
||||
'new_name, new_color, new_emoji, new_emoji_unicode', [
|
||||
pytest.param('GenAcc1', '#2a4af5', 'sunglasses', '1f60e',
|
||||
'GenAcc1edited', '#216266', 'thumbsup', '1f44d')
|
||||
])
|
||||
def test_add_new_account_from_wallet_settings(main_screen: MainWindow, user_account,
|
||||
color: str, emoji: str, emoji_unicode: str,
|
||||
name: str, new_name: str, new_color: str, new_emoji: str,
|
||||
new_emoji_unicode: str):
|
||||
with step('Open add account pop up from wallet settings'):
|
||||
add_account_popup = \
|
||||
main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_add_account_pop_up()
|
||||
|
||||
with step('Add a new generated account from wallet settings screen'):
|
||||
|
||||
add_account_popup.set_name(name).set_emoji(emoji).set_color(color).save()
|
||||
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
|
||||
add_account_popup.wait_until_hidden()
|
||||
|
||||
with step('Verify that the account is correctly displayed in accounts list'):
|
||||
|
||||
wallet = main_screen.left_panel.open_wallet()
|
||||
SigningPhrasePopup().wait_until_appears().confirm_phrase()
|
||||
expected_account = constants.user.account_list_item(name, color.lower(), emoji_unicode)
|
||||
started_at = time.monotonic()
|
||||
while expected_account not in wallet.left_panel.accounts:
|
||||
time.sleep(1)
|
||||
if time.monotonic() - started_at > 15:
|
||||
raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}')
|