Skip to content

Commit 4a53970

Browse files
committed
Issue #492 - Upgrade the Browser library to version 18.6.3
* Addressed issues with the Browser library, which cannot handle Microsoft Edge nor local browser installations
1 parent 9b2fe8a commit 4a53970

File tree

3 files changed

+14
-146
lines changed

3 files changed

+14
-146
lines changed

.github/workflows/docker-build.yml

Lines changed: 4 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
name: Docker
1+
name: Robot Framework in Docker
22

33
on:
44
push:
55
# Publish `master` as Docker `latest` image.
6+
# Release branches will trigger the creation of a git tag if the build is successful
67
branches:
78
- master
8-
9-
# Publish `v1.2.3` tags as releases.
10-
tags:
11-
- '*'
9+
- release/*
1210

1311
# Run tests for any PRs.
1412
pull_request:
@@ -27,6 +25,7 @@ jobs:
2725
matrix:
2826
include:
2927
- browser: "chrome"
28+
- browser: "edge"
3029
- browser: "firefox"
3130
env:
3231
BROWSER: ${{ matrix.browser }}
@@ -155,127 +154,3 @@ jobs:
155154
-e BROWSER=$BROWSER \
156155
-e TZ="America/New_York" \
157156
$IMAGE_NAME
158-
159-
# Build and run tests for Microsoft Edge.
160-
# This must be processed separately from Firefox and Chrome, due to the Browser library not handling Microsoft Edge by default
161-
# and having no easy way to install new browsers unfortunately.
162-
build-microsoft-edge:
163-
runs-on: ubuntu-latest
164-
env:
165-
BROWSER: "edge"
166-
steps:
167-
- name: Checkout
168-
uses: actions/checkout@v2
169-
- name: Build image
170-
run:
171-
podman build . --tag $IMAGE_NAME --file Dockerfile
172-
- name: Basic Test
173-
run: |
174-
podman run --shm-size=1g \
175-
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
176-
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
177-
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
178-
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
179-
-e BROWSER=$BROWSER \
180-
$IMAGE_NAME
181-
- name: Test dependency installation
182-
run: |
183-
podman run --shm-size=1g \
184-
-v `pwd`/test/pip-dependencies/main.robot:/opt/robotframework/tests/pip-dependencies.robot:Z \
185-
-v `pwd`/test/pip-dependencies/requirements.txt:/opt/robotframework/pip-requirements.txt:Z \
186-
-e BROWSER=$BROWSER \
187-
$IMAGE_NAME
188-
- name: Colour Depth 16 Test
189-
run: |
190-
podman run --shm-size=1g \
191-
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
192-
-e BROWSER=$BROWSER \
193-
-e SCREEN_COLOUR_DEPTH=16 \
194-
$IMAGE_NAME
195-
- name: Screen Width 800x600 Test
196-
run: |
197-
podman run --shm-size=1g \
198-
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
199-
-e BROWSER=$BROWSER \
200-
-e SCREEN_WIDTH=800 \
201-
-e SCREEN_HEIGHT=600 \
202-
$IMAGE_NAME
203-
- name: Screen Width 1024x768 Test
204-
run: |
205-
podman run --shm-size=1g \
206-
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
207-
-e BROWSER=$BROWSER \
208-
-e SCREEN_WIDTH=1024 \
209-
-e SCREEN_HEIGHT=768 \
210-
$IMAGE_NAME
211-
- name: Screen Width 1280x1024 Test
212-
run: |
213-
podman run --shm-size=1g \
214-
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
215-
-e BROWSER=$BROWSER \
216-
-e SCREEN_WIDTH=1280 \
217-
-e SCREEN_HEIGHT=1024 \
218-
$IMAGE_NAME
219-
- name: Screen Width 2560x1440 Test
220-
run: |
221-
podman run --shm-size=1g \
222-
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
223-
-e BROWSER=$BROWSER \
224-
-e SCREEN_WIDTH=2560 \
225-
-e SCREEN_HEIGHT=1440 \
226-
$IMAGE_NAME
227-
- name: Screen Width 3840x2160 Test
228-
run: |
229-
podman run --shm-size=1g \
230-
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
231-
-e BROWSER=$BROWSER \
232-
-e SCREEN_WIDTH=3840 \
233-
-e SCREEN_HEIGHT=2160 \
234-
$IMAGE_NAME
235-
- name: Debug Log Level Test
236-
run: |
237-
podman run --shm-size=1g \
238-
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
239-
-e BROWSER=$BROWSER \
240-
-e ROBOT_OPTIONS="--loglevel DEBUG" \
241-
$IMAGE_NAME
242-
- name: Basic Multithreaded Test
243-
run: |
244-
podman run --shm-size=1g \
245-
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
246-
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
247-
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
248-
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
249-
-e BROWSER=$BROWSER \
250-
-e ROBOT_THREADS=4 \
251-
$IMAGE_NAME
252-
- name: Test Level Multithreaded Test
253-
run: |
254-
podman run --shm-size=1g \
255-
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
256-
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
257-
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
258-
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
259-
-e BROWSER=$BROWSER \
260-
-e ROBOT_THREADS=4 \
261-
-e PABOT_OPTIONS="--testlevelsplit" \
262-
$IMAGE_NAME
263-
- name: Custom User Test
264-
run: |
265-
podman run --user=2000 --shm-size=1g \
266-
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
267-
-e BROWSER=$BROWSER \
268-
$IMAGE_NAME
269-
- name: Custom User and Group Test
270-
run: |
271-
podman run --user=2000:2000 --shm-size=1g \
272-
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
273-
-e BROWSER=$BROWSER \
274-
$IMAGE_NAME
275-
- name: Datetime
276-
run: |
277-
podman run --user=2000:2000 --shm-size=1g \
278-
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
279-
-e BROWSER=$BROWSER \
280-
-e TZ="America/New_York" \
281-
$IMAGE_NAME

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \
134134
ENV PATH=/opt/microsoft/msedge:$PATH
135135

136136
# FIXME: Playright currently doesn't support relying on system browsers, which is why the `--skip-browsers` parameter cannot be used here.
137-
RUN rfbrowser init
137+
# Additionally, it cannot run fully on any OS due to https://github.com/microsoft/playwright/issues/29559
138+
RUN rfbrowser init chromium firefox
138139

139140
# Create the default report and work folders with the default user to avoid runtime issues
140141
# These folders are writeable by anyone, to ensure the user can be changed on the command line.

test/browser-library.robot

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,25 @@ Library Browser
33

44
*** Variables ***
55
# There is a conflict between browser names used by Selenium (using "chrome") and Browser (using "chromium")
6-
# This is why the browser is currently fixed for the Browser Library.
6+
# Additionally, the Browser library isn't flexible at all and forbids any branded browser
7+
# See SupportedBrowsers: https://marketsquare.github.io/robotframework-browser/Browser.html#New%20Browser
78
${BROWSER} %{BROWSER}
89

910
*** Test Cases ***
1011
Visit Bing
11-
IF "${BROWSER}" == 'chrome'
12-
New Browser chromium
13-
ELSE
14-
New Browser ${BROWSER}
15-
END
12+
Run Keyword If "${BROWSER}" == 'chrome' or "${BROWSER}" == 'edge' New Browser chromium
13+
Run Keyword If "${BROWSER}" != 'chrome' and "${BROWSER}" != 'edge' New Browser browser=${BROWSER}
1614
New Page https://www.bing.com
1715
Take Screenshot
1816

1917
Visit Google
20-
IF "${BROWSER}" == 'chrome'
21-
New Browser chromium
22-
ELSE
23-
New Browser ${BROWSER}
24-
END
18+
Run Keyword If "${BROWSER}" == 'chrome' or "${BROWSER}" == 'edge' New Browser chromium
19+
Run Keyword If "${BROWSER}" != 'chrome' and "${BROWSER}" != 'edge' New Browser browser=${BROWSER}
2520
New Page https://www.google.com
2621
Take Screenshot
2722

2823
Visit Yahoo
29-
IF "${BROWSER}" == 'chrome'
30-
New Browser chromium
31-
ELSE
32-
New Browser ${BROWSER}
33-
END
24+
Run Keyword If "${BROWSER}" == 'chrome' or "${BROWSER}" == 'edge' New Browser chromium
25+
Run Keyword If "${BROWSER}" != 'chrome' and "${BROWSER}" != 'edge' New Browser browser=${BROWSER}
3426
New Page https://search.yahoo.com
3527
Take Screenshot

0 commit comments

Comments
 (0)