Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ jobs:

integration-tests:
name: Integration tests
strategy:
fail-fast: false
matrix:
jupyterlab: ['3.6', '4.0']
needs: build
runs-on: ubuntu-latest

Expand All @@ -100,13 +104,17 @@ jobs:
- name: Install the extension
run: |
set -eux
python -m pip install "jupyterlab>=4.0.0,<5" jupyterlab_favorites*.whl
python -m pip install "jupyterlab~=${{ matrix.jupyterlab }}" jupyterlab_favorites*.whl

- name: Install dependencies
working-directory: ui-tests
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: jlpm install
run: |
if [[ "${{ matrix.jupyterlab }}" == "3.6" ]]; then
jlpm add -D "@jupyterlab/galata@^4.0.0"
fi
jlpm install

- name: Set up browser cache
uses: actions/cache@v3
Expand All @@ -121,17 +129,19 @@ jobs:

- name: Execute integration tests
working-directory: ui-tests
env:
PLAYWRIGHT_HTML_REPORT: playwright-report-${{ matrix.jupyterlab }}
run: |
jlpm playwright test
jlpm playwright test --output test-results-${{ matrix.jupyterlab }}

- name: Upload Playwright Test report
if: always()
uses: actions/upload-artifact@v3
with:
name: jupyterlab_favorites-playwright-tests
path: |
ui-tests/test-results
ui-tests/playwright-report
ui-tests/test-results*
ui-tests/playwright-report*

check_links:
name: Check Links
Expand Down
25 changes: 23 additions & 2 deletions ui-tests/jupyter_server_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,30 @@
opens the server to the world and provide access to JupyterLab
JavaScript objects through the global window variable.
"""
from jupyterlab.galata import configure_jupyter_server
try:
# Available from JupyterLab 4 and later
from jupyterlab.galata import configure_jupyter_server

configure_jupyter_server(c)
configure_jupyter_server(c)

# Option specific for notebook v7+
# import jupyterlab
# from pathlib import Path
# c.JupyterNotebookApp.expose_app_in_browser = True
# c.LabServerApp.extra_labextensions_path = str(Path(jupyterlab.__file__).parent / "galata")

except ImportError:
from tempfile import mkdtemp

c.ServerApp.port = 8888
c.ServerApp.port_retries = 0
c.ServerApp.open_browser = False

c.ServerApp.root_dir = mkdtemp(prefix='galata-test-')
c.ServerApp.token = ""
c.ServerApp.password = ""
c.ServerApp.disable_check_xsrf = True
c.LabApp.expose_app_in_browser = True

# Uncomment to set server log level to debug level
# c.ServerApp.log_level = "DEBUG"