Skip to content

Commit 9240064

Browse files
committed
Add reference screenshots for the simple notebook
1 parent 1798b1c commit 9240064

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

ui-tests/test/general.spec.ts

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) Jupyter Development Team.
2+
// Distributed under the terms of the Modified BSD License.
3+
4+
import path from 'path';
5+
6+
import { expect } from '@playwright/test';
7+
8+
import { test } from './fixtures';
9+
import { waitForKernelReady } from './utils';
10+
11+
test.describe('General', () => {
12+
test('The notebook should render', async ({ page, tmpPath }) => {
13+
const notebook = 'simple.ipynb';
14+
await page.contents.uploadFile(
15+
path.resolve(__dirname, `./notebooks/${notebook}`),
16+
`${tmpPath}/${notebook}`
17+
);
18+
await page.goto(`notebooks/${tmpPath}/${notebook}`);
19+
20+
// wait for the kernel status animations to be finished
21+
await waitForKernelReady(page);
22+
await page.waitForSelector(
23+
".jp-Notebook-ExecutionIndicator[data-status='idle']"
24+
);
25+
26+
// force switching back to command mode to avoid capturing the cursor in the screenshot
27+
await page.evaluate(async () => {
28+
await window.jupyterapp.commands.execute('notebook:enter-command-mode');
29+
});
30+
31+
expect(await page.screenshot()).toMatchSnapshot('notebook.png');
32+
});
33+
});
Loading
Loading

0 commit comments

Comments
 (0)