Skip to content

Commit

Permalink
Improving docs for Dynamic Grid
Browse files Browse the repository at this point in the history
  • Loading branch information
diemol committed Mar 19, 2021
1 parent dd30ba3 commit 6849d8b
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -8,6 +8,8 @@ node_modules/
*.swp
# Selenium Server Dev
selenium_server_deploy.jar
# assets directory
assets

# Ignoring generated files during the build process
StandaloneC*/selenium.conf
Expand Down
15 changes: 5 additions & 10 deletions NodeDocker/config.toml
Expand Up @@ -4,26 +4,21 @@
configs = [
"selenium/standalone-firefox:4.0.0-beta-2-20210319", "{\"browserName\": \"firefox\"}",
"selenium/standalone-chrome:4.0.0-beta-2-20210319", "{\"browserName\": \"chrome\"}",
"selenium/standalone-opera:4.0.0-beta-2-20210319", "{\"browserName\": \"operablink\"}"
]
"selenium/standalone-opera:4.0.0-beta-2-20210319", "{\"browserName\": \"opera\"}",
"selenium/standalone-edge:4.0.0-beta-2-20210319", "{\"browserName\": \"MicrosoftEdge\"}"
]

# URL for connecting to the docker daemon
# host.docker.internal works for macOS and Windows.
# Linux could use --net=host in the `docker run` instruction or 172.17.0.1 in the URI below.
# To have Docker listening through tcp on macOS, install socat and run the following command
# socat -4 TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock
host = "tcp://host.docker.internal:2375"
url = "http://host.docker.internal:2375"
# Docker imagee used for video recording
video-image = "selenium/video:ffmpeg-4.3.1-20210319"
# Absolute path where test assets will be stored (this path must exist on the host)
assets-path = "/assets/path/on/your/host/machine"
# Absolute path where test assets will be stored inside the container
# "/opt/selenium/assets" already exists inside the containers
# If you want to use another one, be sure it exists.
container-assets-path = "/opt/selenium/assets"

# Uncomment the following section if you are running the node on a separate VM
# Fill out the placeholders with appropriate values
#[server]
#hostname = <ip-from-node-machine>
#host = <ip-from-node-machine>
#port = <port-from-node-machine>
11 changes: 9 additions & 2 deletions README.md
Expand Up @@ -238,7 +238,7 @@ $ docker stop selenium && docker rm selenium
```
After the containers are stopped and removed, you should see a video file on your machine's `/tmp/videos` directory.

Here is an example using a Hub and 3 Nodes (Chrome, Firefox, and Opera):
Here is an example using a Hub and a few Nodes:

[`docker-compose-v3-video.yml`](docker-compose-v3-video.yml)

Expand Down Expand Up @@ -273,7 +273,7 @@ configs = [
# Linux could use --net=host in the `docker run` instruction or 172.17.0.1 in the URI below.
# To have Docker listening through tcp on macOS, install socat and run the following command
# socat -4 TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock
url = "tcp://host.docker.internal:2375"
url = "http://host.docker.internal:2375"
# Docker imagee used for video recording
video-image = "selenium/video:ffmpeg-4.3.1-20210319"

Expand Down Expand Up @@ -321,6 +321,13 @@ docker run --rm -ti --name selenium-docker -p 4444:4444 \

To have the assets saved on your host, please mount your host path to `/opt/selenium/assets`.

### Execution with Docker Compose

Here is an example using a Hub and a Node:

[`docker-compose-v3-dynamic-grid.yml`](docker-compose-v3-dynamic-grid.yml)


### Video recording, screen resolution, and time zones in a Dynamic Grid
To record your WebDriver session, you need to add a `se:options` section to
your capabilities and inside it, configure the desired settings, for example:
Expand Down
24 changes: 24 additions & 0 deletions docker-compose-v3-dynamic-grid.yml
@@ -0,0 +1,24 @@
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3-dynamic-grid.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3-dynamic-grid.yml down`
version: "3"
services:
node-docker:
image: selenium/node-docker:4.0.0-beta-2-20210319
volumes:
- ./assets:/opt/selenium/assets
- ./NodeDocker/config.toml:/opt/bin/config.toml
depends_on:
- selenium-hub
environment:
- SE_EVENT_BUS_HOST=selenium-hub
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443

selenium-hub:
image: selenium/hub:4.0.0-beta-2-20210319
container_name: selenium-hub
ports:
- "4442:4442"
- "4443:4443"
- "4444:4444"

0 comments on commit 6849d8b

Please sign in to comment.