Skip to content

Commit

Permalink
Configure test for notebook 7
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollonval committed Aug 15, 2023
1 parent 0eb78f0 commit 8f548fd
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ui-tests/jupyter_server_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@

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")

# Uncomment to set server log level to debug level
# c.ServerApp.log_level = "DEBUG"
21 changes: 21 additions & 0 deletions ui-tests/playwright-notebook.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Configuration for Playwright using default from @jupyterlab/galata
*/
const baseConfig = require('@jupyterlab/galata/lib/playwright-config');

// Trick to customize the fixture `waitForApplication`
process.env.IS_NOTEBOOK='1';

module.exports = {
...baseConfig,
use: {
...baseConfig.use,
appPath: '',
},
webServer: {
command: 'jlpm start',
url: 'http://localhost:8888/lab',
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI
}
};
11 changes: 11 additions & 0 deletions ui-tests/tests/jupyter-archive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ import * as path from 'path';

const fileName = 'folder.tar.xz';

if (process.env.IS_NOTEBOOK){
test.use({
waitForApplication: async ({ baseURL }, use, testInfo) => {
const waitIsReady = async (page): Promise<void> => {
await page.waitForSelector('#main-panel');
};
await use(waitIsReady);
}
});
}

test('should download a folder as an archive', async ({ page }) => {
await page.locator('.jp-DirListing-content').click({
button: 'right'
Expand Down

0 comments on commit 8f548fd

Please sign in to comment.