Skip to content

Commit be17f71

Browse files
committed
Support Microsoft Edge browser
fixes #352
1 parent 1dcd9c4 commit be17f71

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

.github/workflows/docker-build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
include:
2929
- browser: "chrome"
3030
- browser: "firefox"
31+
- browser: "edge"
3132
env:
3233
BROWSER: ${{ matrix.browser }}
3334
steps:
@@ -74,4 +75,4 @@ jobs:
7475
docker run --user=2000:2000 --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER $IMAGE_NAME
7576
- name: Datetime
7677
run:
77-
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
78+
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

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ ENV CHROMIUM_VERSION 99.0
3737
ENV DATABASE_LIBRARY_VERSION 1.2.4
3838
ENV DATADRIVER_VERSION 1.6.0
3939
ENV DATETIMETZ_VERSION 1.0.6
40+
ENV EDGE_VERSION 101.0.1210.39
4041
ENV FAKER_VERSION 5.0.0
4142
ENV FIREFOX_VERSION 100.0
4243
ENV FTP_LIBRARY_VERSION 1.9
@@ -68,6 +69,7 @@ RUN dnf upgrade -y --refresh \
6869
python3-pip \
6970
tzdata \
7071
xorg-x11-server-Xvfb-${XVFB_VERSION}* \
72+
dnf-plugins-core \
7173
&& dnf clean all
7274

7375
# FIXME: below is a workaround, as the path is ignored
@@ -110,6 +112,25 @@ RUN dnf install -y \
110112
wget \
111113
&& dnf clean all
112114

115+
# Install Microsoft Edge & webdriver
116+
RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \
117+
&& dnf config-manager --add-repo https://packages.microsoft.com/yumrepos/edge \
118+
&& dnf makecache \
119+
&& dnf install -y \
120+
microsoft-edge-stable-${EDGE_VERSION} \
121+
wget \
122+
zip \
123+
124+
&& wget -q "https://msedgedriver.azureedge.net/${EDGE_VERSION}/edgedriver_linux64.zip" \
125+
&& unzip edgedriver_linux64.zip -d edge \
126+
&& mv edge/msedgedriver /opt/robotframework/drivers/ \
127+
&& rm -Rf edgedriver_linux64.zip edge/ \
128+
129+
# IMPORTANT: don't remove the wget package because it's a dependency of Microsoft Edge
130+
&& dnf remove -y \
131+
zip \
132+
&& dnf clean all
133+
113134
# Install the Node dependencies for the Browser library
114135
# FIXME: Playright currently doesn't support relying on system browsers, which is why the `--skip-browsers` parameter cannot be used here.
115136
RUN rfbrowser init \

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Robot Framework in Docker, with Firefox and Chrome
1+
# Robot Framework in Docker, with Firefox, Chrome and Edge
22

33
## What is it?
44

55
This project consists of a Docker image containing a Robot Framework installation.
66

7-
This installation also contains Firefox, Chrome and the Selenium library for Robot Framework. The test cases and reports should be mounted as volumes.
7+
This installation also contains Firefox, Chrome, Edge and the Selenium library for Robot Framework. The test cases and reports should be mounted as volumes.
88

99
## Versioning
1010

@@ -30,6 +30,7 @@ The versions used are:
3030
* [Axe Selenium Library](https://github.com/mozilla-services/axe-selenium-python) 2.1.6
3131
* Firefox 100.0
3232
* Chromium 99.0
33+
* Edge 101.0.1210.39
3334
* [Amazon AWS CLI](https://pypi.org/project/awscli/) 1.22.87
3435

3536
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:
4748

4849
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.
4950

50-
When running your tests, simply add `-e BROWSER=chrome` or `-e BROWSER=firefox` to the run command.
51+
When running your tests, simply add `-e BROWSER=chrome`, `-e BROWSER=firefox` or `-e BROWSER=edge`to the run command.
5152

5253
### Changing the container's screen resolution
5354

0 commit comments

Comments
 (0)