Skip to content

Commit

Permalink
Update galata setup (copying from bqplot's ui-tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Dec 6, 2023
1 parent 20b36c4 commit 6ddbcb0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 28 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,11 @@ jobs:
- name: Install browser
run: |
jlpm install
jlpm playwright install chromium
npx playwright install chromium
working-directory: ui-tests

- name: Launch JupyterLab
run: jlpm start:detached > /tmp/jupyterlab_server.log 2>&1
working-directory: ui-tests

- name: Wait for JupyterLab
uses: ifaxity/wait-on-action@v1
with:
resource: http-get://localhost:8888/
timeout: 360000

- name: Widget rendering tests
run: jlpm run test
run: npx playwright test
working-directory: ui-tests

- name: Upload Playwright Test assets
Expand Down
10 changes: 3 additions & 7 deletions ui-tests/jupyter_server_config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
c.ServerApp.port = 8888
c.ServerApp.token = ""
c.ServerApp.password = ""
c.ServerApp.disable_check_xsrf = True
c.ServerApp.open_browser = False
c.LabApp.open_browser = False
c.LabApp.expose_app_in_browser = True
from jupyterlab.galata import configure_jupyter_server

configure_jupyter_server(c) # noqa F821
11 changes: 5 additions & 6 deletions ui-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@
"description": "ipyleaflet UI Tests",
"private": true,
"scripts": {
"start": "jupyter labextension disable '@jupyterlab/apputils-extension:announcements' && jupyter lab --config ./jupyter_server_config.py",
"start:detached": "yarn run start&",
"start": "jupyter lab --config jupyter_server_config.py",
"clean": "rimraf tests/notebooks/.ipynb_checkpoints && rimraf test-output",
"test": "yarn run clean && playwright test",
"test:debug": "yarn run clean && PWDEBUG=1 playwright test",
"test:update": "playwright test --update-snapshots"
"test": "npx playwright test",
"test:debug": "yarn run clean && PWDEBUG=1 npx playwright test",
"test:update": "npx playwright test --update-snapshots"
},
"author": "ipyleaflet",
"license": "MIT",
"dependencies": {
"@jupyterlab/galata": "^4.3.5",
"@playwright/test": "^1.32.0",
"klaw-sync": "^6.0.0",
"playwright": "^1.40.1",
"rimraf": "^3.0.2"
}
}
5 changes: 5 additions & 0 deletions ui-tests/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ module.exports = {
expect: {
toMatchSnapshot: { threshold: 0.33 },
},
webServer: {
command: 'jlpm start',
url: 'http://localhost:8888/lab',
reuseExistingServer: !process.env.CI
},
preserveOutput: 'failures-only',
retries: 0,
timeout: 600000,
Expand Down
6 changes: 3 additions & 3 deletions ui-tests/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ __metadata:
languageName: node
linkType: hard

"@playwright/test@npm:^1.16.2":
"@playwright/test@npm:^1.16.2, @playwright/test@npm:^1.32.0":
version: 1.40.1
resolution: "@playwright/test@npm:1.40.1"
dependencies:
Expand Down Expand Up @@ -2619,8 +2619,8 @@ __metadata:
resolution: "ipyleaflet-ui-tests@workspace:."
dependencies:
"@jupyterlab/galata": ^4.3.5
"@playwright/test": ^1.32.0
klaw-sync: ^6.0.0
playwright: ^1.40.1
rimraf: ^3.0.2
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -3367,7 +3367,7 @@ __metadata:
languageName: node
linkType: hard

"playwright@npm:1.40.1, playwright@npm:^1.40.1":
"playwright@npm:1.40.1":
version: 1.40.1
resolution: "playwright@npm:1.40.1"
dependencies:
Expand Down

0 comments on commit 6ddbcb0

Please sign in to comment.