Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 0 additions & 110 deletions .github/workflows/dockers.yml

This file was deleted.

75 changes: 68 additions & 7 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ jobs:
inv demo-app
- uses: actions/upload-artifact@v4
with:
name: demoapp--bb-test-${{ matrix.os }}
name: demoapp-bb-test-${{ matrix.os }}
path: zip_results/demoapp
if-no-files-found: error
- name: Create Distributable BrowserBatteries Package
Expand Down Expand Up @@ -389,22 +389,22 @@ jobs:
uses: actions/setup-node@v6
with:
node-version: "22.x"
- name: Download rfbrowser-wheel for BrowserBatteries tests
- name: Download browser-wheel
uses: actions/download-artifact@v5
with:
name: rfbrowser-wheel-bb-test
path: rfbrowser-wheel
- name: Download BrowserBatteries wheels
- name: Download BrowserBatteries wheel
uses: actions/download-artifact@v5
with:
name: browser-batteries-wheels-bb-test-${{ matrix.os }}
path: browser-batteries-wheels
- name: Download demoapp wheels
- name: Download demoapp
uses: actions/download-artifact@v5
with:
name: demoapp--bb-test-${{ matrix.os }}
name: demoapp-bb-test-${{ matrix.os }}
path: demoapp
- name: Install Browser and BrowserBatteries on ${{ matrix.os }}
- name: Install Browser and BrowserBatteries
run: |
python -m pip install --upgrade pip
pip install rfbrowser-wheel/robotframework_browser-*-py3-none-any.whl
Expand All @@ -422,7 +422,7 @@ jobs:
ls -l demoapp
unzip demoapp/demo-app*.zip -d .
- name: Run tests on Linux with packed demoapp
if : matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
run: |
xvfb-run --auto-servernum invoke atest-robot --smoke
- name: Run tests on MacOS with packed demoapp
Expand All @@ -440,3 +440,64 @@ jobs:
python -m GHAReports --robotlog atest/output/output.xml
python -m GHAReports --robotlog atest/output/output.xml --markdown fail.md --no-totals --no-passes --no-skipped --fails --no-warnings
cat fail.md

