-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with notebook #112
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d611835
Compatibility with notebook
brichet 7b9d31c
remove deprecated notebook server config
brichet d2d255b
Add integration tests with notebook
brichet 75ff749
Automatic application of license header
github-actions[bot] 1a28235
typo in CI file
brichet 8582704
Update CI
brichet 64551be
Trying to fix ui-test settings
brichet 51dbe3c
Playwright does not allow webServer config in projects
brichet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright (c) Jupyter Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
|
||
"""Server configuration for integration tests. | ||
!! Never use this configuration in production because it | ||
opens the server to the world and provide access to JupyterLab | ||
JavaScript objects through the global window variable. | ||
""" | ||
from pathlib import Path | ||
import jupyterlab | ||
|
||
c.ServerApp.port = 8888 | ||
c.ServerApp.port_retries = 0 | ||
c.ServerApp.open_browser = False | ||
|
||
c.ServerApp.token = "" | ||
c.ServerApp.password = "" | ||
c.ServerApp.disable_check_xsrf = True | ||
|
||
c.JupyterNotebookApp.expose_app_in_browser = True | ||
|
||
c.LabServerApp.extra_labextensions_path = str(Path(jupyterlab.__file__).parent / "galata") | ||
|
||
c.FileContentsManager.delete_to_trash = False | ||
|
||
# Uncomment to set server log level to debug level | ||
# c.ServerApp.log_level = "DEBUG" |
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,20 @@ | ||
/* | ||
* Copyright (c) Jupyter Development Team. | ||
* Distributed under the terms of the Modified BSD License. | ||
*/ | ||
|
||
/** | ||
* Configuration for Playwright using default from @jupyterlab/galata | ||
*/ | ||
const baseConfig = require('@jupyterlab/galata/lib/playwright-config'); | ||
|
||
module.exports = { | ||
...baseConfig, | ||
webServer: { | ||
command: 'jlpm start:notebook', | ||
url: 'http://localhost:8888/tree', | ||
timeout: 120 * 1000, | ||
reuseExistingServer: !process.env.CI | ||
}, | ||
testMatch: 'tests/notebook-application.spec.ts' | ||
}; |
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,65 @@ | ||
/* | ||
* Copyright (c) Jupyter Development Team. | ||
* Distributed under the terms of the Modified BSD License. | ||
*/ | ||
|
||
import { expect, test as base } from '@jupyterlab/galata'; | ||
|
||
export const test = base.extend({ | ||
waitForApplication: async ({ baseURL }, use, testInfo) => { | ||
const waitIsReady = async (page): Promise<void> => { | ||
await page.waitForSelector('#main-panel'); | ||
}; | ||
await use(waitIsReady); | ||
}, | ||
}); | ||
|
||
test.use({ | ||
autoGoto: false, | ||
appPath: '', | ||
viewport: { width: 1024, height: 900 }, | ||
}); | ||
|
||
const NAME = 'my_chat'; | ||
const FILENAME = `${NAME}.chat`; | ||
|
||
test.describe('#NotebookApp', () => { | ||
test.beforeEach(async ({ page }) => { | ||
// Create a chat file | ||
await page.filebrowser.contents.uploadContent('{}', 'text', FILENAME); | ||
}); | ||
|
||
test.afterEach(async ({ page }) => { | ||
if (await page.filebrowser.contents.fileExists(FILENAME)) { | ||
await page.filebrowser.contents.deleteFile(FILENAME); | ||
} | ||
}); | ||
|
||
test('Should open side panel and list existing chats', async ({ page }) => { | ||
await page.goto('tree'); | ||
await page.menu.clickMenuItem('View>Left Sidebar>Show Jupyter Chat'); | ||
const panel = page.locator('#jp-left-stack'); | ||
await expect(panel).toBeVisible(); | ||
await expect(panel.locator('.jp-lab-chat-sidepanel')).toBeVisible(); | ||
|
||
const select = panel.locator( | ||
'.jp-SidePanel-toolbar .jp-Toolbar-item.jp-lab-chat-open select' | ||
); | ||
|
||
await expect(select.locator('option')).toHaveCount(2); | ||
await expect(select.locator('option').last()).toHaveText(NAME); | ||
}); | ||
|
||
test('Should open main panel in a separate tab', async ({ page, context }) => { | ||
await page.goto('tree'); | ||
|
||
const pagePromise = context.waitForEvent('page'); | ||
await page.dblclick(`.jp-FileBrowser-listing >> text=${FILENAME}`); | ||
|
||
const newPage = await pagePromise; | ||
//wait for Load | ||
// await newPage.waitForLoadState(); | ||
|
||
await expect(newPage.locator('.jp-MainAreaWidget')).toHaveClass(/jp-lab-chat-main-panel/); | ||
}); | ||
}); |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would indeed be nice to fix this upstream, so we could then remove that logic here and the dependency on
@jupyter-notebook/application
.