Slight modification to test runner script, updated README.

This commit is contained in:
Ada Werefox 2023-01-26 16:55:09 +00:00
parent 901d37a7a8
commit 93003a6c7d
2 changed files with 22 additions and 5 deletions

View File

@ -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. 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: 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 ## Production

View File

@ -4,8 +4,11 @@ set -xe
MODE=$1 MODE=$1
if [ "$MODE" == "debug" ]; then if [ "$MODE" == "--debug-server" ] || [ "$MODE" == "-s" ]; 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 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 else
cd tests/ cd tests/
docker compose build --no-cache --pull && docker compose up --remove-orphans --abort-on-container-exit --exit-code-from selenium-node docker compose build --no-cache --pull && docker compose up --remove-orphans --abort-on-container-exit --exit-code-from selenium-node