diff --git a/test/e2e/constants/aut_options.py b/test/e2e/constants/aut_options.py new file mode 100644 index 0000000000..3f61c73857 --- /dev/null +++ b/test/e2e/constants/aut_options.py @@ -0,0 +1 @@ +MOCK_KEYCARD = '--test-mode=1' diff --git a/test/e2e/driver/aut.py b/test/e2e/driver/aut.py index 9f03834503..fde728a194 100644 --- a/test/e2e/driver/aut.py +++ b/test/e2e/driver/aut.py @@ -31,6 +31,7 @@ class AUT: self.app_data = configs.testpath.STATUS_DATA / f'app_{datetime.now():%H%M%S_%f}' if user_data is not None: user_data.copy_to(self.app_data / 'data') + self.options = '' driver.testSettings.setWrappersForApplication(self.aut_id, ['Qt']) def __str__(self): @@ -76,7 +77,8 @@ class AUT: self.pid = None @allure.step("Start application") - def launch(self, attempt: int = 2) -> 'AUT': + def launch(self, options='', attempt: int = 2) -> 'AUT': + self.options = options try: self.port = local_system.find_free_port(configs.squish.AUT_PORT, 1000) if configs.ATTACH_MODE: @@ -85,7 +87,8 @@ class AUT: configs.testpath.SQUISH_DIR / 'bin' / 'startaut', f'--port={self.port}', f'"{self.path}"', - f'-d={self.app_data}' + f'-d={self.app_data}', + options ] self.pid = local_system.execute(command) else: @@ -101,7 +104,7 @@ class AUT: _logger.debug(err) self.stop() if attempt: - return self.launch(attempt-1) + return self.launch(options, attempt - 1) else: raise err diff --git a/test/e2e/fixtures/aut.py b/test/e2e/fixtures/aut.py index e7fdaac881..8b84a67e8f 100644 --- a/test/e2e/fixtures/aut.py +++ b/test/e2e/fixtures/aut.py @@ -10,6 +10,13 @@ from scripts.utils import system_path from scripts.utils.system_path import SystemPath +@pytest.fixture +def options(request): + if hasattr(request, 'param'): + return request.param + return '' + + @pytest.fixture def application_logs(): yield @@ -47,8 +54,8 @@ def multiple_instance(): @pytest.fixture -def main_window(aut: AUT, user_data): - aut.launch() +def main_window(aut: AUT, user_data, options): + aut.launch(options) yield MainWindow().wait_until_appears().prepare() aut.stop() diff --git a/test/e2e/gui/elements/button.py b/test/e2e/gui/elements/button.py index 56d81957fe..376670b1e8 100644 --- a/test/e2e/gui/elements/button.py +++ b/test/e2e/gui/elements/button.py @@ -20,6 +20,6 @@ class Button(QObject): ): if None not in (x, y, button): getattr(self.object, 'clicked')() + _logger.info(f'{self}: clicked') else: super(Button, self).click(x, y, button) - _logger.info(f'{self}: clicked') diff --git a/test/e2e/tests/settings/settings_keycard/test_create_keycard_account_with_new_seed_phrase.py b/test/e2e/tests/settings/settings_keycard/test_create_keycard_account_with_new_seed_phrase.py index b2561ea20a..d903cf10e9 100644 --- a/test/e2e/tests/settings/settings_keycard/test_create_keycard_account_with_new_seed_phrase.py +++ b/test/e2e/tests/settings/settings_keycard/test_create_keycard_account_with_new_seed_phrase.py @@ -4,7 +4,7 @@ from allure import step import configs import driver -from constants import ColorCodes +from constants import ColorCodes, aut_options from constants.keycard import Keycard from gui.main_window import MainWindow from gui.mocked_keycard_controller import MockedKeycardController