Skip to content

Commit 045cb0e

Browse files
authored
Merge pull request #3279 from jtpio/update-galata
Update to the new Galata
2 parents fbdbd00 + 655c008 commit 045cb0e

File tree

100 files changed

+2835
-3471
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+2835
-3471
lines changed

.github/workflows/tests.yml

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -151,27 +151,30 @@ jobs:
151151
steps:
152152
- uses: actions/checkout@v2
153153
- name: Set up Python
154-
uses: actions/setup-python@v1
154+
uses: actions/setup-python@v2
155155
with:
156-
python-version: 3.7
156+
python-version: 3.9
157157
- uses: actions/cache@v1
158158
with:
159159
path: ~/.cache/pip
160160
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{hashFiles('**/requirements.txt')}}
161161
restore-keys: |
162162
${{ runner.os }}-pip-
163+
163164
- name: Install dependencies
164165
run: |
165166
python -m pip install --upgrade pip
166-
python -m pip install jupyterlab==3.0.3
167+
python -m pip install -U jupyterlab~=3.2 jupyter-packaging~=0.10
167168
168-
- name: Use Node.js 12.x
169-
uses: actions/setup-node@v1
169+
- name: Set up Node
170+
uses: actions/setup-node@v2
170171
with:
171-
node-version: 12.x
172+
node-version: 14.x
173+
172174
- name: Get yarn cache
173175
id: yarn-cache
174176
run: echo "::set-output name=dir::$(yarn cache dir)"
177+
175178
- uses: actions/cache@v1
176179
with:
177180
path: ${{ steps.yarn-cache.outputs.dir }}
@@ -183,6 +186,7 @@ jobs:
183186
run: |
184187
yarn install --frozen-lockfile
185188
yarn run build
189+
186190
- name: Build the extension
187191
run: |
188192
cd python/ipywidgets
@@ -195,42 +199,54 @@ jobs:
195199
pip install -e .
196200
jupyter labextension develop . --overwrite
197201
jupyter labextension list
198-
- name: Install Galata
202+
203+
- name: Install Test Dependencies
199204
run: |
200205
cd ui-tests
201206
yarn install --frozen-lockfile
207+
yarn playwright install chromium
208+
202209
- name: Launch JupyterLab
203210
run: |
204211
cd ui-tests
205-
yarn run start-jlab:detached
212+
yarn run start:detached
213+
206214
- name: Wait for JupyterLab
207215
uses: ifaxity/wait-on-action@v1
208216
with:
209217
resource: http-get://localhost:8888/api
210218
timeout: 20000
219+
211220
- name: Run UI Tests
212221
run: |
213222
cd ui-tests
214223
yarn run test
215-
- name: Upload UI Test artifacts
224+
225+
- name: Upload Playwright Test assets
216226
if: always()
217227
uses: actions/upload-artifact@v2
218228
with:
219-
name: ipywidgets-ui-test-output
229+
name: ipywidgets-test-assets
220230
path: |
221-
ui-tests/test-output
222-
- name: Run UI Tests
223-
if: ${{ failure() }}
224-
run: |
225-
cd ui-tests
226-
jlpm run test:create-references
227-
- name: Upload UI Test new reference artifacts
228-
if: ${{ failure() }}
231+
ui-tests/test-results
232+
233+
- name: Upload Playwright Test report
234+
if: always()
229235
uses: actions/upload-artifact@v2
230236
with:
231-
name: ipywidgets-ui-test-new-reference
237+
name: ipywidgets-test-report
232238
path: |
233-
ui-tests/test-output/test/screenshots/*.png
239+
ui-tests/playwright-report
234240
235-
env:
236-
CI: true
241+
- name: Update snapshots
242+
if: failure()
243+
run: |
244+
cd ui-tests
245+
yarn run test:update
246+
247+
- name: Upload updated snapshots
248+
if: failure()
249+
uses: actions/upload-artifact@v2
250+
with:
251+
name: ipywidgets-updated-snapshots
252+
path: ui-tests/tests

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ temp/*
3737

3838
tsconfig.tsbuildinfo
3939

40-
ui-tests/test-output/*
40+
ui-tests/test-results
41+
ui-tests/playwright-report

docs/source/dev_testing.md

Lines changed: 21 additions & 15 deletions

ui-tests/galata-config.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

ui-tests/jupyter_server_config.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
from tempfile import mkdtemp
2+
13
c.ServerApp.port = 8888
4+
c.ServerApp.open_browser = False
5+
c.ServerApp.root_dir = mkdtemp(prefix='galata-test-')
26
c.ServerApp.token = ""
37
c.ServerApp.password = ""
48
c.ServerApp.disable_check_xsrf = True
5-
c.ServerApp.open_browser = False
6-
c.LabApp.open_browser = False
9+
710
c.LabApp.expose_app_in_browser = True

ui-tests/package.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
{
2-
"name": "ipywidgets-ui-tests",
3-
"version": "1.0.0",
4-
"description": "ipywidgets UI Tests",
2+
"name": "@jupyter-widgets/ui-tests",
53
"private": true,
4+
"version": "0.1.0",
5+
"description": "ipywidgets UI Tests",
66
"scripts": {
7-
"start-jlab": "jupyter lab --config ./jupyter_server_config.py",
8-
"start-jlab:detached": "yarn run start-jlab&",
9-
"test:create-references": "galata --skip-visual-regression --skip-html-regression",
10-
"test": "galata"
7+
"start": "jupyter lab --config ./jupyter_server_config.py",
8+
"start:detached": "yarn run start&",
9+
"test": "playwright test",
10+
"test:debug": "PWDEBUG=1 playwright test",
11+
"test:report": "http-server ./playwright-report -a localhost -o",
12+
"test:update": "playwright test --update-snapshots"
1113
},
1214
"author": "Project Jupyter",
1315
"license": "BSD-3-Clause",
1416
"dependencies": {
15-
"@jupyterlab/galata": "3.0.11-2"
17+
"@jupyterlab/galata": "~4.0.2"
1618
}
1719
}

ui-tests/playwright.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const baseConfig = require('@jupyterlab/galata/lib/playwright-config');
2+
3+
module.exports = {
4+
...baseConfig,
5+
timeout: 240000,
6+
retries: 1,
7+
};
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)