File tree Expand file tree Collapse file tree 4 files changed +49
-0
lines changed Expand file tree Collapse file tree 4 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -244,3 +244,26 @@ jobs:
244
244
tags : ${{ join(fromJson(steps.singleusertags.outputs.tags)) }}
245
245
cache-from : ${{ env.CACHE_FROM }}
246
246
cache-to : ${{ env.CACHE_TO }}
247
+
248
+ - name : Setup Python
249
+ uses : actions/setup-python@v5
250
+ with :
251
+ python-version : " 3.13"
252
+ cache : pip
253
+ cache-dependency-path : tests/dev-requirements.txt
254
+
255
+ - name : Install test dependencies
256
+ run : |
257
+ python -mpip install -r tests/dev-requirements.txt
258
+ python -mplaywright install chromium
259
+
260
+ - name : Test demo image
261
+ run : |
262
+ DEMO_IMAGE=${{ fromJson(steps.demotags.outputs.tags)[0] }}
263
+ docker run -d --name hub -p8000:8000 "$DEMO_IMAGE"
264
+ sleep 5
265
+ python -mpytest
266
+
267
+ - name : Get logs, including on failure
268
+ if : always()
269
+ run : docker logs hub
Original file line number Diff line number Diff line change @@ -20,6 +20,14 @@ repos:
20
20
hooks :
21
21
- id : prettier
22
22
23
+ # autoformat and lint Python code
24
+ - repo : https://github.com/astral-sh/ruff-pre-commit
25
+ rev : v0.9.4
26
+ hooks :
27
+ - id : ruff
28
+ args : ["--select=I", "--fix", "--show-fixes"]
29
+ - id : ruff-format
30
+
23
31
# Static security analysis of GitHub actions https://github.com/woodruffw/zizmor
24
32
- repo : https://github.com/woodruffw/zizmor-pre-commit
25
33
rev : v1.5.1
Original file line number Diff line number Diff line change
1
+ pytest-playwright>=0.7.0
Original file line number Diff line number Diff line change
1
+ # To run these tests with firefox:
2
+ # python -mpytest --browser=firefox
3
+ # To investigate tests run this headed, and with a delay between actions
4
+ # python -mpytest --browser=firefox --slowmo 2000 --headed
5
+
6
+ from playwright .sync_api import Page , expect
7
+
8
+
9
+ def test_simple (page : Page ) -> None :
10
+ page .goto ("http://localhost:8000" )
11
+ # Login page
12
+ expect (page .get_by_role ("button" , name = "Sign in" )).to_be_visible ()
13
+ page .get_by_role ("textbox" , name = "Username:" ).fill ("demo" )
14
+ page .get_by_role ("textbox" , name = "Password:" ).fill ("demo" )
15
+ page .get_by_role ("button" , name = "Sign in" ).click ()
16
+ # JupyterLab
17
+ page .wait_for_url ("http://localhost:8000/user/demo/lab" )
You can’t perform that action at this time.
0 commit comments