-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Doc with examples about running latest selenium grid.
- Loading branch information
Showing
6 changed files
with
102 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
ARG BROWSER=chrome | ||
ARG VERSION=latest | ||
FROM selenium/standalone-${BROWSER}:${VERSION} | ||
|
||
USER root | ||
|
||
RUN mkdir -p /usr/share/jitsi-meet-torture | ||
COPY resources /usr/share/jitsi-meet-torture/resources | ||
|
||
# setting custom version when using beta | ||
ARG VERSION | ||
RUN if [ "${VERSION}" = "beta" ] ; then sed -i "s/\${SE_NODE_BROWSER_VERSION}/beta/g" /opt/bin/generate_config; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
## A quick how to create a grid with latest selenium | ||
|
||
You need docker and docker-compose installed locally. | ||
|
||
### Images | ||
|
||
We need images with some media on them to be used as input device - audio and video. | ||
|
||
Create the images: | ||
``` | ||
cd jitsi-meet-torture/doc/grid | ||
cp -r ../../resources . | ||
wget -P resources https://github.com/jitsi/jitsi-meet-torture/releases/download/example-video-source/FourPeople_1280x720_30.y4m | ||
docker build --build-arg VERSION=latest --build-arg BROWSER=chrome -t jitsi/standalone-chrome:latest . | ||
docker build --build-arg VERSION=latest --build-arg BROWSER=firefox -t jitsi/standalone-firefox:latest . | ||
docker build --build-arg VERSION=beta --build-arg BROWSER=firefox -t jitsi/standalone-firefox:beta . | ||
docker build --build-arg VERSION=beta --build-arg BROWSER=chrome -t jitsi/standalone-chrome:beta . | ||
``` | ||
|
||
### Start the grid | ||
``` | ||
docker-compose-v3-dynamic-grid.yml | ||
``` | ||
|
||
This will start the grid and a node and everytime a session is requested a new docker image with the browser will be run. | ||
Once the session is not needed anymore the node will be destroyed. | ||
You can now open the grid dashboard at: http://localhost:4444/. | ||
The number of sessions/chrome instances will be limited to the resource of the machine running the node. | ||
You can start several nodes on different machines, for more information: https://github.com/SeleniumHQ/docker-selenium#using-dynamic-grid-in-different-machinesvms | ||
|
||
|
||
#### Example run | ||
``` | ||
mvn test -Djitsi-meet.instance.url=https://alpha.jitsi.net -Djitsi-meet.tests.toRun=UDPTest -Denable.headless=true \ | ||
-Dweb.participant1.isRemote=true -Dweb.participant2.isRemote=true -Dweb.participant3.isRemote=true -Dweb.participant4.isRemote=true \ | ||
-Dremote.resource.path=/usr/share/jitsi-meet-torture \ | ||
-Dremote.address=http://localhost:4444/wd/hub | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[docker] | ||
# Configs have a mapping between the Docker image to use and the capabilities that need to be matched to | ||
# start a container with the given image. | ||
configs = [ | ||
"jitsi/standalone-firefox:latest", '{"browserName": "firefox", "platformName": "linux"}', | ||
"jitsi/standalone-chrome:latest", '{"browserName": "chrome", "platformName": "linux"}', | ||
"jitsi/standalone-firefox:beta", '{"browserName": "firefox", "platformName": "linux", "browserVersion": "beta"}', | ||
"jitsi/standalone-chrome:beta", '{"browserName": "chrome", "platformName": "linux", "browserVersion": "beta" }' | ||
] | ||
|
||
# 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 | ||
url = "http://127.0.0.1:2375" | ||
# Docker image used for video recording | ||
#video-image = "selenium/video:ffmpeg-4.3.1-20230508" | ||
|
||
# Uncomment the following section if you are running the node on a separate VM | ||
# Fill out the placeholders with appropriate values | ||
#[server] | ||
#host = <ip-from-node-machine> | ||
#port = <port-from-node-machine> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# 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.9.1-20230508 | ||
volumes: | ||
- ./assets:/opt/selenium/assets | ||
- ./config.toml:/opt/bin/config.toml | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
depends_on: | ||
- selenium-hub | ||
environment: | ||
- SE_EVENT_BUS_HOST=selenium-hub | ||
- SE_EVENT_BUS_PUBLISH_PORT=4442 | ||
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443 | ||
- SE_NODE_SESSION_TIMEOUT=60 | ||
|
||
selenium-hub: | ||
image: selenium/hub:4.9.1-20230508 | ||
container_name: selenium-hub | ||
ports: | ||
- "4442:4442" | ||
- "4443:4443" | ||
- "4444:4444" |
Binary file not shown.