diff --git a/vizro-ai/hatch.toml b/vizro-ai/hatch.toml index a235665a8..8cce7f369 100644 --- a/vizro-ai/hatch.toml +++ b/vizro-ai/hatch.toml @@ -48,6 +48,7 @@ prep-release = [ ] pypath = "hatch run python -c 'import sys; print(sys.executable)'" test = "pytest tests {args}" +test-e2e-vizro-ai-ui = "pytest -vs --reruns 1 tests/e2e/test_vizro_ai_ui.py --headless {args}" test-integration = "pytest -vs --reruns 1 tests/integration --headless {args}" test-score = "pytest -vs --reruns 1 tests/score --headless {args}" test-unit = "pytest tests/unit {args}" @@ -56,7 +57,6 @@ test-unit-coverage = [ "- coverage combine", "coverage report" ] -test-e2e-vizro-ai-ui = "pytest -vs --reruns 1 tests/e2e/test_vizro_ai_ui.py --headless {args}" vizro-ai-ui = "python examples/dashboard_ui/app.py &" [envs.docs] diff --git a/vizro-ai/tests/e2e/conftest.py b/vizro-ai/tests/e2e/conftest.py index dc5c09cf5..5675e704d 100644 --- a/vizro-ai/tests/e2e/conftest.py +++ b/vizro-ai/tests/e2e/conftest.py @@ -1,9 +1,9 @@ from datetime import datetime import pytest +from e2e_asserts import browser_console_warnings_checker from selenium import webdriver from selenium.webdriver.chrome.options import Options -from e2e_asserts import browser_console_warnings_checker @pytest.fixture() diff --git a/vizro-ai/tests/e2e/test_vizro_ai_ui.py b/vizro-ai/tests/e2e/test_vizro_ai_ui.py index 7bf3d2428..5e71dd5f4 100644 --- a/vizro-ai/tests/e2e/test_vizro_ai_ui.py +++ b/vizro-ai/tests/e2e/test_vizro_ai_ui.py @@ -1,13 +1,13 @@ import os import pytest -from selenium.common import InvalidSelectorException, TimeoutException from e2e_waiters import ( wait_for, webdriver_click_waiter, webdriver_waiter, webdriver_waiter_css, ) +from selenium.common import InvalidSelectorException, TimeoutException @pytest.mark.filterwarnings("ignore:HTTPResponse.getheader():DeprecationWarning") diff --git a/vizro-ai/tests/tests_utils/e2e_asserts.py b/vizro-ai/tests/tests_utils/e2e_asserts.py index 59decd628..7896479e7 100644 --- a/vizro-ai/tests/tests_utils/e2e_asserts.py +++ b/vizro-ai/tests/tests_utils/e2e_asserts.py @@ -1,4 +1,3 @@ -from hamcrest import any_of, assert_that, contains_string from e2e_constants import ( INVALID_PROP_ERROR, REACT_NOT_RECOGNIZE_ERROR, @@ -10,6 +9,7 @@ WILLMOUNT_RENAMED_WARNING, WILLRECEIVEPROPS_RENAMED_WARNING, ) +from hamcrest import any_of, assert_that, contains_string def browser_console_warnings_checker(log_level, log_levels): diff --git a/vizro-ai/tests/tests_utils/e2e_waiters.py b/vizro-ai/tests/tests_utils/e2e_waiters.py index d8ceda468..f75b79cc2 100644 --- a/vizro-ai/tests/tests_utils/e2e_waiters.py +++ b/vizro-ai/tests/tests_utils/e2e_waiters.py @@ -1,12 +1,12 @@ import time +from e2e_constants import TIMEOUT from selenium.common.exceptions import ( StaleElementReferenceException, ) from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions from selenium.webdriver.support.wait import WebDriverWait -from e2e_constants import TIMEOUT def wait_for(condition_function, *args):