From ea6bf8234d7c93f1d7fb0d3001d949dfd8b30b70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jer=C3=B4me=20Bakker?= Date: Wed, 11 May 2022 15:52:17 +0200 Subject: [PATCH] Support Microsoft Edge browser fixes #352 --- .github/workflows/docker-build.yml | 3 ++- Dockerfile | 22 ++++++++++++++++++++++ README.md | 7 ++++--- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index b3ea5fe..e25ce0a 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -28,6 +28,7 @@ jobs: include: - browser: "chrome" - browser: "firefox" + - browser: "edge" env: BROWSER: ${{ matrix.browser }} steps: @@ -74,4 +75,4 @@ jobs: docker run --user=2000:2000 --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER $IMAGE_NAME - name: Datetime run: - docker run --user=2000:2000 --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e TZ="America/New_York" $IMAGE_NAME \ No newline at end of file + docker run --user=2000:2000 --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e TZ="America/New_York" $IMAGE_NAME diff --git a/Dockerfile b/Dockerfile index 304ae9e..667aa27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,6 +37,7 @@ ENV CHROMIUM_VERSION 99.0 ENV DATABASE_LIBRARY_VERSION 1.2.4 ENV DATADRIVER_VERSION 1.6.0 ENV DATETIMETZ_VERSION 1.0.6 +ENV EDGE_VERSION 101.0.1210.39 ENV FAKER_VERSION 5.0.0 ENV FIREFOX_VERSION 100.0 ENV FTP_LIBRARY_VERSION 1.9 @@ -68,6 +69,7 @@ RUN dnf upgrade -y --refresh \ python3-pip \ tzdata \ xorg-x11-server-Xvfb-${XVFB_VERSION}* \ + dnf-plugins-core \ && dnf clean all # FIXME: below is a workaround, as the path is ignored @@ -110,6 +112,26 @@ RUN dnf install -y \ wget \ && dnf clean all +# Install Microsoft Edge & webdiver +RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \ + && dnf config-manager --add-repo https://packages.microsoft.com/yumrepos/edge \ + && dnf makecache \ + && dnf install -y \ + microsoft-edge-stable-$EDGE_VERSION \ + wget \ + zip \ + + && wget -q "https://msedgedriver.azureedge.net/$EDGE_VERSION/edgedriver_linux64.zip" \ + && unzip edgedriver_linux64.zip -d edge \ + && mv edge/msedgedriver /opt/robotframework/drivers/ \ + && rm -Rf edge/ \ + && rm -f edgedriver_linux64.zip \ + + && dnf remove -y \ + wget \ + zip \ + && dnf clean all + # Install the Node dependencies for the Browser library # FIXME: Playright currently doesn't support relying on system browsers, which is why the `--skip-browsers` parameter cannot be used here. RUN rfbrowser init \ diff --git a/README.md b/README.md index 44a655f..13103da 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# Robot Framework in Docker, with Firefox and Chrome +# Robot Framework in Docker, with Firefox, Chrome and Edge ## What is it? This project consists of a Docker image containing a Robot Framework installation. -This installation also contains Firefox, Chrome and the Selenium library for Robot Framework. The test cases and reports should be mounted as volumes. +This installation also contains Firefox, Chrome, Edge and the Selenium library for Robot Framework. The test cases and reports should be mounted as volumes. ## Versioning @@ -30,6 +30,7 @@ The versions used are: * [Axe Selenium Library](https://github.com/mozilla-services/axe-selenium-python) 2.1.6 * Firefox 100.0 * Chromium 99.0 +* Edge 101.0.1210.39 * [Amazon AWS CLI](https://pypi.org/project/awscli/) 1.22.87 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. @@ -47,7 +48,7 @@ This container can be run using the following command: Browsers can be easily switched. It is recommended to define `${BROWSER} %{BROWSER}` in your Robot variables and to use `${BROWSER}` in your test cases. This allows to set the browser in a single place if needed. -When running your tests, simply add `-e BROWSER=chrome` or `-e BROWSER=firefox` to the run command. +When running your tests, simply add `-e BROWSER=chrome`, `-e BROWSER=firefox` or `-e BROWSER=edge`to the run command. ### Changing the container's screen resolution