-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a6b7e5d
commit 8e8151a
Showing
14 changed files
with
151 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from pathlib import Path | ||
from subprocess import run | ||
|
||
import jupyterlab | ||
|
||
extra_labextensions_path = str(Path(jupyterlab.__file__).parent / "galata") | ||
cmd = f"jupyter lite build --FederatedExtensionAddon.extra_labextensions_path={extra_labextensions_path}" | ||
|
||
run( | ||
cmd, | ||
check=True, | ||
shell=True, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: jupyterlite-xeus-tests | ||
channels: | ||
- https://repo.mamba.pm/emscripten-forge | ||
- https://repo.mamba.pm/conda-forge | ||
dependencies: | ||
- xeus-python | ||
- xeus-lua | ||
- pandas | ||
- bqplot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"jupyter-lite-schema-version": 0, | ||
"jupyter-config-data": { | ||
"appName": "JupyterLite UI Tests", | ||
"exposeAppInBrowser": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"LiteBuildConfig": { | ||
"output_dir": "dist" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
/** | ||
* Configuration for Playwright using default from @jupyterlab/galata | ||
*/ | ||
const baseConfig = require('@jupyterlab/galata/lib/playwright-config'); | ||
|
||
module.exports = { | ||
...baseConfig, | ||
webServer: { | ||
command: 'jlpm start', | ||
url: 'http://localhost:8888/lab', | ||
timeout: 120 * 1000, | ||
reuseExistingServer: !process.env.CI | ||
} | ||
reporter: [[process.env.CI ? 'dot' : 'list'], ['html']], | ||
use: { | ||
acceptDownloads: true, | ||
appPath: '', | ||
autoGoto: false, | ||
baseURL: 'http://localhost:8000', | ||
trace: 'on-first-retry', | ||
video: 'retain-on-failure' | ||
}, | ||
retries: 1, | ||
expect: { | ||
toMatchSnapshot: { | ||
maxDiffPixelRatio: 0.05 | ||
} | ||
}, | ||
webServer: [ | ||
{ | ||
command: 'yarn start', | ||
port: 8000, | ||
timeout: 120 * 1000, | ||
reuseExistingServer: true | ||
} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,46 @@ | ||
import { expect, test } from '@jupyterlab/galata'; | ||
import { test } from '@jupyterlab/galata'; | ||
|
||
/** | ||
* Don't load JupyterLab webpage before running the tests. | ||
* This is required to ensure we capture all log messages. | ||
*/ | ||
test.use({ autoGoto: false }); | ||
import { expect } from '@playwright/test'; | ||
|
||
test('should emit an activation console message', async ({ page }) => { | ||
const logs: string[] = []; | ||
test.describe('General Tests', () => { | ||
test.beforeEach(({ page }) => { | ||
page.setDefaultTimeout(600000); | ||
|
||
page.on('console', message => { | ||
logs.push(message.text()); | ||
page.on('console', message => { | ||
console.log('CONSOLE MSG ---', message.text()); | ||
}); | ||
}); | ||
|
||
await page.goto(); | ||
test('Launcher should contain xeus-python and xeus-lua kernels', async ({ | ||
page | ||
}) => { | ||
await page.goto('lab/index.html'); | ||
|
||
expect(1).toEqual(1); | ||
expect(await page.screenshot()).toMatchSnapshot( | ||
'jupyter-xeus-launcher.png' | ||
); | ||
}); | ||
|
||
test('xeus-python should execute some code', async ({ page }) => { | ||
await page.goto('lab/index.html'); | ||
|
||
// Launch a Python notebook | ||
const xpython = page.locator('[title="Python 3.12 (XPython)"]').first(); | ||
await xpython.click(); | ||
|
||
// Wait for kernel to be idle | ||
await page.locator('#jp-main-statusbar').getByText('Idle').waitFor(); | ||
|
||
await page.notebook.addCell('code', 'import bqplot; print("ok")'); | ||
await page.notebook.runCell(1); | ||
|
||
// Wait for kernel to be idle | ||
await page.locator('#jp-main-statusbar').getByText('Idle').waitFor(); | ||
|
||
const cell = await page.notebook.getCellOutput(1); | ||
|
||
expect(await cell?.screenshot()).toMatchSnapshot( | ||
'jupyter-xeus-execute.png' | ||
); | ||
}); | ||
}); |
Binary file added
BIN
+45.7 KB
ui-tests/tests/jupyterlite_xeus.spec.ts-snapshots/jupyter-xeus-launcher-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters