-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix open path error with timeline feature (#401)
* fixed open path error with timeline * test added for timeline * modified test * added test that fails without PR but passes with it * added ui test that passes with PR but fails without it.
- Loading branch information
1 parent
3126a81
commit d328e17
Showing
2 changed files
with
83 additions
and
28 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (c) Jupyter Development Team. | ||
* Distributed under the terms of the Modified BSD License. | ||
*/ | ||
|
||
import { expect, test } from '@jupyterlab/galata'; | ||
import { Page } from '@playwright/test'; | ||
|
||
async function capturePageErrors(page: Page) { | ||
const pageErrors: string[] = []; | ||
page.on('pageerror', (error) => pageErrors.push(error.message)); | ||
return pageErrors; | ||
} | ||
|
||
async function openNotebook(page: Page, notebookPath: string) { | ||
await page.click('text=File'); | ||
await page.click('.lm-Menu-itemLabel:text("Open from Path…")'); | ||
await page.fill( | ||
'input[placeholder="/path/relative/to/jlab/root"]', | ||
notebookPath | ||
); | ||
await page.click('.jp-Dialog-buttonLabel:text("Open")'); | ||
await page.waitForSelector('.jp-Notebook', { state: 'visible' }); | ||
} | ||
|
||
test.describe('Open from Path', () => { | ||
|
||
test('should fail if there are console errors', async ({ page, tmpPath }) => { | ||
const pageErrors = await capturePageErrors(page); | ||
|
||
await page.notebook.createNew(); | ||
await page.notebook.save(); | ||
await page.notebook.close(); | ||
|
||
await openNotebook(page, `${tmpPath}/Untitled.ipynb`); | ||
|
||
expect(pageErrors).toHaveLength(0); | ||
}); | ||
}); |