-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration tests & improve notebook tour
- Loading branch information
1 parent
cfec598
commit 3d3c802
Showing
7 changed files
with
4,443 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,3 +126,4 @@ dmypy.json | |
|
||
# Yarn cache | ||
.yarn/ | ||
junit.xml |
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,15 @@ | ||
{ | ||
"name": "jupyterlab-tour-ui-tests", | ||
"version": "1.0.0", | ||
"description": "JupyterLab jupyterlab-tour Integration Tests", | ||
"private": true, | ||
"scripts": { | ||
"start": "jupyter lab --config jupyter_server_test_config.py", | ||
"test": "jlpm playwright test", | ||
"test:update": "jlpm playwright test --update-snapshots" | ||
}, | ||
"devDependencies": { | ||
"@jupyterlab/galata": "^5.0.0", | ||
"@playwright/test": "^1.32.0" | ||
} | ||
} |
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,21 +1,37 @@ | ||
import { expect, 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 }); | ||
test('should run the welcome tour', async ({ page }) => { | ||
await page.getByRole('button', { name: 'Start now' }).click(); | ||
await page.getByLabel('Next', { exact: true }).click(); | ||
await page.getByLabel('Next', { exact: true }).click(); | ||
await page.getByLabel('Next', { exact: true }).click(); | ||
await page.getByLabel('Next', { exact: true }).click(); | ||
await page.getByLabel('Next', { exact: true }).click(); | ||
await page.getByLabel('Next', { exact: true }).click(); | ||
await page.getByLabel('Next', { exact: true }).click(); | ||
|
||
test('should emit an activation console message', async ({ page }) => { | ||
const logs: string[] = []; | ||
|
||
page.on('console', message => { | ||
logs.push(message.text()); | ||
}); | ||
|
||
await page.goto(); | ||
await expect | ||
.soft(page.locator('.react-joyride__tooltip h4')) | ||
.toHaveText('Command Palette'); | ||
await page.getByLabel('Done').click(); | ||
}); | ||
|
||
expect( | ||
logs.filter(s => s === 'JupyterLab extension jupyterlab-tour is activated!') | ||
).toHaveLength(1); | ||
test('should run the notebook tour', async ({ page }) => { | ||
await page.getByRole('menuitem', { name: 'File' }).click(); | ||
await page.getByText('New', { exact: true }).click(); | ||
await page.locator('#jp-mainmenu-file-new').getByText('Notebook').click(); | ||
await page.getByRole('button', { name: 'Select Kernel' }).click(); | ||
await page.getByRole('button', { name: 'Start now' }).click(); | ||
await page.getByLabel('Next', { exact: true }).click(); | ||
await page.getByLabel('Next', { exact: true }).click(); | ||
await page.getByLabel('Next', { exact: true }).click(); | ||
await page.getByLabel('Next', { exact: true }).click(); | ||
await page.getByLabel('Next', { exact: true }).click(); | ||
await page.getByLabel('Next', { exact: true }).click(); | ||
await page.getByLabel('Next', { exact: true }).click(); | ||
await page.getByLabel('Next', { exact: true }).click(); | ||
await expect | ||
.soft(page.locator('.react-joyride__tooltip p')) | ||
.toHaveText('Metadata (like tags) can be added to cells through this tab.'); | ||
await page.getByLabel('Done').click(); | ||
}); |
Oops, something went wrong.