Add support for E2E (end-to-end) tests (#625)

This changeset lays the foundation for supporting E2E (end-to-end) integration tests for US Notify.  It brings in the Playwright testing framework along with the Playwright pytest plugin to make this possible, and includes the following adjustments:

- A new test session fixture for ensuring that Playwright authenticates with the sites that are currently behind HTTP Auth (requies env-var config)
- A new end_to_end test directory specifically for E2E tests
- Updates to the Makefile that make sure E2E tests are not run as a part of the normal test routine but can be run separately
- A new command in the Makefile to run E2E tests that will run in Chromium, Firefox, and Webkit headless browsers

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
This commit is contained in:
Carlo Costino
2023-07-28 09:31:45 -04:00
committed by GitHub
parent e3e11327da
commit b5664c3d20
8 changed files with 385 additions and 21 deletions

View File

@@ -41,7 +41,13 @@ jobs:
- name: Run js tests
run: npm test
- name: Run py tests with coverage
run: pipenv run coverage run --omit=*/notifications_utils/* -m pytest --maxfail=10
run: pipenv run coverage run --omit=*/notifications_utils/* -m pytest --maxfail=10 --ignore=tests/end_to_end tests/
- name: Run E2E tests
run: pipenv run pytest -v --browser chromium --browser firefox --browser webkit tests/end_to_end
env:
NOTIFY_STAGING_HTTP_AUTH_PASSWORD: ${{ secrets.NOTIFY_STAGING_HTTP_AUTH_PASSWORD }}
NOTIFY_STAGING_HTTP_AUTH_USER: ${{ secrets.NOTIFY_STAGING_HTTP_AUTH_USER }}
NOTIFY_STAGING_URI: ${{ secrets.NOTIFY_STAGING_URI }}
- name: Check coverage threshold
run: pipenv run coverage report --fail-under=90