Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make tests running for dev build and update marks #16027

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion test/e2e/configs/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ def get_platform():


DISPLAY = os.getenv('DISPLAY', ':0')

TEST_MODE = os.getenv('STATUS_RUNTIME_TEST_MODE')

1 change: 0 additions & 1 deletion test/e2e/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
from datetime import datetime

import os
import allure
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def sign_up(self, user_account: UserAccount = constants.user.user_account_one):
if configs.system.get_platform() == "Darwin":
AllowNotificationsView().start_using_status()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE:
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()
if share_updates_popup.exists:
share_updates_popup.skip()
Expand All @@ -201,7 +201,7 @@ def log_in(self, user_account: UserAccount):
share_updates_popup = ShareUsageDataPopup()
LoginView().log_in(user_account)
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE:
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()
if share_updates_popup.exists:
share_updates_popup.skip()
Expand Down
23 changes: 1 addition & 22 deletions test/e2e/gui/screens/settings.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import time

import allure

import configs.system
import driver
from gui.components.back_up_your_seed_phrase_popup import BackUpYourSeedPhrasePopUp
from gui.elements.object import QObject
from gui.elements.scroll import Scroll
Expand All @@ -18,26 +15,8 @@
from gui.screens.settings_wallet import WalletSettingsView
from gui.screens.settings_password import ChangePasswordView
from gui.components.settings.sign_out_popup import SignOutPopup
from functools import wraps


def handle_settings_opening(view_class, menu_item):
def open_settings_decorator(func):
@wraps(func)
def wrapper(self, click_attempts=2):
self._open_settings(menu_item)
try:
return func(self)
except (LookupError, AssertionError) as ex:
if click_attempts:

return func(self, click_attempts - 1)
else:
raise ex

return wrapper

return open_settings_decorator
from scripts.utils.decorators import handle_settings_opening


class LeftPanel(QObject):
Expand Down
22 changes: 22 additions & 0 deletions test/e2e/scripts/utils/decorators.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from functools import wraps


def close_exists(element):
def _wrapper(method_to_decorate):
def wrapper(*args, **kwargs):
Expand All @@ -8,3 +11,22 @@ def wrapper(*args, **kwargs):
return wrapper

return _wrapper


def handle_settings_opening(view_class, menu_item):
def open_settings_decorator(func):
@wraps(func)
def wrapper(self, click_attempts=2):
self._open_settings(menu_item)
try:
return func(self)
except (LookupError, AssertionError) as ex:
if click_attempts:

return func(self, click_attempts - 1)
else:
raise ex

return wrapper

return open_settings_decorator
3 changes: 1 addition & 2 deletions test/e2e/tests/communities/test_communities.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_create_community(user_account, main_screen: MainWindow, params):

