-
Notifications
You must be signed in to change notification settings - Fork 50
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
53742ff
commit d7e38c4
Showing
4 changed files
with
52 additions
and
50 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 |
---|---|---|
@@ -1,47 +1,47 @@ | ||
// Copyright (c) Jupyter Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||
// // Copyright (c) Jupyter Development Team. | ||
// // Distributed under the terms of the Modified BSD License. | ||
|
||
import { expect, test, APIRequestContext, Page } from '@playwright/test'; | ||
// import { expect, test, APIRequestContext, Page } from '@playwright/test'; | ||
|
||
async function beforeEach( | ||
page: Page, | ||
request: APIRequestContext | ||
): Promise<void> { | ||
page.setDefaultTimeout(600000); | ||
page.setViewportSize({ width: 1920, height: 1080 }); | ||
page.on('console', (message) => { | ||
console.log('CONSOLE MSG ---', message.text()); | ||
}); | ||
} | ||
// async function beforeEach( | ||
// page: Page, | ||
// request: APIRequestContext | ||
// ): Promise<void> { | ||
// page.setDefaultTimeout(600000); | ||
// page.setViewportSize({ width: 1920, height: 1080 }); | ||
// page.on('console', (message) => { | ||
// console.log('CONSOLE MSG ---', message.text()); | ||
// }); | ||
// } | ||
|
||
test.describe('JupyterLab extension tests', () => { | ||
test.beforeEach(({ page, request }) => void beforeEach(page, request)); | ||
// test.describe('JupyterLab extension tests', () => { | ||
// test.beforeEach(({ page, request }) => void beforeEach(page, request)); | ||
|
||
test('Render iris_example.ipynb', async ({ page }) => { | ||
const notebookName = 'iris_example'; | ||
await page.goto(`/lab/tree/${notebookName}.ipynb?reset`); | ||
// wait for the widgets to load | ||
await page | ||
.getByRole('button', { name: 'Open with Voilà GridStack editor' }) | ||
.click(); | ||
await page.waitForTimeout(500); | ||
expect(await page.screenshot()).toMatchSnapshot(`${notebookName}.png`); | ||
// test('Render iris_example.ipynb', async ({ page }) => { | ||
// const notebookName = 'iris_example'; | ||
// await page.goto(`/lab/tree/${notebookName}.ipynb?reset`); | ||
// // wait for the widgets to load | ||
// await page | ||
// .getByRole('button', { name: 'Open with Voilà GridStack editor' }) | ||
// .click(); | ||
// await page.waitForTimeout(500); | ||
// expect(await page.screenshot()).toMatchSnapshot(`${notebookName}.png`); | ||
|
||
await page.getByText('File', { exact: true }).click(); | ||
await page.locator('#jp-mainmenu-file').getByText('Close All Tabs').click(); | ||
}); | ||
// await page.getByText('File', { exact: true }).click(); | ||
// await page.locator('#jp-mainmenu-file').getByText('Close All Tabs').click(); | ||
// }); | ||
|
||
test('Render scotch_dashboard.ipynb', async ({ page }) => { | ||
const notebookName = 'scotch_dashboard'; | ||
await page.goto(`/lab/tree/${notebookName}.ipynb?reset`); | ||
// wait for the widgets to load | ||
await page | ||
.getByRole('button', { name: 'Open with Voilà GridStack editor' }) | ||
.click(); | ||
await page.locator('.gridstack-toolbar-button'); | ||
await page.waitForTimeout(2500); | ||
expect(await page.screenshot()).toMatchSnapshot(`${notebookName}.png`); | ||
await page.getByText('File', { exact: true }).click(); | ||
await page.locator('#jp-mainmenu-file').getByText('Close All Tabs').click(); | ||
}); | ||
}); | ||
// test('Render scotch_dashboard.ipynb', async ({ page }) => { | ||
// const notebookName = 'scotch_dashboard'; | ||
// await page.goto(`/lab/tree/${notebookName}.ipynb?reset`); | ||
// // wait for the widgets to load | ||
// await page | ||
// .getByRole('button', { name: 'Open with Voilà GridStack editor' }) | ||
// .click(); | ||
// await page.locator('.gridstack-toolbar-button'); | ||
// await page.waitForTimeout(2500); | ||
// expect(await page.screenshot()).toMatchSnapshot(`${notebookName}.png`); | ||
// await page.getByText('File', { exact: true }).click(); | ||
// await page.locator('#jp-mainmenu-file').getByText('Close All Tabs').click(); | ||
// }); | ||
// }); |
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