Skip to content

[build][doc]: upgrade browser with remain on same the Selenium version #2217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,27 @@ count_image_layers:
docker history $(NAME)/standalone-docker:$(TAG_VERSION) -q | wc -l
docker history $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) -q | wc -l

chrome_upgrade_version:
cd ./NodeChrome && docker build $(BUILD_ARGS) --build-arg NAMESPACE=$(NAMESPACE) --build-arg VERSION=$(VERSION) --build-arg AUTHORS=$(AUTHORS) -t $(NAME)/node-chrome:$(TAG_VERSION) .
cd ./Standalone && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-chrome -t $(NAME)/standalone-chrome:$(TAG_VERSION) .
docker run --rm $(NAME)/standalone-chrome:$(TAG_VERSION) /opt/selenium/selenium-server.jar info --version
docker run --rm $(NAME)/standalone-chrome:$(TAG_VERSION) google-chrome --version
docker run --rm $(NAME)/standalone-chrome:$(TAG_VERSION) chromedriver --version

firefox_upgrade_version:
cd ./NodeFirefox && docker build $(BUILD_ARGS) --build-arg NAMESPACE=$(NAMESPACE) --build-arg VERSION=$(VERSION) --build-arg AUTHORS=$(AUTHORS) -t $(NAME)/node-firefox:$(TAG_VERSION) .
cd ./Standalone && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-firefox -t $(NAME)/standalone-firefox:$(TAG_VERSION) .
docker run --rm $(NAME)/standalone-firefox:$(TAG_VERSION) /opt/selenium/selenium-server.jar info --version
docker run --rm $(NAME)/standalone-firefox:$(TAG_VERSION) firefox --version
docker run --rm $(NAME)/standalone-firefox:$(TAG_VERSION) geckodriver --version

edge_upgrade_version:
cd ./NodeEdge && docker build $(BUILD_ARGS) --build-arg NAMESPACE=$(NAMESPACE) --build-arg VERSION=$(VERSION) --build-arg AUTHORS=$(AUTHORS) -t $(NAME)/node-edge:$(TAG_VERSION) .
cd ./Standalone && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-edge -t $(NAME)/standalone-edge:$(TAG_VERSION) .
docker run --rm $(NAME)/standalone-edge:$(TAG_VERSION) /opt/selenium/selenium-server.jar info --version
docker run --rm $(NAME)/standalone-edge:$(TAG_VERSION) microsoft-edge --version
docker run --rm $(NAME)/standalone-edge:$(TAG_VERSION) msedgedriver --version

# https://github.com/SeleniumHQ/docker-selenium/issues/992
# Additional tags for browser images
tag_and_push_browser_images: tag_and_push_chrome_images tag_and_push_firefox_images tag_and_push_edge_images
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,31 @@ $ BUILD_ARGS="--build-arg SEL_USER=yourseluser --build-arg SEL_PASSWD=welcome" m
```
___

## Upgrade browser version in the images

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

Clone the repo and from the project directory root you can upgrade by running:

```bash
$ VERSION=$EXPECTED_SELENIUM_VERSION make chrome_upgrade_version
```
For example: `VERSION=4.16.1 make chrome_upgrade_version`

The new image has tag `$VERSION_YYYYMMDD` where `YYYYMMDD` is the current date.

```bash
$ VERSION=$SELENIUM_VERSION make firefox_upgrade_version
```

```bash
$ VERSION=$SELENIUM_VERSION make edge_upgrade_version
```

You can refer to detail commands in the [Makefile](Makefile) file.

---

## Waiting for the Grid to be ready

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.
Expand Down