diff --git a/test/e2e/configs/squish.py b/test/e2e/configs/squish.py index 32c7ccd630..3e542f705d 100644 --- a/test/e2e/configs/squish.py +++ b/test/e2e/configs/squish.py @@ -1,2 +1,2 @@ AUT_PORT = 61500 -MLT_AUT_PORT = 61600 +MAX_INSTANCES = 3 diff --git a/test/e2e/conftest.py b/test/e2e/conftest.py index ea008885d4..86ae3b9286 100644 --- a/test/e2e/conftest.py +++ b/test/e2e/conftest.py @@ -34,7 +34,8 @@ def setup_session_scope( def setup_function_scope( caplog, generate_test_data, - check_result + check_result, + application_logs ): caplog.set_level(configs.LOG_LEVEL) yield @@ -62,7 +63,9 @@ def pytest_exception_interact(node): body=screenshot.read_bytes(), attachment_type=allure.attachment_type.PNG) driver.context.detach() - for port in [configs.squish.AUT_PORT, configs.squish.MLT_AUT_PORT]: + # The maximum count of multiple instances in tests now is 3 + max_instances = configs.squish.MAX_INSTANCES + for port in range(configs.squish.AUT_PORT, configs.squish.AUT_PORT + (max_instances * 1000), 1000): pid = local_system.find_process_by_port(port) if pid is not None: local_system.kill_process(pid, verify=True) diff --git a/test/e2e/fixtures/aut.py b/test/e2e/fixtures/aut.py index b759c05e7b..d55506c656 100644 --- a/test/e2e/fixtures/aut.py +++ b/test/e2e/fixtures/aut.py @@ -1,3 +1,4 @@ +import allure import pytest import configs @@ -8,6 +9,14 @@ from gui.main_window import MainWindow from scripts.utils import system_path from scripts.utils.system_path import SystemPath +@pytest.fixture +def application_logs(): + yield + for app_data in configs.testpath.STATUS_DATA.iterdir(): + for log in (app_data / 'logs').iterdir(): + allure.attach.file(log, name=str(log.name), attachment_type=allure.attachment_type.TEXT) + log.unlink() + @pytest.fixture def user_data(request) -> system_path.SystemPath: