Skip to content

Commit

Permalink
Support Microsoft Edge browser
Browse files Browse the repository at this point in the history
fixes #352
  • Loading branch information
jeabakker committed May 23, 2022
1 parent 1dcd9c4 commit be17f71
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
include:
- browser: "chrome"
- browser: "firefox"
- browser: "edge"
env:
BROWSER: ${{ matrix.browser }}
steps:
Expand Down Expand Up @@ -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
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
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -110,6 +112,25 @@ RUN dnf install -y \
wget \
&& dnf clean all

# Install Microsoft Edge & webdriver
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 edgedriver_linux64.zip edge/ \

# IMPORTANT: don't remove the wget package because it's a dependency of Microsoft Edge
&& dnf remove -y \
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 \
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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.
Expand All @@ -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

Expand Down

0 comments on commit be17f71

Please sign in to comment.