Skip to content

Commit 55367fa

Browse files
authored
Merge pull request #449 from ppodgorsek/feature/352
Issue #352 - Add support for Microsoft Edge
2 parents 208d68e + a2d482d commit 55367fa

File tree

3 files changed

+190
-19
lines changed

3 files changed

+190
-19
lines changed

.github/workflows/docker-build.yml

+162-15
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ env:
1818
IMAGE_NAME: docker-robot-framework:ci
1919

2020
jobs:
21-
# Run tests.
21+
# Build and run tests.
2222
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
2323
build:
2424
runs-on: ubuntu-latest
@@ -35,43 +35,190 @@ jobs:
3535
uses: actions/checkout@v2
3636
- name: Build image
3737
run:
38-
docker build . --tag $IMAGE_NAME --file Dockerfile
38+
podman build . --tag $IMAGE_NAME --file Dockerfile
3939
- name: Basic Test
4040
run:
41-
docker run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER $IMAGE_NAME
41+
podman run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER $IMAGE_NAME
4242
- name: Colour Depth 16 Test
4343
run:
44-
docker run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e SCREEN_COLOUR_DEPTH=16 $IMAGE_NAME
44+
podman run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e SCREEN_COLOUR_DEPTH=16 $IMAGE_NAME
4545
- name: Screen Width 800x600 Test
4646
run:
47-
docker run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e SCREEN_WIDTH=800 -e SCREEN_HEIGHT=600 $IMAGE_NAME
47+
podman run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e SCREEN_WIDTH=800 -e SCREEN_HEIGHT=600 $IMAGE_NAME
4848
- name: Screen Width 1024x768 Test
4949
run:
50-
docker run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e SCREEN_WIDTH=1024 -e SCREEN_HEIGHT=768 $IMAGE_NAME
50+
podman run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e SCREEN_WIDTH=1024 -e SCREEN_HEIGHT=768 $IMAGE_NAME
5151
- name: Screen Width 1280x1024 Test
5252
run:
53-
docker run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e SCREEN_WIDTH=1280 -e SCREEN_HEIGHT=1024 $IMAGE_NAME
53+
podman run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e SCREEN_WIDTH=1280 -e SCREEN_HEIGHT=1024 $IMAGE_NAME
5454
- name: Screen Width 2560x1440 Test
5555
run:
56-
docker run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e SCREEN_WIDTH=2560 -e SCREEN_HEIGHT=1440 $IMAGE_NAME
56+
podman run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e SCREEN_WIDTH=2560 -e SCREEN_HEIGHT=1440 $IMAGE_NAME
5757
- name: Screen Width 3840x2160 Test
5858
run:
59-
docker run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e SCREEN_WIDTH=3840 -e SCREEN_HEIGHT=2160 $IMAGE_NAME
59+
podman run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e SCREEN_WIDTH=3840 -e SCREEN_HEIGHT=2160 $IMAGE_NAME
6060
- name: Debug Log Level Test
6161
run:
62-
docker run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e ROBOT_OPTIONS="--loglevel DEBUG" $IMAGE_NAME
62+
podman run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e ROBOT_OPTIONS="--loglevel DEBUG" $IMAGE_NAME
6363
- name: Basic Multithreaded Test
6464
run:
65-
docker run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e ROBOT_THREADS=4 $IMAGE_NAME
65+
podman run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e ROBOT_THREADS=4 $IMAGE_NAME
6666
- name: Test Level Multithreaded Test
6767
run:
68-
docker run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e ROBOT_THREADS=4 -e PABOT_OPTIONS="--testlevelsplit" $IMAGE_NAME
68+
podman run --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER -e ROBOT_THREADS=4 -e PABOT_OPTIONS="--testlevelsplit" $IMAGE_NAME
6969
- name: Custom User Test
7070
run:
71-
docker run --user=2000 --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER $IMAGE_NAME
71+
podman run --user=2000 --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER $IMAGE_NAME
7272
- name: Custom User and Group Test
7373
run:
74-
docker run --user=2000:2000 --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER $IMAGE_NAME
74+
podman run --user=2000:2000 --shm-size=1g -v `pwd`/test:/opt/robotframework/tests:Z -e BROWSER=$BROWSER $IMAGE_NAME
7575
- name: Datetime
7676
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
77+
podman 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+
79+
# Build and run tests for Microsoft Edge.
80+
# This must be processed separately from Firefox and Chrome, due to the Browser library not handling Microsoft Edge by default
81+
# and having no easy way to install new browsers unfortunately.
82+
build-microsoft-edge:
83+
runs-on: ubuntu-latest
84+
env:
85+
BROWSER: "edge"
86+
steps:
87+
- name: Checkout
88+
uses: actions/checkout@v2
89+
- name: Build image
90+
run:
91+
podman build . --tag $IMAGE_NAME --file Dockerfile
92+
- name: Basic Test
93+
run: |
94+
podman run --shm-size=1g \
95+
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
96+
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
97+
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
98+
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
99+
-e BROWSER=$BROWSER \
100+
$IMAGE_NAME
101+
- name: Colour Depth 16 Test
102+
run: |
103+
podman run --shm-size=1g \
104+
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
105+
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
106+
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
107+
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
108+
-e BROWSER=$BROWSER \
109+
-e SCREEN_COLOUR_DEPTH=16 \
110+
$IMAGE_NAME
111+
- name: Screen Width 800x600 Test
112+
run: |
113+
podman run --shm-size=1g \
114+
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
115+
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
116+
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
117+
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
118+
-e BROWSER=$BROWSER \
119+
-e SCREEN_WIDTH=800 \
120+
-e SCREEN_HEIGHT=600 \
121+
$IMAGE_NAME
122+
- name: Screen Width 1024x768 Test
123+
run: |
124+
podman run --shm-size=1g \
125+
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
126+
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
127+
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
128+
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
129+
-e BROWSER=$BROWSER \
130+
-e SCREEN_WIDTH=1024 \
131+
-e SCREEN_HEIGHT=768 \
132+
$IMAGE_NAME
133+
- name: Screen Width 1280x1024 Test
134+
run: |
135+
podman run --shm-size=1g \
136+
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
137+
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
138+
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
139+
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
140+
-e BROWSER=$BROWSER \
141+
-e SCREEN_WIDTH=1280 \
142+
-e SCREEN_HEIGHT=1024 \
143+
$IMAGE_NAME
144+
- name: Screen Width 2560x1440 Test
145+
run: |
146+
podman run --shm-size=1g \
147+
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
148+
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
149+
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
150+
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
151+
-e BROWSER=$BROWSER \
152+
-e SCREEN_WIDTH=2560 \
153+
-e SCREEN_HEIGHT=1440 \
154+
$IMAGE_NAME
155+
- name: Screen Width 3840x2160 Test
156+
run: |
157+
podman run --shm-size=1g \
158+
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
159+
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
160+
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
161+
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
162+
-e BROWSER=$BROWSER \
163+
-e SCREEN_WIDTH=3840 \
164+
-e SCREEN_HEIGHT=2160 \
165+
$IMAGE_NAME
166+
- name: Debug Log Level Test
167+
run: |
168+
podman run --shm-size=1g \
169+
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
170+
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
171+
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
172+
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
173+
-e BROWSER=$BROWSER \
174+
-e ROBOT_OPTIONS="--loglevel DEBUG" \
175+
$IMAGE_NAME
176+
- name: Basic Multithreaded Test
177+
run: |
178+
podman run --shm-size=1g \
179+
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
180+
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
181+
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
182+
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
183+
-e BROWSER=$BROWSER \
184+
-e ROBOT_THREADS=4 \
185+
$IMAGE_NAME
186+
- name: Test Level Multithreaded Test
187+
run: |
188+
podman run --shm-size=1g \
189+
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
190+
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
191+
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
192+
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
193+
-e BROWSER=$BROWSER \
194+
-e ROBOT_THREADS=4 \
195+
-e PABOT_OPTIONS="--testlevelsplit" \
196+
$IMAGE_NAME
197+
- name: Custom User Test
198+
run: |
199+
podman run --user=2000 --shm-size=1g \
200+
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
201+
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
202+
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
203+
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
204+
-e BROWSER=$BROWSER \
205+
$IMAGE_NAME
206+
- name: Custom User and Group Test
207+
run: |
208+
podman run --user=2000:2000 --shm-size=1g \
209+
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
210+
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
211+
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
212+
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
213+
-e BROWSER=$BROWSER \
214+
$IMAGE_NAME
215+
- name: Datetime
216+
run: |
217+
podman run --user=2000:2000 --shm-size=1g \
218+
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
219+
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
220+
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
221+
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
222+
-e BROWSER=$BROWSER \
223+
-e TZ="America/New_York" \
224+
$IMAGE_NAME

