Skip to content

Commit 624dfc8

Browse files
authored
Merge pull request #3172 from mbektasbbg/galata
Visual regression testing using Galata
2 parents 24628f0 + 1fe8d6d commit 624dfc8

Some content is hidden

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

55 files changed

+5397
-5
lines changed

.github/workflows/tests.yml

+76
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,79 @@ jobs:
143143
run: |
144144
python ./packages/schema/generate-spec.py -f markdown > spec.md
145145
diff -u ./packages/schema/jupyterwidgetmodels.latest.md ./spec.md
146+
ui-test:
147+
name: Visual Regression
148+
runs-on: ubuntu-latest
149+
150+
steps:
151+
- uses: actions/checkout@v2
152+
- name: Set up Python
153+
uses: actions/setup-python@v1
154+
with:
155+
python-version: 3.7
156+
- uses: actions/cache@v1
157+
with:
158+
path: ~/.cache/pip
159+
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{hashFiles('**/requirements.txt')}}
160+
restore-keys: |
161+
${{ runner.os }}-pip-
162+
- name: Install dependencies
163+
run: |
164+
python -m pip install --upgrade pip
165+
python -m pip install jupyterlab==3.0.3
166+
167+
- name: Use Node.js 12.x
168+
uses: actions/setup-node@v1
169+
with:
170+
node-version: 12.x
171+
- name: Get yarn cache
172+
id: yarn-cache
173+
run: echo "::set-output name=dir::$(yarn cache dir)"
174+
- uses: actions/cache@v1
175+
with:
176+
path: ${{ steps.yarn-cache.outputs.dir }}
177+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
178+
restore-keys: |
179+
${{ runner.os }}-yarn-
180+
181+
- name: Build and Install ipywidgets
182+
run: |
183+
yarn install --frozen-lockfile
184+
yarn run build
185+
- name: Build the extension
186+
run: |
187+
pip install .
188+
jlpm install
189+
jlpm run build
190+
cd jupyterlab_widgets
191+
pwd
192+
pip install -e .
193+
jupyter labextension develop . --overwrite
194+
jupyter labextension list
195+
- name: Install Galata
196+
run: |
197+
cd ui-tests
198+
yarn install --frozen-lockfile
199+
- name: Launch JupyterLab
200+
run: |
201+
cd ui-tests
202+
yarn run start-jlab:detached
203+
- name: Wait for JupyterLab
204+
uses: ifaxity/wait-on-action@v1
205+
with:
206+
resource: http-get://localhost:8888/api
207+
timeout: 20000
208+
- name: Run UI Tests
209+
run: |
210+
cd ui-tests
211+
yarn run test
212+
- name: Upload UI Test artifacts
213+
if: always()
214+
uses: actions/upload-artifact@v2
215+
with:
216+
name: ui-test-output
217+
path: |
218+
ui-tests/test-output
219+
220+
env:
221+
CI: true

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,5 @@ index.built.js.map
3636
temp/*
3737

3838
tsconfig.tsbuildinfo
39+
40+
ui-tests/test-output/*

docs/source/dev_testing.md

+56-5

ui-tests/galata-config.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"testId": "test"
3+
}

ui-tests/jupyter_server_config.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
c.ServerApp.port = 8888
2+
c.ServerApp.token = ""
3+
c.ServerApp.password = ""
4+
c.ServerApp.disable_check_xsrf = True
5+
c.ServerApp.open_browser = False
6+
c.LabApp.open_browser = False
7+
c.LabApp.expose_app_in_browser = True

ui-tests/package.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "ipywidgets-ui-tests",
3+
"version": "1.0.0",
4+
"description": "ipywidgets UI Tests",
5+
"private": true,
6+
"scripts": {
7+
"start-jlab": "jupyter lab --config ./jupyter_server_config.py",
8+
"start-jlab:detached": "yarn run start-jlab&",
9+
"test": "galata"
10+
},
11+
"author": "Project Jupyter",
12+
"license": "BSD-3-Clause",
13+
"dependencies": {
14+
"@jupyterlab/galata": "3.0.3-3"
15+
}
16+
}
22.5 KB

0 commit comments

Comments
 (0)