From 25be294edc96c4af02fff9abe2e0f09faeda3a44 Mon Sep 17 00:00:00 2001 From: Drikus Roor Date: Tue, 14 May 2024 10:42:15 +0200 Subject: [PATCH] refactor: Update e2e run-tests script to pass BASE_URL as environment variable The e2e run-tests script has been refactored to pass the BASE_URL as an environment variable to the Docker container. This change improves the flexibility and maintainability of the script by decoupling the base URL configuration from the script itself. Now, the script can easily adapt to different environments without modifying the code. --- e2e/run-tests | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/run-tests b/e2e/run-tests index 98adff16f..3b908fdff 100755 --- a/e2e/run-tests +++ b/e2e/run-tests @@ -9,8 +9,8 @@ docker build -t selenium-tests . # Check for '-i' parameter to decide the mode of operation if [[ "$1" == "-i" ]]; then # If '-i' is supplied, start the container with an interactive bash shell - docker run --rm -it --network="host" --name selenium-tests-container -v $(pwd):/usr/src/app --entrypoint bash selenium-tests + docker run --rm -it --network="host" -e BASE_URL=$BASE_URL --name selenium-tests-container -v $(pwd):/usr/src/app --entrypoint bash selenium-tests else # If no '-i' is supplied, run the python test script - docker run --rm -it --network="host" --name selenium-tests-container -v $(pwd):/usr/src/app selenium-tests python tests-selenium.py + docker run --rm -it --network="host" -e BASE_URL=$BASE_URL --name selenium-tests-container -v $(pwd):/usr/src/app selenium-tests python tests-selenium.py fi \ No newline at end of file