@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703057', 'Edit community')
@pytest.mark.case(703057)
# @pytest.mark.critical TODO: fix creation of community https://github.com/status-im/desktop-qa-automation/issues/658
@pytest.mark.critical
@pytest.mark.parametrize('params', [
{
'name': 'Updated Name',
Expand Down Expand Up @@ -245,7 +245,6 @@ def test_community_admin_ban_kick_member_and_delete_message(multiple_instances,
10000), 'Join community button not hidden'
main_screen.hide()


with step(f'User {user_two.name}, kick {user_one.name} from the community'):
aut_two.attach()
main_screen.prepare()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'second_channel_description, second_channel_emoji',
[pytest.param('Category in general', True, 'Channel', 'Description', 'sunglasses', 'Second-channel',
'Description', 'sunglasses')])
@pytest.mark.critical
def test_create_edit_remove_community_category(main_screen: MainWindow, category_name, general_checkbox, channel_name,
channel_description, channel_emoji, second_channel_name, second_channel_description,
second_channel_emoji):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_mint_owner_token(keys_screen, main_window, user_account):
if configs.system.get_platform() == "Darwin":
next_view.start_using_status()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE:
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()

with step('Enable creation of community option'):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ def test_add_edit_and_remove_permissions(main_screen: MainWindow, params):


@pytest.mark.parametrize('params', [constants.community_params])
@pytest.mark.critical
def test_add_5_member_role_permissions(main_screen: MainWindow, params):
with step('Enable creation of community option'):
settings = main_screen.left_panel.open_settings()
Expand Down
1 change: 1 addition & 0 deletions test/e2e/tests/messages/test_messaging_1x1_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703087', '1-1 Chat')
@pytest.mark.case(703087)
@pytest.mark.critical
def test_1x1_chat(multiple_instances):
user_one: UserAccount = constants.user_with_random_attributes_1
user_two: UserAccount = constants.user_with_random_attributes_2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def keys_screen(main_window) -> KeysView:
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703421', 'Generate new keys')
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703010', 'Settings - Sign out & Quit')
@pytest.mark.case(703421, 703010)
@pytest.mark.critical # TODO 'https://github.com/status-im/status-desktop/issues/13013'
@pytest.mark.critical # TODO 'https://github.com/status-im/status-desktop/issues/13013'
@pytest.mark.parametrize('user_name, password, user_image, zoom, shift', [
pytest.param(
''.join((random.choice(
Expand Down Expand Up @@ -100,7 +100,7 @@ def test_generate_new_keys_sign_out_from_settings(aut, main_window, keys_screen,
if configs.system.get_platform() == "Darwin":
next_view.start_using_status()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE:
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()

with step('Verify that user avatar background color'):
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/tests/onboarding/test_onboarding_import_seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_import_seed_phrase(keys_screen, main_window, aut: AUT, user_account, de
if configs.system.get_platform() == "Darwin":
next_view.start_using_status()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE:
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()

with (step('Verify that restored account reveals correct status wallet address')):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_login_with_wrong_password(aut: AUT, keys_screen, main_window, error: st
if configs.system.get_platform() == "Darwin":
next_view.start_using_status()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE:
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()

with step('Verify that the user logged in correctly'):
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/tests/onboarding/test_onboarding_syncing.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_sync_device_during_onboarding(multiple_instances):
if configs.system.get_platform() == "Darwin":
AllowNotificationsView().start_using_status()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE:
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()

with step('Verify user details are the same with user in first instance'):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_switch_testnet_mode(main_screen: MainWindow):
message = main_screen.wait_for_notification()[0]
assert message == WalletNetworkSettings.TESTNET_ENABLED_TOAST_MESSAGE.value, \
f"Toast message is incorrect, current message is {message}"
if not configs.system.TEST_MODE:
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
TestnetModeBanner().wait_until_appears()
assert networks.is_testnet_mode_toggle_checked(), f"Testnet toggle if off when it should not"

Expand All @@ -56,7 +56,7 @@ def test_switch_testnet_mode(main_screen: MainWindow):
message = main_screen.wait_for_notification()[1]
assert message == WalletNetworkSettings.TESTNET_DISABLED_TOAST_MESSAGE.value, \
f"Toast message is incorrect, current message is {message}"
if not configs.system.TEST_MODE:
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
TestnetModeBanner().wait_until_hidden()
assert not networks.is_testnet_mode_toggle_checked(), f"Testnet toggle is on when it should not"

Expand All @@ -83,7 +83,7 @@ def test_toggle_testnet_toggle_on_and_close_the_confirmation(main_screen: MainWi

with step('Verify that Testnet mode is not turned off'):
assert not ToastMessage().is_visible
if not configs.system.TEST_MODE:
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
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"
Expand All @@ -110,7 +110,7 @@ def test_switch_testnet_off_by_toggle_and_cancel_in_confirmation(main_screen: Ma
message = main_screen.wait_for_notification()[0]
assert message == WalletNetworkSettings.TESTNET_ENABLED_TOAST_MESSAGE.value, \
f"Toast message is incorrect, current message is {message}"
if not configs.system.TEST_MODE:
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
assert TestnetModeBanner().wait_until_appears(), f"Testnet banner is not present when it should"

assert networks.is_testnet_mode_toggle_checked(), f"testnet toggle is off"
Expand All @@ -123,5 +123,5 @@ def test_switch_testnet_off_by_toggle_and_cancel_in_confirmation(main_screen: Ma
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'):
if not configs.system.TEST_MODE:
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
assert TestnetModeBanner().wait_until_appears(), f"Testnet banner is not present when it should"
2 changes: 1 addition & 1 deletion test/e2e/tests/settings/test_ens_name_purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_ens_name_purchase(keys_screen, main_window, user_account, ens_name):
if configs.system.get_platform() == "Darwin":
next_view.start_using_status()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE:
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()

with step('Set testnet mode'):
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/tests/settings/test_settings_back_up_seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_back_up_seed_phrase(main_screen: MainWindow):
settings = main_screen.left_panel.open_settings()
assert driver.waitFor(lambda: settings.left_panel.settings_section_back_up_seed_option.wait_until_appears,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), f"Back up seed option is not present"
if not configs.system.TEST_MODE:
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
assert BackUpSeedPhraseBanner().does_back_up_seed_banner_exist(), "Back up seed banner is not present"
assert BackUpSeedPhraseBanner().is_back_up_now_button_present(), 'Back up now button is not present'

Expand All @@ -30,6 +30,6 @@ def test_back_up_seed_phrase(main_screen: MainWindow):

with step('Verify back up seed phrase banner disappeared'):
assert not settings.left_panel.settings_section_back_up_seed_option.exists, f"Back up seed option is present"
if not configs.system.TEST_MODE:
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BackUpSeedPhraseBanner().wait_to_hide_the_banner()
assert not BackUpSeedPhraseBanner().does_back_up_seed_banner_exist(), "Back up seed banner is present"
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_wallet_send_0_eth(keys_screen, main_window, user_account, receiver_acco
if configs.system.get_platform() == "Darwin":
next_view.start_using_status()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE:
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()

with step('Verify that restored account reveals correct status wallet address'):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_wallet_send_nft(keys_screen, main_window, user_account, tab, receiver_a
if configs.system.get_platform() == "Darwin":
next_view.start_using_status()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE:
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()

with step('Set testnet mode'):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
pytestmark = marks


@pytest.mark.critical
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703100',
'Manage a watch-only account from context menu option')
@pytest.mark.case(703100)
Expand Down