Skip to content

Commit ca57193

Browse files
committed
Issue #352 - Add support for Microsoft Edge
* Merged the latest changes from the master branch * Fixed issues with the CI tests, as the Browser library currently doesn't support Microsoft Edge by default
1 parent 2a66579 commit ca57193

File tree

3 files changed

+158
-10
lines changed

3 files changed

+158
-10
lines changed

.github/workflows/docker-build.yml

Lines changed: 148 additions & 2 deletions
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
@@ -28,7 +28,6 @@ jobs:
2828
include:
2929
- browser: "chrome"
3030
- browser: "firefox"
31-
- browser: "edge"
3231
env:
3332
BROWSER: ${{ matrix.browser }}
3433
steps:
@@ -76,3 +75,150 @@ jobs:
7675
- name: Datetime
7776
run:
7877
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+
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+
docker 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+
test
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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +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 EDGE_VERSION 101.0.1210.39
39+
ENV MICROSOFT_EDGE_VERSION 116.0.1938.69
4040
ENV FAKER_VERSION 5.0.0
4141
ENV FIREFOX_VERSION 117.0
4242
ENV FTP_LIBRARY_VERSION 1.9
@@ -119,23 +119,23 @@ RUN dnf install -y \
119119
# Install Microsoft Edge & webdriver
120120
RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \
121121
&& dnf config-manager --add-repo https://packages.microsoft.com/yumrepos/edge \
122-
&& dnf makecache \
123122
&& dnf install -y \
124-
microsoft-edge-stable-${EDGE_VERSION} \
123+
microsoft-edge-stable-${MICROSOFT_EDGE_VERSION} \
125124
wget \
126125
zip \
127126

128-
&& wget -q "https://msedgedriver.azureedge.net/${EDGE_VERSION}/edgedriver_linux64.zip" \
127+
&& wget -q "https://msedgedriver.azureedge.net/${MICROSOFT_EDGE_VERSION}/edgedriver_linux64.zip" \
129128
&& unzip edgedriver_linux64.zip -d edge \
130-
&& mv edge/msedgedriver /opt/robotframework/drivers/ \
129+
&& mv edge/msedgedriver /opt/robotframework/drivers/msedgedriver \
131130
&& rm -Rf edgedriver_linux64.zip edge/ \
132131

133-
# IMPORTANT: don't remove the wget package because it's a dependency of Microsoft Edge
132+
# IMPORTANT: don't remove the wget package because it's a dependency of Microsoft Edge
134133
&& dnf remove -y \
135134
zip \
136135
&& dnf clean all
137136

138-
# Install the Node dependencies for the Browser library
137+
ENV PATH=/opt/microsoft/msedge:$PATH
138+
139139
# FIXME: Playright currently doesn't support relying on system browsers, which is why the `--skip-browsers` parameter cannot be used here.
140140
RUN rfbrowser init
141141

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +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-
* Edge 101.0.1210.39
33+
* Microsoft Edge 116.0.1938.69
3434
* [Amazon AWS CLI](https://pypi.org/project/awscli/) 1.29.40
3535

3636
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.
@@ -50,6 +50,8 @@ Browsers can be easily switched. It is recommended to define `${BROWSER} %{BROWS
5050

5151
When running your tests, simply add `-e BROWSER=chrome`, `-e BROWSER=firefox` or `-e BROWSER=edge`to the run command.
5252

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.
54+
5355
### Changing the container's screen resolution
5456

5557
It is possible to define the settings of the virtual screen in which the browser is run by changing several environment variables:

0 commit comments

Comments
 (0)