Skip to content

Commit

Permalink
updated README for docker usage. Also updated docker-compose-v3.yml t…
Browse files Browse the repository at this point in the history
…o support proxy usage
  • Loading branch information
anandbagmar committed Jul 6, 2023
1 parent 4b48138 commit cc41631
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 12 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ Test can run on local browsers / devices, or against any cloud provider, such as

## [Running the sample tests](docs/SampleTests-README.md)

## [Setting up docker containers](docs/dockerSetup-README.md)

## Additional configurations

### [Running Visual Tests using Applitools Visual AI](docs/RunningVisualTests-README.md)
Expand Down
24 changes: 12 additions & 12 deletions docker-compose-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ services:
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
- SE_NODE_MAX_SESSIONS=2
- HTTP_PROXY=${HTTP_PROXY}
- HTTPS_PROXY=${HTTP_PROXY}
- http_proxy=${HTTP_PROXY}
- https_proxy=${HTTP_PROXY}
- HTTP_PROXY=${PROXY_KEY}
- HTTPS_PROXY=${PROXY_KEY}
- http_proxy=${PROXY_KEY}
- https_proxy=${PROXY_KEY}

firefox:
image: ${DOCKER_REGISTRY}/${FIREFOX_REPO}:latest
Expand All @@ -34,10 +34,10 @@ services:
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
- SE_NODE_MAX_SESSIONS=2
- HTTP_PROXY=${HTTP_PROXY}
- HTTPS_PROXY=${HTTP_PROXY}
- http_proxy=${HTTP_PROXY}
- https_proxy=${HTTP_PROXY}
- HTTP_PROXY=${PROXY_KEY}
- HTTPS_PROXY=${PROXY_KEY}
- http_proxy=${PROXY_KEY}
- https_proxy=${PROXY_KEY}

selenium-hub:
image: ${DOCKER_REGISTRY}/${SELENIUM_HUB_REPO}:latest
Expand All @@ -47,7 +47,7 @@ services:
- "${GRID_PORT_2}:4443"
- "${GRID_PORT}:4444"
environment:
- HTTP_PROXY=${HTTP_PROXY}
- HTTPS_PROXY=${HTTP_PROXY}
- http_proxy=${HTTP_PROXY}
- https_proxy=${HTTP_PROXY}
- HTTP_PROXY=${PROXY_KEY}
- HTTPS_PROXY=${PROXY_KEY}
- http_proxy=${PROXY_KEY}
- https_proxy=${PROXY_KEY}
9 changes: 9 additions & 0 deletions dockerContainers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,17 @@ else
fi
echo "Using GRID_PORT: $GRID_PORT"

if [[ -z "${HTTP_PROXY}" ]]; then
echo "GRID_PORT is not set. Use default: 4444"
PROXY_KEY=NOT_SET
else
PROXY_KEY=$HTTP_PROXY
fi
echo "Using PROXY_KEY: $PROXY_KEY"

((GRID_PORT_1=$GRID_PORT-1))
((GRID_PORT_2=$GRID_PORT-2))
export PROXY_KEY=$PROXY_KEY
export GRID_PORT=$GRID_PORT
export GRID_PORT_1=$GRID_PORT_1
export GRID_PORT_2=$GRID_PORT_2
Expand Down
38 changes: 38 additions & 0 deletions docs/dockerSetup-README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Setting up docker containers

It is now easy to start and stop containers for Selenium-Hub, Chrome and Firefox.

## To start the containers

./dockerContainers.sh up

or

./dockerContainers.sh start

## To stop the containers

./dockerContainers.sh down

or

./dockerContainers.sh stop

This uses [docker-compose-v3.yml](../docker-compose-v3.yml) - which uses the latest chrome, firefox and selenium-hub.

**The [dockerContainers.sh](../dockerContainers.sh) script also takes care of running tests on
Windows, Linux, Mac OSX
(intel
chip, M1,
M1-Pro).**

## Changes required
Each team will need to do the following changes to use this effectively:

In [dockerContainers.sh](../dockerContainers.sh) ,
* replace all references of **TESWIZ_GRID_PORT** with the actual environment variable you are using
for setting a dynamic port via **REMOTE_WEBDRIVER_GRID_PORT** (in config.properties).
* Default is 4444
* replace all references of **HTTP_PROXY** with the actual environment variable you are using for
setting the **PROXY_KEY** (in config.properties).
* Default is NOT_SET

0 comments on commit cc41631

Please sign in to comment.