Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into pr/andy-kru/485
Browse files Browse the repository at this point in the history
  • Loading branch information
ppodgorsek committed Jul 11, 2024
2 parents be7a3f1 + 066848b commit 3302dbd
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 176 deletions.
133 changes: 4 additions & 129 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: Docker
name: Robot Framework in Docker

on:
push:
# Publish `master` as Docker `latest` image.
# Release branches will trigger the creation of a git tag if the build is successful
branches:
- master

# Publish `v1.2.3` tags as releases.
tags:
- '*'
- release/*

# Run tests for any PRs.
pull_request:
Expand All @@ -27,6 +25,7 @@ jobs:
matrix:
include:
- browser: "chrome"
- browser: "edge"
- browser: "firefox"
env:
BROWSER: ${{ matrix.browser }}
Expand Down Expand Up @@ -155,127 +154,3 @@ jobs:
-e BROWSER=$BROWSER \
-e TZ="America/New_York" \
$IMAGE_NAME
# Build and run tests for Microsoft Edge.
# This must be processed separately from Firefox and Chrome, due to the Browser library not handling Microsoft Edge by default
# and having no easy way to install new browsers unfortunately.
build-microsoft-edge:
runs-on: ubuntu-latest
env:
BROWSER: "edge"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build image
run:
podman build . --tag $IMAGE_NAME --file Dockerfile
- name: Basic Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
-e BROWSER=$BROWSER \
$IMAGE_NAME
- name: Test dependency installation
run: |
podman run --shm-size=1g \
-v `pwd`/test/pip-dependencies/main.robot:/opt/robotframework/tests/pip-dependencies.robot:Z \
-v `pwd`/test/pip-dependencies/requirements.txt:/opt/robotframework/pip-requirements.txt:Z \
-e BROWSER=$BROWSER \
$IMAGE_NAME
- name: Colour Depth 16 Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-e BROWSER=$BROWSER \
-e SCREEN_COLOUR_DEPTH=16 \
$IMAGE_NAME
- name: Screen Width 800x600 Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-e BROWSER=$BROWSER \
-e SCREEN_WIDTH=800 \
-e SCREEN_HEIGHT=600 \
$IMAGE_NAME
- name: Screen Width 1024x768 Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-e BROWSER=$BROWSER \
-e SCREEN_WIDTH=1024 \
-e SCREEN_HEIGHT=768 \
$IMAGE_NAME
- name: Screen Width 1280x1024 Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-e BROWSER=$BROWSER \
-e SCREEN_WIDTH=1280 \
-e SCREEN_HEIGHT=1024 \
$IMAGE_NAME
- name: Screen Width 2560x1440 Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-e BROWSER=$BROWSER \
-e SCREEN_WIDTH=2560 \
-e SCREEN_HEIGHT=1440 \
$IMAGE_NAME
- name: Screen Width 3840x2160 Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-e BROWSER=$BROWSER \
-e SCREEN_WIDTH=3840 \
-e SCREEN_HEIGHT=2160 \
$IMAGE_NAME
- name: Debug Log Level Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
-e BROWSER=$BROWSER \
-e ROBOT_OPTIONS="--loglevel DEBUG" \
$IMAGE_NAME
- name: Basic Multithreaded Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
-e BROWSER=$BROWSER \
-e ROBOT_THREADS=4 \
$IMAGE_NAME
- name: Test Level Multithreaded Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
-e BROWSER=$BROWSER \
-e ROBOT_THREADS=4 \
-e PABOT_OPTIONS="--testlevelsplit" \
$IMAGE_NAME
- name: Custom User Test
run: |
podman run --user=2000 --shm-size=1g \
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
-e BROWSER=$BROWSER \
$IMAGE_NAME
- name: Custom User and Group Test
run: |
podman run --user=2000:2000 --shm-size=1g \
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
-e BROWSER=$BROWSER \
$IMAGE_NAME
- name: Datetime
run: |
podman run --user=2000:2000 --shm-size=1g \
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
-e BROWSER=$BROWSER \
-e TZ="America/New_York" \
$IMAGE_NAME
40 changes: 17 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fedora:39
FROM fedora:40

MAINTAINER Paul Podgorsek <[email protected]>
LABEL description Robot Framework in Docker.
Expand Down Expand Up @@ -32,22 +32,22 @@ ENV ROBOT_UID 1000
ENV ROBOT_GID 1000

# Dependency versions
ENV AWS_CLI_VERSION 1.32.36
ENV AWS_CLI_VERSION 1.33.23
ENV AXE_SELENIUM_LIBRARY_VERSION 2.1.6
ENV BROWSER_LIBRARY_VERSION 18.0.0
ENV BROWSER_LIBRARY_VERSION 18.6.3
ENV CHROME_VERSION 123.0.6312.122
ENV DATABASE_LIBRARY_VERSION 1.4.3
ENV DATADRIVER_VERSION 1.10.0
ENV DATABASE_LIBRARY_VERSION 1.4.4
ENV DATADRIVER_VERSION 1.11.2
ENV DATETIMETZ_VERSION 1.0.6
ENV MICROSOFT_EDGE_VERSION 121.0.2277.106
ENV MICROSOFT_EDGE_VERSION 126.0.2592.87
ENV FAKER_VERSION 5.0.0
ENV FIREFOX_VERSION 125.0
ENV FIREFOX_VERSION 128.0
ENV FTP_LIBRARY_VERSION 1.9
ENV GECKO_DRIVER_VERSION v0.33.0
ENV IMAP_LIBRARY_VERSION 0.4.6
ENV PABOT_VERSION 2.18.0
ENV REQUESTS_VERSION 0.9.6
ENV ROBOT_FRAMEWORK_VERSION 7.0
ENV REQUESTS_VERSION 0.9.7
ENV ROBOT_FRAMEWORK_VERSION 7.0.1
ENV SELENIUM_LIBRARY_VERSION 6.2.0
ENV SSH_LIBRARY_VERSION 3.8.0
ENV XVFB_VERSION 1.20
Expand All @@ -64,16 +64,17 @@ COPY bin/run-tests-in-virtual-screen.sh /opt/robotframework/bin/
RUN dnf upgrade -y --refresh \
&& dnf install -y \
dbus-glib \
dnf-plugins-core \
firefox-${FIREFOX_VERSION}* \
gcc \
gcc-c++ \
npm \
nodejs \
npm \
python3-pip \
python3-pyyaml \
tzdata \
wget \
xorg-x11-server-Xvfb-${XVFB_VERSION}* \
dnf-plugins-core \
&& dnf clean all

# Install Chrome for Testing with dependencies
Expand Down Expand Up @@ -123,26 +124,18 @@ RUN pip3 install \
selenium==4.9.0

# Gecko drivers
RUN dnf install -y \
wget \

# Download Gecko drivers directly from the GitHub repository
&& wget -q "https://github.com/mozilla/geckodriver/releases/download/$GECKO_DRIVER_VERSION/geckodriver-$GECKO_DRIVER_VERSION-linux64.tar.gz" \
# Download Gecko drivers directly from the GitHub repository
RUN wget -q "https://github.com/mozilla/geckodriver/releases/download/$GECKO_DRIVER_VERSION/geckodriver-$GECKO_DRIVER_VERSION-linux64.tar.gz" \
&& tar xzf geckodriver-$GECKO_DRIVER_VERSION-linux64.tar.gz \
&& mkdir -p /opt/robotframework/drivers/ \
&& mv geckodriver /opt/robotframework/drivers/geckodriver \
&& rm geckodriver-$GECKO_DRIVER_VERSION-linux64.tar.gz \

&& dnf remove -y \
wget \
&& dnf clean all
&& rm geckodriver-$GECKO_DRIVER_VERSION-linux64.tar.gz

# Install Microsoft Edge & webdriver
RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \
&& dnf config-manager --add-repo https://packages.microsoft.com/yumrepos/edge \
&& dnf install -y \
microsoft-edge-stable-${MICROSOFT_EDGE_VERSION} \
wget \
zip \

&& wget -q "https://msedgedriver.azureedge.net/${MICROSOFT_EDGE_VERSION}/edgedriver_linux64.zip" \
Expand All @@ -158,7 +151,8 @@ RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \
ENV PATH=/opt/microsoft/msedge:$PATH

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

# Create the default report and work folders with the default user to avoid runtime issues
# These folders are writeable by anyone, to ensure the user can be changed on the command line.
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@ The versioning of this image follows the one of Robot Framework:

The versions used are:

* [Robot Framework](https://github.com/robotframework/robotframework) 7.0
* [Robot Framework Browser (Playwright) Library](https://github.com/MarketSquare/robotframework-browser) 18.0.0
* [Robot Framework DatabaseLibrary](https://github.com/franz-see/Robotframework-Database-Library) 1.4.3
* [Robot Framework Datadriver](https://github.com/Snooz82/robotframework-datadriver) 1.10.0
* [Robot Framework](https://github.com/robotframework/robotframework) 7.0.1
* [Robot Framework Browser (Playwright) Library](https://github.com/MarketSquare/robotframework-browser) 18.6.3
* [Robot Framework DatabaseLibrary](https://github.com/franz-see/Robotframework-Database-Library) 1.4.4
* [Robot Framework Datadriver](https://github.com/Snooz82/robotframework-datadriver) 1.11.2
* [Robot Framework DateTimeTZ](https://github.com/testautomation/DateTimeTZ) 1.0.6
* [Robot Framework Faker](https://github.com/guykisel/robotframework-faker) 5.0.0
* [Robot Framework FTPLibrary](https://github.com/kowalpy/Robot-Framework-FTP-Library) 1.9
* [Robot Framework IMAPLibrary 2](https://pypi.org/project/robotframework-imaplibrary2/) 0.4.6
* [Robot Framework Pabot](https://github.com/mkorpela/pabot) 2.18.0
* [Robot Framework Requests](https://github.com/bulkan/robotframework-requests) 0.9.6
* [Robot Framework Requests](https://github.com/bulkan/robotframework-requests) 0.9.7
* [Robot Framework SeleniumLibrary](https://github.com/robotframework/SeleniumLibrary) 6.2.0
* [Robot Framework SSHLibrary](https://github.com/robotframework/SSHLibrary) 3.8.0
* [Axe Selenium Library](https://github.com/mozilla-services/axe-selenium-python) 2.1.6
* Firefox 124.0
* Firefox 128.0
* Chrome for Testing 123.0
* Microsoft Edge 121.0.2277.106
* [Amazon AWS CLI](https://pypi.org/project/awscli/) 1.32.36
* Microsoft Edge 126.0.2592.87
* [Amazon AWS CLI](https://pypi.org/project/awscli/) 1.33.23

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.

Expand Down
24 changes: 8 additions & 16 deletions test/browser-library.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,25 @@ Library Browser

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

*** Test Cases ***
Visit Bing
IF "${BROWSER}" == 'chrome'
New Browser chromium
ELSE
New Browser ${BROWSER}
END
Run Keyword If "${BROWSER}" == 'chrome' or "${BROWSER}" == 'edge' New Browser chromium
Run Keyword If "${BROWSER}" != 'chrome' and "${BROWSER}" != 'edge' New Browser browser=${BROWSER}
New Page https://www.bing.com
Take Screenshot

Visit Google
IF "${BROWSER}" == 'chrome'
New Browser chromium
ELSE
New Browser ${BROWSER}
END
Run Keyword If "${BROWSER}" == 'chrome' or "${BROWSER}" == 'edge' New Browser chromium
Run Keyword If "${BROWSER}" != 'chrome' and "${BROWSER}" != 'edge' New Browser browser=${BROWSER}
New Page https://www.google.com
Take Screenshot

Visit Yahoo
IF "${BROWSER}" == 'chrome'
New Browser chromium
ELSE
New Browser ${BROWSER}
END
Run Keyword If "${BROWSER}" == 'chrome' or "${BROWSER}" == 'edge' New Browser chromium
Run Keyword If "${BROWSER}" != 'chrome' and "${BROWSER}" != 'edge' New Browser browser=${BROWSER}
New Page https://search.yahoo.com
Take Screenshot

0 comments on commit 3302dbd

Please sign in to comment.