Skip to content

Commit 274953d

Browse files
authored
Issue #344 - Support the Browser library (#347)
1 parent ed8af16 commit 274953d

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ ENV ROBOT_GID 1000
3232
ENV ALPINE_GLIBC 2.31-r0
3333
ENV AWS_CLI_VERSION 1.19.27
3434
ENV AXE_SELENIUM_LIBRARY_VERSION 2.1.6
35+
ENV BROWSER_LIBRARY_VERSION 4.1.0
3536
ENV CHROMIUM_VERSION 86.0
3637
ENV DATABASE_LIBRARY_VERSION 1.2
3738
ENV DATADRIVER_VERSION 1.0.0
@@ -79,6 +80,8 @@ RUN apk update \
7980
"chromium~$CHROMIUM_VERSION" \
8081
"chromium-chromedriver~$CHROMIUM_VERSION" \
8182
"firefox-esr~$FIREFOX_VERSION" \
83+
nodejs \
84+
nodejs-npm \
8285
xauth \
8386
tzdata \
8487
"xvfb-run~$XVFB_VERSION" \
@@ -90,6 +93,7 @@ RUN apk update \
9093
&& pip3 install \
9194
--no-cache-dir \
9295
robotframework==$ROBOT_FRAMEWORK_VERSION \
96+
robotframework-browser==$BROWSER_LIBRARY_VERSION \
9397
robotframework-databaselibrary==$DATABASE_LIBRARY_VERSION \
9498
robotframework-datadriver==$DATADRIVER_VERSION \
9599
robotframework-datadriver[XLS] \
@@ -107,6 +111,9 @@ RUN apk update \
107111
# Install awscli to be able to upload test reports to AWS S3
108112
awscli==$AWS_CLI_VERSION \
109113

114+
# Install the node dependencies for the Browser library
115+
&& rfbrowser init \
116+
110117
# Download the glibc package for Alpine Linux from its GitHub repository
111118
&& wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
112119
&& wget -q "https://github.com/sgerrand/alpine-pkg-glibc/releases/download/$ALPINE_GLIBC/glibc-$ALPINE_GLIBC.apk" \

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The versioning of this image follows the one of Robot Framework:
1616
The versions used are:
1717

1818
* [Robot Framework](https://github.com/robotframework/robotframework) 4.0
19+
* [Robot Framework Browser Library](https://github.com/MarketSquare/robotframework-browser) 4.1.0
1920
* [Robot Framework DatabaseLibrary](https://github.com/franz-see/Robotframework-Database-Library) 1.2
2021
* [Robot Framework Datadriver](https://github.com/Snooz82/robotframework-datadriver) 1.0.0
2122
* [Robot Framework DateTimeTZ](https://github.com/testautomation/DateTimeTZ) 1.0.6

test/browser-library.robot

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
*** Settings ***
2+
Library Browser
3+
4+
*** Variables ***
5+
# 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.
7+
${BROWSER} firefox
8+
9+
*** Test Cases ***
10+
Visit Baidu
11+
New Browser ${BROWSER}
12+
New Page https://www.baidu.com
13+
Take Screenshot
14+
15+
Visit Bing
16+
New Browser ${BROWSER}
17+
New Page https://www.bing.com
18+
Take Screenshot
19+
20+
Visit Google
21+
New Browser ${BROWSER}
22+
New Page https://www.google.com
23+
Take Screenshot
24+
25+
Visit Yahoo
26+
New Browser ${BROWSER}
27+
New Page https://search.yahoo.com
28+
Take Screenshot

0 commit comments

Comments
 (0)