diff --git a/ui-tests/test/general.spec.ts b/ui-tests/test/general.spec.ts new file mode 100644 index 00000000000..02ae51fd840 --- /dev/null +++ b/ui-tests/test/general.spec.ts @@ -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'); + }); +}); diff --git a/ui-tests/test/general.spec.ts-snapshots/notebook-chromium-linux.png b/ui-tests/test/general.spec.ts-snapshots/notebook-chromium-linux.png new file mode 100644 index 00000000000..2ca02de5f92 Binary files /dev/null and b/ui-tests/test/general.spec.ts-snapshots/notebook-chromium-linux.png differ diff --git a/ui-tests/test/general.spec.ts-snapshots/notebook-firefox-linux.png b/ui-tests/test/general.spec.ts-snapshots/notebook-firefox-linux.png new file mode 100644 index 00000000000..a7a64773014 Binary files /dev/null and b/ui-tests/test/general.spec.ts-snapshots/notebook-firefox-linux.png differ