diff --git a/Dockerfile b/Dockerfile index 5d6597d..c626cdb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM fedora:40 -MAINTAINER Paul Podgorsek +LABEL authors Paul Podgorsek LABEL description Robot Framework in Docker. # Set the Python dependencies' directory environment variable @@ -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 @@ -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}* \ @@ -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 \ @@ -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 \ diff --git a/README.md b/README.md index 1e923ef..bba1b4c 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/bin/chrome.sh b/bin/chrome.sh new file mode 100755 index 0000000..09cfc7e --- /dev/null +++ b/bin/chrome.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec /chrome/linux-${CHROME_VERSION}/chrome-linux64/chrome --disable-gpu --no-sandbox "$@" diff --git a/bin/chromedriver.sh b/bin/chromedriver.sh index 4e16199..5971a3c 100755 --- a/bin/chromedriver.sh +++ b/bin/chromedriver.sh @@ -1,3 +1,3 @@ #!/bin/sh -exec /usr/bin/chromedriver --verbose --log-path=/var/log/chromedriver --no-sandbox "$@" \ No newline at end of file +exec /chromedriver/linux-${CHROME_VERSION}/chromedriver-linux64/chromedriver --verbose --log-path=/var/log/chromedriver --no-sandbox "$@" diff --git a/bin/chromium-browser.sh b/bin/chromium-browser.sh deleted file mode 100755 index 59f8bc7..0000000 --- a/bin/chromium-browser.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec /usr/lib64/chromium-browser/chromium-browser-original --disable-gpu --no-sandbox "$@"