Skip to content

Commit

Permalink
Add Chrome for Testing instead of Chromium
Browse files Browse the repository at this point in the history
* Merged the latest master branch into this one

* Simplified the Chrome for Testing setup
  • Loading branch information
ppodgorsek committed Jul 12, 2024
1 parent 3302dbd commit 3b8d2f1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 30 deletions.
32 changes: 6 additions & 26 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM fedora:40

MAINTAINER Paul Podgorsek <[email protected]>
LABEL authors Paul Podgorsek
LABEL description Robot Framework in Docker.

# Set the Python dependencies' directory environment variable
Expand Down Expand Up @@ -35,7 +35,7 @@ ENV ROBOT_GID 1000
ENV AWS_CLI_VERSION 1.33.23
ENV AXE_SELENIUM_LIBRARY_VERSION 2.1.6
ENV BROWSER_LIBRARY_VERSION 18.6.3
ENV CHROME_VERSION 123.0.6312.122
ENV CHROME_VERSION 126.0.6478.126
ENV DATABASE_LIBRARY_VERSION 1.4.4
ENV DATADRIVER_VERSION 1.11.2
ENV DATETIMETZ_VERSION 1.0.6
Expand Down Expand Up @@ -77,28 +77,10 @@ RUN dnf upgrade -y --refresh \
xorg-x11-server-Xvfb-${XVFB_VERSION}* \
&& dnf clean all

# Install Chrome for Testing with dependencies
RUN dnf install -y \
zip \

# Exclude bash dependency to avoid conflicts
&& dnf deplist https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm | \
grep provider | grep -v "bash" | \
sort --unique | \
awk '{print $2}' | \
xargs dnf install --best --allowerasing --skip-broken -y \
&& wget -q "https://storage.googleapis.com/chrome-for-testing-public/${CHROME_VERSION}/linux64/chrome-linux64.zip" \
&& wget -q "https://storage.googleapis.com/chrome-for-testing-public/${CHROME_VERSION}/linux64/chromedriver-linux64.zip" \
&& unzip chrome-linux64.zip \
&& unzip chromedriver-linux64.zip \
&& mkdir -p /opt/chrome-for-testing/ \
&& mv chrome-linux64 /opt/chrome-for-testing \
&& mv chromedriver-linux64 /opt/chrome-for-testing \
&& rm chrome-linux64.zip chromedriver-linux64.zip \

&& dnf remove -y \
zip \
&& dnf clean all
# Install Chrome for Testing
# https://developer.chrome.com/blog/chrome-for-testing/
RUN npx @puppeteer/browsers install chrome@${CHROME_VERSION} \
&& npx @puppeteer/browsers install chromedriver@${CHROME_VERSION}

# Install Robot Framework and associated libraries
RUN pip3 install \
Expand Down Expand Up @@ -137,12 +119,10 @@ RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \
&& dnf install -y \
microsoft-edge-stable-${MICROSOFT_EDGE_VERSION} \
zip \

&& wget -q "https://msedgedriver.azureedge.net/${MICROSOFT_EDGE_VERSION}/edgedriver_linux64.zip" \
&& unzip edgedriver_linux64.zip -d edge \
&& mv edge/msedgedriver /opt/robotframework/drivers/msedgedriver \
&& rm -Rf edgedriver_linux64.zip edge/ \

# IMPORTANT: don't remove the wget package because it's a dependency of Microsoft Edge
&& dnf remove -y \
zip \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ The versions used are:
* [Robot Framework SSHLibrary](https://github.com/robotframework/SSHLibrary) 3.8.0
* [Axe Selenium Library](https://github.com/mozilla-services/axe-selenium-python) 2.1.6
* Firefox 128.0
* Chrome for Testing 123.0
* Microsoft Edge 126.0.2592.87
* [Chrome for Testing](https://googlechromelabs.github.io/chrome-for-testing/) 126.0
* Microsoft Edge 126.0
* [Amazon AWS CLI](https://pypi.org/project/awscli/) 1.33.23

As stated by [the official GitHub project](https://github.com/robotframework/Selenium2Library), starting from version 3.0, Selenium2Library is renamed to SeleniumLibrary and this project exists mainly to help with transitioning. The Selenium2Library 3.0.0 is also the last release and for new releases, please look at the [SeleniumLibrary](https://github.com/robotframework/SeleniumLibrary) project.
Expand Down
2 changes: 1 addition & 1 deletion bin/chrome.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

exec /opt/chrome-for-testing/chrome-linux64/chrome --disable-gpu --no-sandbox "$@"
exec /chrome/linux-${CHROME_VERSION}/chrome-linux64/chrome --disable-gpu --no-sandbox "$@"
2 changes: 1 addition & 1 deletion bin/chromedriver.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

exec /opt/chrome-for-testing/chromedriver-linux64/chromedriver --verbose --log-path=/var/log/chromedriver --no-sandbox "$@"
exec /chromedriver/linux-${CHROME_VERSION}/chromedriver-linux64/chromedriver --verbose --log-path=/var/log/chromedriver --no-sandbox "$@"

0 comments on commit 3b8d2f1

Please sign in to comment.