Skip to content

Commit

Permalink
refactor: Update e2e run-tests script to pass BASE_URL as environment…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
drikusroor committed May 22, 2024
1 parent dfba8c8 commit 25be294
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions e2e/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 25be294

Please sign in to comment.