Dockerfile

+22-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ ENV CHROMIUM_VERSION 116.0
3636
ENV DATABASE_LIBRARY_VERSION 1.2.4
3737
ENV DATADRIVER_VERSION 1.8.1
3838
ENV DATETIMETZ_VERSION 1.0.6
39+
ENV MICROSOFT_EDGE_VERSION 116.0.1938.69
3940
ENV FAKER_VERSION 5.0.0
4041
ENV FIREFOX_VERSION 117.0
4142
ENV FTP_LIBRARY_VERSION 1.9
@@ -70,6 +71,7 @@ RUN dnf upgrade -y --refresh \
7071
python3-pyyaml \
7172
tzdata \
7273
xorg-x11-server-Xvfb-${XVFB_VERSION}* \
74+
dnf-plugins-core \
7375
&& dnf clean all
7476

7577
# FIXME: below is a workaround, as the path is ignored
@@ -114,7 +116,26 @@ RUN dnf install -y \
114116
wget \
115117
&& dnf clean all
116118

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

README.md

+6-3
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 Microsoft 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, Microsoft 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 117.0
3232
* Chromium 116.0
33+
* Microsoft Edge 116.0.1938.69
3334
* [Amazon AWS CLI](https://pypi.org/project/awscli/) 1.29.40
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,9 @@ 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.
52+
53+
Please note: `edge` will work with Selenium but not the Browser Library, as the latter currently doesn't have an easy mechanism to install additional browsers. Playwright, on which the Browser library relies, cannot install additional browsers on Linux platforms other than Ubuntu/Debian and [suggests using Chromium to test Microsoft Edge scenarios](https://playwright.dev/docs/browsers), unless you require Edge-specific capabilities.
5154

5255
### Changing the container's screen resolution
5356

0 commit comments

Comments
 (0)