Skip to content

Commit 8ccb571

Browse files
authored
Merge pull request #485 from andy-kru/chrome-for-testing
Added Chrome for Testing instead of Chromium
2 parents 066848b + 3b8d2f1 commit 8ccb571

File tree

5 files changed

+14
-17
lines changed

5 files changed

+14
-17
lines changed

Dockerfile

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM fedora:40
22

3-
MAINTAINER Paul Podgorsek <[email protected]>
3+
LABEL authors Paul Podgorsek
44
LABEL description Robot Framework in Docker.
55

66
# Set the Python dependencies' directory environment variable
@@ -35,7 +35,7 @@ ENV ROBOT_GID 1000
3535
ENV AWS_CLI_VERSION 1.33.23
3636
ENV AXE_SELENIUM_LIBRARY_VERSION 2.1.6
3737
ENV BROWSER_LIBRARY_VERSION 18.6.3
38-
ENV CHROMIUM_VERSION 126.0
38+
ENV CHROME_VERSION 126.0.6478.126
3939
ENV DATABASE_LIBRARY_VERSION 1.4.4
4040
ENV DATADRIVER_VERSION 1.11.2
4141
ENV DATETIMETZ_VERSION 1.0.6
@@ -56,15 +56,13 @@ ENV XVFB_VERSION 1.20
5656
ENV AWS_UPLOAD_TO_S3 false
5757

5858
# Prepare binaries to be executed
59-
COPY bin/chromedriver.sh /opt/robotframework/bin/chromedriver
60-
COPY bin/chromium-browser.sh /opt/robotframework/bin/chromium-browser
59+
COPY bin/chromedriver.sh /opt/robotframework/drivers/chromedriver
60+
COPY bin/chrome.sh /opt/robotframework/bin/chrome
6161
COPY bin/run-tests-in-virtual-screen.sh /opt/robotframework/bin/
6262

6363
# Install system dependencies
6464
RUN dnf upgrade -y --refresh \
6565
&& dnf install -y \
66-
chromedriver-${CHROMIUM_VERSION}* \
67-
chromium-${CHROMIUM_VERSION}* \
6866
dbus-glib \
6967
dnf-plugins-core \
7068
firefox-${FIREFOX_VERSION}* \
@@ -79,9 +77,10 @@ RUN dnf upgrade -y --refresh \
7977
xorg-x11-server-Xvfb-${XVFB_VERSION}* \
8078
&& dnf clean all
8179

82-
# FIXME: below is a workaround, as the path is ignored
83-
RUN mv /usr/lib64/chromium-browser/chromium-browser /usr/lib64/chromium-browser/chromium-browser-original \
84-
&& ln -sfv /opt/robotframework/bin/chromium-browser /usr/lib64/chromium-browser/chromium-browser
80+
# Install Chrome for Testing
81+
# https://developer.chrome.com/blog/chrome-for-testing/
82+
RUN npx @puppeteer/browsers install chrome@${CHROME_VERSION} \
83+
&& npx @puppeteer/browsers install chromedriver@${CHROME_VERSION}
8584

8685
# Install Robot Framework and associated libraries
8786
RUN pip3 install \
@@ -120,12 +119,10 @@ RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \
120119
&& dnf install -y \
121120
microsoft-edge-stable-${MICROSOFT_EDGE_VERSION} \
122121
zip \
123-
124122
&& wget -q "https://msedgedriver.azureedge.net/${MICROSOFT_EDGE_VERSION}/edgedriver_linux64.zip" \
125123
&& unzip edgedriver_linux64.zip -d edge \
126124
&& mv edge/msedgedriver /opt/robotframework/drivers/msedgedriver \
127125
&& rm -Rf edgedriver_linux64.zip edge/ \
128-
129126
# IMPORTANT: don't remove the wget package because it's a dependency of Microsoft Edge
130127
&& dnf remove -y \
131128
zip \

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ The versions used are:
6262
* [Robot Framework SSHLibrary](https://github.com/robotframework/SSHLibrary) 3.8.0
6363
* [Axe Selenium Library](https://github.com/mozilla-services/axe-selenium-python) 2.1.6
6464
* Firefox 128.0
65-
* Chromium 126.0
66-
* Microsoft Edge 126.0.2592.87
65+
* [Chrome for Testing](https://googlechromelabs.github.io/chrome-for-testing/) 126.0
66+
* Microsoft Edge 126.0
6767
* [Amazon AWS CLI](https://pypi.org/project/awscli/) 1.33.23
6868

6969
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.

bin/chrome.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
exec /chrome/linux-${CHROME_VERSION}/chrome-linux64/chrome --disable-gpu --no-sandbox "$@"

bin/chromedriver.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22

3-
exec /usr/bin/chromedriver --verbose --log-path=/var/log/chromedriver --no-sandbox "$@"
3+
exec /chromedriver/linux-${CHROME_VERSION}/chromedriver-linux64/chromedriver --verbose --log-path=/var/log/chromedriver --no-sandbox "$@"

bin/chromium-browser.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)