mirror of
https://github.com/jupyter/notebook.git
synced 2024-11-21 01:11:21 +08:00
Add reference screenshots for the simple notebook
This commit is contained in:
parent
1798b1cfcc
commit
af3764bb7b
33
ui-tests/test/general.spec.ts
Normal file
33
ui-tests/test/general.spec.ts
Normal file
@ -0,0 +1,33 @@
|
||||
// Copyright (c) Jupyter Development Team.
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import { expect } from '@playwright/test';
|
||||
|
||||
import { test } from './fixtures';
|
||||
import { waitForKernelReady } from './utils';
|
||||
|
||||
test.describe('General', () => {
|
||||
test('The notebook should render', async ({ page, tmpPath }) => {
|
||||
const notebook = 'simple.ipynb';
|
||||
await page.contents.uploadFile(
|
||||
path.resolve(__dirname, `./notebooks/${notebook}`),
|
||||
`${tmpPath}/${notebook}`
|
||||
);
|
||||
await page.goto(`notebooks/${tmpPath}/${notebook}`);
|
||||
|
||||
// wait for the kernel status animations to be finished
|
||||
await waitForKernelReady(page);
|
||||
await page.waitForSelector(
|
||||
".jp-Notebook-ExecutionIndicator[data-status='idle']"
|
||||
);
|
||||
|
||||
// force switching back to command mode to avoid capturing the cursor in the screenshot
|
||||
await page.evaluate(async () => {
|
||||
await window.jupyterapp.commands.execute('notebook:enter-command-mode');
|
||||
});
|
||||
|
||||
expect(await page.screenshot()).toMatchSnapshot('notebook.png');
|
||||
});
|
||||
});
|
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
Loading…
Reference in New Issue
Block a user