Skip to content

Commit 4bf7b0d

Browse files
committed
Docker PR build
1 parent 7b5e389 commit 4bf7b0d

27 files changed

+244
-31
lines changed

.github/workflows/docker_pr.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Docker CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- '**/*.md'
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
build_browser:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up Python 3.13
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.13'
22+
- name: Use Node.js
23+
uses: actions/setup-node@v5
24+
with:
25+
node-version: 24.x
26+
cache: 'npm'
27+
- name: Install python dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install uv
31+
uv pip install wheel --python 3.13 --system --verbose
32+
uv pip install -r Browser/dev-requirements.txt --python 3.13 --system
33+
uv pip install -r pyproject.toml --python 3.13 --system
34+
inv deps
35+
- name: Build proto
36+
run: |
37+
inv protobuf
38+
- name: Build
39+
run: |
40+
inv build
41+
- name: Build the wheel
42+
run: |
43+
inv create-package
44+
- name: Upload Browser wheel
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: browser-wheel
48+
path: dist/*.whl
49+
- name: Create demo app
50+
run: |
51+
inv demo-app
52+
- name: Pack demo app
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: demoapp
56+
path: zip_results/demoapp
57+
58+
docker-image:
59+
runs-on: ubuntu-latest
60+
needs: build_browser
61+
permissions: write-all
62+
steps:
63+
- uses: actions/checkout@v5
64+
- uses: actions/setup-python@v6
65+
with:
66+
python-version: "3.14"
67+
cache: 'pip'
68+
- name: Docker meta
69+
id: meta
70+
uses: docker/metadata-action@v5
71+
with:
72+
images: ghcr.io/marketsquare/robotframework-browser/rfbrowser
73+
tags: |
74+
type=raw,value=tidii
75+
- name: Download browser wheel
76+
uses: actions/download-artifact@v5
77+
with:
78+
name: browser-wheel
79+
path: docker/dist
80+
- name: Login to GitHub Container Registry
81+
uses: docker/login-action@v3
82+
with:
83+
registry: ghcr.io
84+
username: ${{ github.actor }}
85+
password: ${{ secrets.GITHUB_TOKEN }}
86+
- name: Push to GitHub Packages
87+
uses: docker/build-push-action@v6
88+
with:
89+
context: .
90+
file: docker/Dockerfile.dev_pr
91+
tags: tidii
92+
labels: ${{ steps.meta.outputs.labels }}
93+
push: false
94+
- name: Download demo app
95+
uses: actions/download-artifact@v5
96+
with:
97+
name: demoapp
98+
path: demoapp
99+
- name: unzip demo app
100+
run: |
101+
rm -rf node
102+
ls -l demoapp
103+
unzip demoapp/demo-app*.zip -d .
104+
ls -l node
105+
- name: Start demo app
106+
run: |
107+
pip install uv
108+
uv pip install invoke --python 3.14 --system
109+
invoke run-test-app-no-build --asynchronous
110+
- name: Run tests with docker image
111+
run: |
112+
docker image ls
113+
docker run -v ./atest/:/home/pwuser/test -t tidii:latest bash -c "robot -v SERVER:host.docker.internal:7272 --exclude no-docker-pr -L debug --outputdir /home/pwuser/output /home/pwuser/test"

.github/workflows/on-push.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,22 +389,22 @@ jobs:
389389
uses: actions/setup-node@v6
390390
with:
391391
node-version: "22.x"
392-
- name: Download rfbrowser-wheel for BrowserBatteries tests
392+
- name: Download browser-wheel
393393
uses: actions/download-artifact@v5
394394
with:
395395
name: rfbrowser-wheel-bb-test
396396
path: rfbrowser-wheel
397-
- name: Download BrowserBatteries wheels
397+
- name: Download BrowserBatteries wheel
398398
uses: actions/download-artifact@v5
399399
with:
400400
name: browser-batteries-wheels-bb-test-${{ matrix.os }}
401401
path: browser-batteries-wheels
402-
- name: Download demoapp wheels
402+
- name: Download demoapp
403403
uses: actions/download-artifact@v5
404404
with:
405405
name: demoapp--bb-test-${{ matrix.os }}
406406
path: demoapp
407-
- name: Install Browser and BrowserBatteries on ${{ matrix.os }}
407+
- name: Install Browser and BrowserBatteries
408408
run: |
409409
python -m pip install --upgrade pip
410410
pip install rfbrowser-wheel/robotframework_browser-*-py3-none-any.whl
@@ -422,7 +422,7 @@ jobs:
422422
ls -l demoapp
423423
unzip demoapp/demo-app*.zip -d .
424424
- name: Run tests on Linux with packed demoapp
425-
if : matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
425+
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
426426
run: |
427427
xvfb-run --auto-servernum invoke atest-robot --smoke
428428
- name: Run tests on MacOS with packed demoapp

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ __pycache__
2222
robotframework_browser.egg-info/
2323
.venv
2424
zip_results
25+
mypy_stub
2526

2627
# utest
2728
utest/output

atest/test/01_Browser_Management/chromiun_channel.robot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Resource imports.resource
33

44
Suite Teardown Close Browser ALL
55

6+
Test Tags no-docker-pr
7+
68
*** Test Cases ***
79
Wrong Browser With Channel
810
Run Keyword And Expect Error

atest/test/01_Browser_Management/client_certificates.robot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Suite Setup Setup
66
Suite Teardown Suite Teardown
77
Test Teardown Close Browser ALL
88

9+
Test Tags no-docker-pr
10+
911
*** Test Cases ***
1012
Open Browser With Client Certificate
1113
New Browser browser=${BROWSER} headless=${HEADLESS}

atest/test/01_Browser_Management/geolocation.robot

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,18 @@ Force Tags no-iframe
2121

2222
*** Test Cases ***
2323
Set Geolocation On Browser Startup
24+
[Tags] no-docker-pr
2425
Start Context With Geolocation
2526
Check Geolocation 42 -42.42
2627

2728
Set Geolocation
29+
[Tags] no-docker-pr
2830
[Setup] Start Context With Geolocation
2931
Set Geolocation 72.56 145.89 0.23
3032
Check Geolocation 72.56 145.89
3133

3234
Enable Geolocation
35+
[Tags] no-docker-pr
3336
[Setup] Start Context Without Geolocation
3437
Set Browser Timeout timeout=500ms scope=Test
3538
Set Geolocation 11.11 22.22 33.33

atest/test/01_Browser_Management/playwright_state.robot

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ New Context Does Not Open A Page
2828
Should Be Equal ${no_page_id} NO PAGE OPEN
2929

3030
Open Browser Opens Everything
31-
[Tags] slow
31+
[Tags] slow no-docker-pr
3232
${old_timeout} = Set Browser Timeout 30 seconds
3333
Open Browser url=${FORM_URL}
3434
Get Title == prefilled_email_form.html
@@ -262,6 +262,7 @@ New Context With DefaultBrowserType Ff
262262
Set Browser Timeout ${old_timeout}
263263

264264
New Context With baseURL
265+
[Tags] no-docker-pr
265266
New Context baseURL=${ROOT_URL}
266267
New Page dist/#/
267268
Get Url == ${LOGIN_URL}
@@ -440,6 +441,7 @@ Launch Browser Server Generated wsEndpoint
440441
[Teardown] Close Browser Server ${wsEndpoint}
441442

442443
Launch Browser Server Via CLI
444+
[Tags] no-docker-pr
443445
${python} = Get Python Binary Path
444446
${process1} = Start Process
445447
... ${python}

atest/test/02_Content_Keywords/basic_getters_expect_errors.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Get Viewport Size Custom Error
164164
... Get Viewport Size all == ${expected} My error {expected_type}
165165

166166
Get Url Default Error
167-
[Tags] expect_error
167+
[Tags] expect_error no-docker-pr
168168
Run Keyword And Expect Error
169169
... URL 'http://localhost:*' (str) should contain 'Valid' (str)
170170
... Get Url contains Valid

atest/test/02_Content_Keywords/cookie.robot

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ Add Cookie Without Url, Path And Domain
2929
... Add Cookie Foo Bar
3030

3131
Add Cookie With Url
32-
[Tags] no-windows-support
32+
[Tags] no-windows-support no-docker-pr
3333
${url} = Get Url
3434
Add Cookie Foo Bar url=${url}
3535
${cookies} = Get Cookies
3636
Check Cookie ${cookies} 1 Foo Bar
3737
Should Be Equal ${cookies}[0][path] /
3838

3939
Add Cookie With Domain And Path
40-
[Tags] no-windows-support
40+
[Tags] no-windows-support no-docker-pr
4141
${url} = Get Url
4242
${parsed_url} = Common.Parse Url ${url}
4343
Add Cookie Foo Bar domain=${parsed_url.netloc} path=${parsed_url.path}
@@ -58,6 +58,7 @@ Add Cookie With URL And Domain Should Fail
5858
... path=${parsed_url.path}
5959

6060
Add Cookie With All Settings
61+
[Tags] no-docker-pr
6162
${url} = Get Url
6263
${date_string} = Get Current Date increment=1 day
6364
Add Cookie
@@ -96,6 +97,7 @@ Add Cookie With All Settings As String
9697
Should Contain ${cookies} Tidii=Kala; Foo=Bar
9798

9899
Add Cookie With Expiry As Epoch String
100+
[Tags] no-docker-pr
99101
${url} = Get Url
100102
${epoch} = Get Current Date increment=1 day result_format=epoch
101103
${date_time} = Convert Date ${epoch}
@@ -114,6 +116,7 @@ Add Cookie With Expiry As Epoch String
114116
Should Be Equal ${expires.year} ${expires.year}
115117

116118
Add Cookie With Expiry As Epoch Int
119+
[Tags] no-docker-pr
117120
${url} = Get Url
118121
${epoch} = Get Current Date increment=1 day result_format=epoch
119122
Add Cookie
@@ -149,6 +152,7 @@ Add Cookie With Expiry As Epoch In Different Format
149152
Should Match Regexp ${epoch_as_str} \\d\\d\\d\\d-\\d\\d-\\d\\d \\d\\d\\:\\d\\d\\:\\d\\d
150153

151154
Add Cookie With Expiry As Datetime Object
155+
[Tags] no-docker-pr
152156
${url} = Get Url
153157
${datetime} = Evaluate datetime.datetime.now() + datetime.timedelta(hours=1) # local time
154158
Add Cookie

atest/test/02_Content_Keywords/dialogs.robot

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@ Accept Alert
1212
Handle Future Dialogs action=accept
1313
Click \#alerts
1414

15-
Clicking Through Alert Fails
16-
[Tags] not-implemented
17-
# The new close page / context / browser gets broken by this?
18-
Run Keyword And Expect Error
19-
... Could not find element with selector `#alerts` within timeout.
20-
... Click
21-
... \#alerts
22-
2315
Promptinput Works
2416
Handle Future Dialogs action=accept prompt_input=Some Input String
2517
Click \#prompts

0 commit comments

Comments
 (0)