@@ -8,7 +8,7 @@ and made the source code freely available under the [Apache License 2.0](LICENSE
8
8
9
9
# :point_right : Status: Grid 4 is under development and on a [ Alpha stage] ( https://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha )
10
10
We are doing prereleases on a regular basis to get early feedback. This means that all other Selenium components
11
- can be currently at a different alpha version (e.g. bindings on Alpha 6 , and these Docker images on prerelease Alpha 7 ).
11
+ can be currently at a different alpha version (e.g. bindings on Alpha 7 , and Docker images on prerelease Beta 1 ).
12
12
13
13
Docker images for Grid 4 come with a handful of tags to simplify its usage, have a look at them in one of
14
14
our [ prereleases] ( https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.0.0-alpha-7-prerelease-20201009 )
@@ -51,7 +51,7 @@ To inspect visually the browser activity, see the [Debugging](#debugging) sectio
51
51
The shm size of 2gb is arbitrary but known to work well, your specific use case might need a different value, it is recommended
52
52
to tune this value according to your needs. Along the examples ` -v /dev/shm:/dev/shm ` will be used, but both are known to work.
53
53
54
- :point_up : Always use a tag with an element suffix to pin a specific browser version.
54
+ :point_up : Always use a Docker image with a full tag to pin a specific browser and Grid version.
55
55
See [ Tagging Conventions] ( https://github.com/SeleniumHQ/docker-selenium/wiki/Tagging-Convention ) for details.
56
56
57
57
___
@@ -123,7 +123,6 @@ linked resources below, save them locally, and check the execution instructions
123
123
To stop the Grid and cleanup the created containers, run ` docker-compose down ` .
124
124
125
125
#### Version 3 with Swarm support
126
-
127
126
[ ` docker-compose-v3-swarm.yml ` ] ( docker-compose-v3-swarm.yml )
128
127
129
128
___
@@ -138,6 +137,48 @@ instructions on top of it.
138
137
139
138
___
140
139
140
+ ## Video recording ![ BETA] ( https://img.shields.io/badge/beta!-blue?style=for-the-badge )
141
+
142
+ It is possible to record your tests running in containers by using the ` selenium/video:ffmpeg-4.3.1-20201009 `
143
+ Docker image. One container is needed per each container where a browser is running. This means if you are
144
+ running 5 Nodes/Standalone containers, you will need 5 video containers, the mapping is 1-1.
145
+
146
+ Currently, the only way to do this mapping is manually (either starting the containers manually, or through
147
+ ` docker-compose ` ). We are iterating on this process and probably this setup will be more simple in the future.
148
+
149
+ The video Docker image we provide is based on the ffmpeg Ubuntu image provided by the
150
+ [ jrottenberg/ffmpeg] ( https://github.com/jrottenberg/ffmpeg ) project, thank you for providing this image and
151
+ simplifying our work :tada :
152
+
153
+ ** Notes** :
154
+ - If you have questions or feedback, please use the community contact points shown [ here] ( https://www.selenium.dev/support/ ) .
155
+ - Please report any bugs through GitHub [ issues] ( https://github.com/SeleniumHQ/docker-selenium/issues/new/choose ) , and provide
156
+ all the information requested on the template.
157
+ - Video recording for headless browsers is not supported.
158
+ - Video recording tends to use considerable amounts of CPU. Normally you should estimate 1CPU per video container,
159
+ and 1 CPU per browser container.
160
+ - Videos are stored in the ` /videos ` directory inside the video container. Map a local directory to get the videos.
161
+ - If you are running more than one video container, be sure to overwrite the video file name through the ` FILE_NAME `
162
+ environment variable to avoid unexpected results.
163
+
164
+ This example shows how to start the containers manually:
165
+
166
+ ``` bash
167
+ $ docker network create grid
168
+ $ docker run -d -p 4444:4444 -p 6900:5900 --net grid --name selenium -v /dev/shm:/dev/shm selenium/standalone-chrome:4.0.0-alpha-7-prerelease-20201009
169
+ $ docker run -d --net grid --name video -v /tmp/videos:/videos selenium/video:ffmpeg-4.3.1-20201009
170
+ # Run your tests
171
+ $ docker stop video && docker rm video
172
+ $ docker stop selenium && docker rm selenium
173
+ ```
174
+ After the containers are stopped and removed, you should see a video file on your machine's ` /tmp/videos ` directory.
175
+
176
+ Here is an example using a Hub and 3 Nodes (Chrome, Firefox, and Opera):
177
+
178
+ [ ` docker-compose-v3-video.yml ` ] ( docker-compose-v3-video.yml )
179
+
180
+ ___
181
+
141
182
## Dynamic Grid ![ BETA] ( https://img.shields.io/badge/beta!-blue?style=for-the-badge )
142
183
143
184
Grid 4 has the ability to start Docker containers on demand, this means that it starts
@@ -167,6 +208,14 @@ configs = [
167
208
# To have Docker listening through tcp on macOS, install socat and run the following command
168
209
# socat -4 TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock
169
210
host = " tcp://host.docker.internal:2375"
211
+ # Docker imagee used for video recording
212
+ video-image = " selenium/video:ffmpeg-4.3.1-20201009"
213
+ # Absolute path where test assets will be stored (this path must exist on the host)
214
+ assets-path = " /assets/path/on/your/host/machine"
215
+ # Absolute path where test assets will be stored inside the container
216
+ # "/opt/selenium/assets" already exists inside the containers
217
+ # If you want to use another one, be sure it exists.
218
+ container-assets-path = " /opt/selenium/assets"
170
219
```
171
220
172
221
### Execution with Hub & Node roles
@@ -182,6 +231,7 @@ $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \
182
231
-e SE_EVENT_BUS_PUBLISH_PORT=4442 \
183
232
-e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \
184
233
-v ${PWD} /config.toml:/opt/bin/config.toml \
234
+ -v /path/on/your/host/machine:/opt/selenium/assets \
185
235
selenium/node-docker:4.0.0-alpha-7-prerelease-20201009
186
236
```
187
237
@@ -197,51 +247,28 @@ $ docker network rm grid
197
247
``` bash
198
248
docker run --rm -ti --name selenium-docker -p 4444:4444 \
199
249
-v ${PWD} /config.toml:/opt/bin/config.toml \
250
+ -v /path/on/your/host/machine:/opt/selenium/assets \
200
251
selenium/standalone-docker:4.0.0-alpha-7-prerelease-20201009
201
252
```
202
253
203
- ___
204
-
205
- ## Video recording ![ BETA] ( https://img.shields.io/badge/beta!-blue?style=for-the-badge )
206
-
207
- It is possible to record your tests running in containers by using the ` selenium/video:ffmpeg-4.3.1-20201009 `
208
- Docker image. One container is needed per each container where a browser is running. This means if you are
209
- running 5 Nodes/Standalone containers, you will need 5 video containers, the mapping is 1-1.
210
-
211
- Currently, the only way to do this mapping is manually (either starting the containers manually, or through
212
- ` docker-compose ` ). We are iterating on this process and probably this setup will be more simple in the future.
213
-
214
- The video Docker image we provide is based on the ffmpeg Ubuntu image provided by the
215
- [ jrottenberg/ffmpeg] ( https://github.com/jrottenberg/ffmpeg ) project, thank you for providing this image and
216
- simplifying our work :tada :
254
+ ### Video recording, screen resolution, and time zones in a Dynamic Grid
255
+ To record your WebDriver session, you need to add a ` se:options ` section to
256
+ your capabilities and inside it, configure the desired settings, for example:
217
257
218
- ** Notes** :
219
- - If you have questions or feedback, please use the community contact points shown [ here] ( https://www.selenium.dev/support/ ) .
220
- - Please report any bugs through GitHub [ issues] ( https://github.com/SeleniumHQ/docker-selenium/issues/new/choose ) , and provide
221
- all the information requested on the template.
222
- - Video recording for headless browsers is not supported.
223
- - Video recording tends to use considerable amounts of CPU. Normally you should estimate 1CPU per video container,
224
- and 1 CPU per browser container.
225
- - Videos are stored in the ` /videos ` directory inside the video container. Map a local directory to get the videos.
226
- - If you are running more than one video container, be sure to overwrite the video file name through the ` FILE_NAME `
227
- environment variable to avoid unexpected results.
228
-
229
- This example shows how to start the containers manually:
230
-
231
- ``` bash
232
- $ docker network create grid
233
- $ docker run -d -p 4444:4444 -p 6900:5900 --net grid --name selenium -v /dev/shm:/dev/shm selenium/standalone-chrome:4.0.0-alpha-7-prerelease-20201009
234
- $ docker run -d --net grid --name video -v /tmp/videos:/videos selenium/video:ffmpeg-4.3.1-20201009
235
- # Run your tests
236
- $ docker stop video && docker rm video
237
- $ docker stop selenium && docker rm selenium
258
+ ``` json
259
+ {
260
+ "browserName" : " firefox" ,
261
+ "platformName" : " linux" ,
262
+ "se:options" : {
263
+ "recordVideo" : " true" ,
264
+ "timeZone" : " US/Pacific" ,
265
+ "screenResolution" : " 1920x1080"
266
+ }
267
+ }
238
268
```
239
- After the containers are stopped and removed, you should see a video file on your machine's ` /tmp/videos ` directory.
240
-
241
- Here is an example using a Hub and 3 Nodes (Chrome, Firefox, and Opera):
242
-
243
- [ ` docker-compose-v3-video.yml ` ] ( docker-compose-v3-video.yml )
244
269
270
+ After running a test, check the path you mounted to the Docker container,
271
+ (` /path/on/your/host/machine ` ), and you should see videos and session information.
245
272
___
246
273
247
274
## Deploying to Kubernetes
0 commit comments