Skip to content
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

Added Chrome for Testing instead of Chromium #485

Merged
merged 4 commits into from
Jul 12, 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
19 changes: 8 additions & 11 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 CHROMIUM_VERSION 126.0
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 All @@ -56,15 +56,13 @@ ENV XVFB_VERSION 1.20
ENV AWS_UPLOAD_TO_S3 false

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

# Install system dependencies
RUN dnf upgrade -y --refresh \
&& dnf install -y \
chromedriver-${CHROMIUM_VERSION}* \
chromium-${CHROMIUM_VERSION}* \
dbus-glib \
dnf-plugins-core \
firefox-${FIREFOX_VERSION}* \
Expand All @@ -79,9 +77,10 @@ RUN dnf upgrade -y --refresh \
xorg-x11-server-Xvfb-${XVFB_VERSION}* \
&& dnf clean all

# FIXME: below is a workaround, as the path is ignored
RUN mv /usr/lib64/chromium-browser/chromium-browser /usr/lib64/chromium-browser/chromium-browser-original \
&& ln -sfv /opt/robotframework/bin/chromium-browser /usr/lib64/chromium-browser/chromium-browser
# 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 @@ -120,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
* Chromium 126.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
3 changes: 3 additions & 0 deletions bin/chrome.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

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 /usr/bin/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 "$@"
3 changes: 0 additions & 3 deletions bin/chromium-browser.sh

This file was deleted.

Loading