docker_image:
runs-on: ubuntu-latest
needs: build_browser_batteries_wheels
permissions: write-all
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.14"
cache: 'pip'
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/marketsquare/robotframework-browser/rfbrowser
tags: |
type=raw,value=tidii
- name: Download browser wheel
uses: actions/download-artifact@v5
with:
name: rfbrowser-wheel-bb-test
path: docker/dist
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build with GitHub Packages
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile.dev_pr
tags: tidii
labels: ${{ steps.meta.outputs.labels }}
push: false
- name: Download demo app
uses: actions/download-artifact@v5
with:
name: demoapp-bb-test-ubuntu-latest
path: demoapp
- name: unzip demo app
run: |
rm -rf node
ls -l demoapp
unzip demoapp/demo-app*.zip -d .
ls -l node
- name: Start demo app and run tests with docker image
run: |
pip install uv
uv pip install invoke robotframework-ghareports --python 3.14 --system
invoke run-test-app-no-build --asynchronous
docker run -v ./atest/:/home/pwuser/test -t tidii:latest bash -c "robot -v SERVER:172.17.0.1:7272 --exclude no-docker-pr -L debug --outputdir /home/pwuser/output /home/pwuser/test"
inv docker-copy-output
- name: Github Job Summary
if: ${{ always() }}
run: |
python -m GHAReports --robotlog output_docker/output.xml
python -m GHAReports --robotlog output_docker/output.xml --markdown fail.md --no-totals --no-passes --no-skipped --fails --no-warnings
cat fail.md
99 changes: 99 additions & 0 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,102 @@ jobs:
twine check dist/*
- name: Publish BrowserBatteries distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

docker-image:
needs: publish-browser-to-pypi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up QEMU for cross-platforms builds
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: marketsquare/robotframework-browser
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
flavor: |
latest=true

- name: Push tag :version_number to Docker Hub
uses: docker/build-push-action@v6
with:
tags: ${{ steps.meta.outputs.tags }}
file: docker/Dockerfile.latest_release
platforms: linux/arm64/v8,linux/amd64
push: ${{ github.event_name != 'push' }}

- name: Docker meta
id: meta_github
uses: docker/metadata-action@v5
with:
images: ghcr.io/marketsquare/robotframework-browser/rfbrowser-stable
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
flavor: |
latest=true

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push to GitHub Packages
uses: docker/build-push-action@v6
with:
platforms: linux/arm64/v8,linux/amd64
file: docker/Dockerfile.latest_release
tags: ${{ steps.meta_github.outputs.tags }}
push: ${{ github.event_name != 'push' }}

test-docker-image:
needs: docker-image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: 3.11
cache: 'pip'
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install uv
uv pip install wheel --python 3.11 --system
uv pip install -r Browser/dev-requirements.txt --python 3.11 --system
- name: Install invoke deps
run: |
invoke deps
- name: build testing docker image
run: |
invoke docker-tester
- name: set permissions
run: chmod -R 777 atest/
- name: Run tests with latest stable docker image
# continue on error until all docker tests pass
run: |
invoke docker-test
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: Docker test results
path: atest/output
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ __pycache__
robotframework_browser.egg-info/
.venv
zip_results
mypy_stub

# utest
utest/output
Expand Down
2 changes: 2 additions & 0 deletions atest/test/01_Browser_Management/chromiun_channel.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Resource imports.resource

Suite Teardown Close Browser ALL

Test Tags no-docker-pr

*** Test Cases ***
Wrong Browser With Channel
Run Keyword And Expect Error
Expand Down
2 changes: 2 additions & 0 deletions atest/test/01_Browser_Management/client_certificates.robot
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Suite Setup Setup
Suite Teardown Suite Teardown
Test Teardown Close Browser ALL

Test Tags no-docker-pr

*** Test Cases ***
Open Browser With Client Certificate
New Browser browser=${BROWSER} headless=${HEADLESS}
Expand Down
3 changes: 3 additions & 0 deletions atest/test/01_Browser_Management/geolocation.robot
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@ Force Tags no-iframe

*** Test Cases ***
Set Geolocation On Browser Startup
[Tags] no-docker-pr
Start Context With Geolocation
Check Geolocation 42 -42.42

Set Geolocation
[Tags] no-docker-pr
[Setup] Start Context With Geolocation
Set Geolocation 72.56 145.89 0.23
Check Geolocation 72.56 145.89

Enable Geolocation
[Tags] no-docker-pr
[Setup] Start Context Without Geolocation
Set Browser Timeout timeout=500ms scope=Test
Set Geolocation 11.11 22.22 33.33
Expand Down
4 changes: 3 additions & 1 deletion atest/test/01_Browser_Management/playwright_state.robot
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ New Context Does Not Open A Page
Should Be Equal ${no_page_id} NO PAGE OPEN

Open Browser Opens Everything
[Tags] slow
[Tags] slow no-docker-pr
${old_timeout} = Set Browser Timeout 30 seconds
Open Browser url=${FORM_URL}
Get Title == prefilled_email_form.html
Expand Down Expand Up @@ -262,6 +262,7 @@ New Context With DefaultBrowserType Ff
Set Browser Timeout ${old_timeout}

New Context With baseURL
[Tags] no-docker-pr
New Context baseURL=${ROOT_URL}
New Page dist/#/
Get Url == ${LOGIN_URL}
Expand Down Expand Up @@ -440,6 +441,7 @@ Launch Browser Server Generated wsEndpoint
[Teardown] Close Browser Server ${wsEndpoint}

Launch Browser Server Via CLI
[Tags] no-docker-pr
${python} = Get Python Binary Path
${process1} = Start Process
... ${python}
Expand Down
Loading