diff --git a/.github/workflows/reusable-tests.yml b/.github/workflows/reusable-tests.yml index 3e813274..0fd6cb02 100644 --- a/.github/workflows/reusable-tests.yml +++ b/.github/workflows/reusable-tests.yml @@ -111,10 +111,10 @@ jobs: # https://github.com/marketplace/actions/setup-chromedriver uses: nanasess/setup-chromedriver@v2.2.2 - - name: Run selenium tests + - name: Run integration tests id: slow-tests if: steps.fast-tests.outcome == 'success' - run: TESTING=True poetry run pytest tests/selenium --axe-version 4.9.1 --chromedriver-path /usr/local/bin/chromedriver + run: TESTING=True poetry run pytest tests/integration --axe-version 4.9.1 --chromedriver-path /usr/local/bin/chromedriver javascript-only-tests: name: Javascript tests diff --git a/Makefile b/Makefile index b25b7ea4..022b2a0a 100644 --- a/Makefile +++ b/Makefile @@ -68,10 +68,10 @@ unit: poetry run pytest --cov -m 'not slow' npm test -# run selenium test - version works with chromedriver 127.0.1 use - `npm install -g chromedriver@127.0.1` +# Run integration tests. Requires chromedriver - version works with chromedriver 127.0.1 use - `npm install -g chromedriver@127.0.1` integration: export CHROMEDRIVER_PATH=$(which chromedriver) - poetry run pytest tests/selenium --axe-version 4.9.1 --chromedriver-path ${CHROMEDRIVER_PATH} + poetry run pytest tests/integration --axe-version 4.9.1 --chromedriver-path ${CHROMEDRIVER_PATH} # Clean up (optional) diff --git a/README.md b/README.md index 630516ea..006c4db0 100644 --- a/README.md +++ b/README.md @@ -178,10 +178,9 @@ Run `pre-commit install` from inside the poetry environment to set up pre commit ## Testing -- Python unit tests: `pytest -m 'not slow'` -- Javascript unit tests: `npm test` -- Selenium tests: `pytest -m tests/selenium` -- Search benchmarks (these query the real Datahub backend): `pytest tests/benchmarks` +- All tests `make test` +- Unit tests: `make unit` +- Integration tests: `make integration` Selenium makes use of chromedriver to run a headless browser. As either the chrome browser or chromedriver are updated, diff --git a/tests/selenium/__init__.py b/tests/integration/__init__.py similarity index 100% rename from tests/selenium/__init__.py rename to tests/integration/__init__.py diff --git a/tests/selenium/conftest.py b/tests/integration/conftest.py similarity index 100% rename from tests/selenium/conftest.py rename to tests/integration/conftest.py diff --git a/tests/selenium/helpers.py b/tests/integration/helpers.py similarity index 100% rename from tests/selenium/helpers.py rename to tests/integration/helpers.py diff --git a/tests/selenium/test_details_contact_contents.py b/tests/integration/test_details_contact_contents.py similarity index 100% rename from tests/selenium/test_details_contact_contents.py rename to tests/integration/test_details_contact_contents.py diff --git a/tests/selenium/test_interact_with_search_results.py b/tests/integration/test_interact_with_search_results.py similarity index 100% rename from tests/selenium/test_interact_with_search_results.py rename to tests/integration/test_interact_with_search_results.py diff --git a/tests/selenium/test_primary_nav.py b/tests/integration/test_primary_nav.py similarity index 100% rename from tests/selenium/test_primary_nav.py rename to tests/integration/test_primary_nav.py diff --git a/tests/selenium/test_search_and_browse_from_homepage.py b/tests/integration/test_search_and_browse_from_homepage.py similarity index 100% rename from tests/selenium/test_search_and_browse_from_homepage.py rename to tests/integration/test_search_and_browse_from_homepage.py diff --git a/tests/selenium/test_search_controls.py b/tests/integration/test_search_controls.py similarity index 100% rename from tests/selenium/test_search_controls.py rename to tests/integration/test_search_controls.py