Skip to content

Commit 4c572af

Browse files
authored
[build][doc]: upgrade browser with remain on same the Selenium version (#2217)
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent df742c9 commit 4c572af

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,27 @@ count_image_layers:
157157
docker history $(NAME)/standalone-docker:$(TAG_VERSION) -q | wc -l
158158
docker history $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) -q | wc -l
159159

160+
chrome_upgrade_version:
161+
cd ./NodeChrome && docker build $(BUILD_ARGS) --build-arg NAMESPACE=$(NAMESPACE) --build-arg VERSION=$(VERSION) --build-arg AUTHORS=$(AUTHORS) -t $(NAME)/node-chrome:$(TAG_VERSION) .
162+
cd ./Standalone && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-chrome -t $(NAME)/standalone-chrome:$(TAG_VERSION) .
163+
docker run --rm $(NAME)/standalone-chrome:$(TAG_VERSION) /opt/selenium/selenium-server.jar info --version
164+
docker run --rm $(NAME)/standalone-chrome:$(TAG_VERSION) google-chrome --version
165+
docker run --rm $(NAME)/standalone-chrome:$(TAG_VERSION) chromedriver --version
166+
167+
firefox_upgrade_version:
168+
cd ./NodeFirefox && docker build $(BUILD_ARGS) --build-arg NAMESPACE=$(NAMESPACE) --build-arg VERSION=$(VERSION) --build-arg AUTHORS=$(AUTHORS) -t $(NAME)/node-firefox:$(TAG_VERSION) .
169+
cd ./Standalone && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-firefox -t $(NAME)/standalone-firefox:$(TAG_VERSION) .
170+
docker run --rm $(NAME)/standalone-firefox:$(TAG_VERSION) /opt/selenium/selenium-server.jar info --version
171+
docker run --rm $(NAME)/standalone-firefox:$(TAG_VERSION) firefox --version
172+
docker run --rm $(NAME)/standalone-firefox:$(TAG_VERSION) geckodriver --version
173+
174+
edge_upgrade_version:
175+
cd ./NodeEdge && docker build $(BUILD_ARGS) --build-arg NAMESPACE=$(NAMESPACE) --build-arg VERSION=$(VERSION) --build-arg AUTHORS=$(AUTHORS) -t $(NAME)/node-edge:$(TAG_VERSION) .
176+
cd ./Standalone && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-edge -t $(NAME)/standalone-edge:$(TAG_VERSION) .
177+
docker run --rm $(NAME)/standalone-edge:$(TAG_VERSION) /opt/selenium/selenium-server.jar info --version
178+
docker run --rm $(NAME)/standalone-edge:$(TAG_VERSION) microsoft-edge --version
179+
docker run --rm $(NAME)/standalone-edge:$(TAG_VERSION) msedgedriver --version
180+
160181
# https://github.com/SeleniumHQ/docker-selenium/issues/992
161182
# Additional tags for browser images
162183
tag_and_push_browser_images: tag_and_push_chrome_images tag_and_push_firefox_images tag_and_push_edge_images

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,31 @@ $ BUILD_ARGS="--build-arg SEL_USER=yourseluser --build-arg SEL_PASSWD=welcome" m
10271027
```
10281028
___
10291029

1030+
## Upgrade browser version in the images
1031+
1032+
Selenium server, browser and driver are pre-installed in the image. In case you would like to remain on the same Selenium version and just upgrade the browser and its driver to the latest. You can follow below steps
1033+
1034+
Clone the repo and from the project directory root you can upgrade by running:
1035+
1036+
```bash
1037+
$ VERSION=$EXPECTED_SELENIUM_VERSION make chrome_upgrade_version
1038+
```
1039+
For example: `VERSION=4.16.1 make chrome_upgrade_version`
1040+
1041+
The new image has tag `$VERSION_YYYYMMDD` where `YYYYMMDD` is the current date.
1042+
1043+
```bash
1044+
$ VERSION=$SELENIUM_VERSION make firefox_upgrade_version
1045+
```
1046+
1047+
```bash
1048+
$ VERSION=$SELENIUM_VERSION make edge_upgrade_version
1049+
```
1050+
1051+
You can refer to detail commands in the [Makefile](Makefile) file.
1052+
1053+
---
1054+
10301055
## Waiting for the Grid to be ready
10311056

10321057
It is a good practice to check first if the Grid is up and ready to receive requests, this can be done by checking the `/wd/hub/status` endpoint.

0 commit comments

Comments
 (0)