@@ -7,25 +7,30 @@ RAILS_PORT="4100"
77HEALTH_CHECK_URL=" http://localhost:${RAILS_PORT} /up"
88MAVIS_TEST_REPO=" ${MAVIS_TEST_REPO:- " ../manage-vaccinations-in-schools-testing" } "
99E2E_REDIS_URL=" redis://localhost:6380/0"
10+ PYTEST_ARGS=(" -m" " not accessibility and not reporting and not imms_api" )
1011
1112# Argument handling
1213
1314function print_help() {
14- echo " Usage: bin/e2e [--main] [pytest args...] <pytest-target>"
15+ echo " Usage: bin/e2e [--main] [<pytest-args> ...] <pytest-target>"
16+ echo " "
17+ echo " Runs end-to-end tests against a local Rails stack. Only the tests run in CI are"
18+ echo " run by default."
19+ echo " "
20+ echo " The pytest CLI command defaults to:"
21+ echo " uv run pytest ${PYTEST_ARGS[*]} <pytest-target>"
1522 echo " "
1623 echo " Options:"
17- echo " --main Force sync testing repo to latest main branch. WARNING: this will discard any local changes in the testing repo."
18- echo " -h, --help Show this help message and exit."
24+ echo " --main Force sync testing repo to latest main branch. WARNING: this"
25+ echo " will discard any local changes in the testing repo."
26+ echo " -h, --help Show this help message and exit."
27+ echo " <pytest-args> Additional arguments to pass to pytest."
1928 echo " "
20- echo " Example :"
29+ echo " Examples :"
2130 echo " bin/e2e --main --headed tests/test_start.py::test_start_page_elements_visible"
31+ echo " bin/e2e --screenshot=only-on-failure tests/test_import_child_lists.py::test_child_list_file_upload_empty_file"
2232}
2333
24- if [ $# -lt 1 ]; then
25- print_help
26- exit 1
27- fi
28-
2934if ! command -v uv > /dev/null 2>&1 ; then
3035 echo " [e2e] ERROR: 'uv' is not installed or not on PATH." >&2
3136 echo " Install uv: https://github.com/astral-sh/uv" >&2
4146
4247# Consume --main flag if present
4348USE_MAVIS_BRANCH=false
44- PYTEST_ARGS=()
4549
4650for arg in " $@ " ; do
4751 case " $arg " in
201205pushd " $MAVIS_TEST_REPO " > /dev/null
202206
203207echo " [e2e] Running end-to-end tests:"
204- echo " [e2e] uv run pytest -m " not accessibility and not reporting and not imms_api " ${PYTEST_ARGS[*]} "
208+ echo " [e2e] BASE_URL= \" http://localhost: ${RAILS_PORT} \" uv run pytest ${PYTEST_ARGS[*]} "
205209BASE_URL=" http://localhost:${RAILS_PORT} " uv run pytest -m " not accessibility and not reporting and not imms_api" " ${PYTEST_ARGS[@]} "
206210PYTEST_EXIT_CODE=$?
207211
0 commit comments