From 93003a6c7da87b9ff4d3179236fe70d693f15d10 Mon Sep 17 00:00:00 2001 From: Ada Werefox Date: Thu, 26 Jan 2023 16:55:09 +0000 Subject: [PATCH] Slight modification to test runner script, updated README. --- README.md | 20 +++++++++++++++++--- run_tests.sh | 7 +++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ffa4d8d..d5ed45a 100755 --- a/README.md +++ b/README.md @@ -26,13 +26,27 @@ It's in the preliminary stages right now, but if you want to try your hand at ru That will start up a docker compose setup with a Selenium standalone server and a Python runner for the test script(s). I plan to add much more here in the future, like the ability to specify which test suites to run, what URL to test at, organizing output, etc. -For now, this will just run a test that opens the browser to [werefox.cafe](https://werefox.cafe) and waits 10 seconds, then closes. Just a small smoke test. - You can also just bring up a selenium-standalone container with: ``` -./run_tests.sh debug +./run_tests.sh --debug-server ``` +or +``` +./run_tests.sh -s +``` + +Once that is up, you can also debug tests with the node container with: + +``` +./run_tests.sh --debug-node +``` +or +``` +./run_tests.sh -n +``` + +The latter of which will simply run all the robot tests in the tests/test_suite directory. ## Production diff --git a/run_tests.sh b/run_tests.sh index b4b53f8..eebb565 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -4,8 +4,11 @@ set -xe MODE=$1 -if [ "$MODE" == "debug" ]; then - docker run --rm --name selenium-debug -p "4444:4444" -p "7900:7900" -e SE_OPTS="--allow-cors true" --shm-size="2g" selenium/standalone-chrome:108.0 +if [ "$MODE" == "--debug-server" ] || [ "$MODE" == "-s" ]; then + docker run --rm --name selenium-debug-server -p "4444:4444" -p "7900:7900" -e SE_OPTS="--allow-cors true" --shm-size="2g" selenium/standalone-chrome:108.0 +elif [ "$MODE" == "--debug-node" ] || [ "$MODE" == "-n" ]; then + docker run --rm --name selenium-debug-node -e "PYTHONPYCACHEPREFIX=/dev/null/" -v $(pwd)/tests/test_suite:/tests -v $(pwd)/tests/output:/output selenium-node:latest robot -d /output /tests/ + else cd tests/ docker compose build --no-cache --pull && docker compose up --remove-orphans --abort-on-container-exit --exit-code-from selenium-node