diff --git a/ui-tests/stability_test/stability.test.ts b/ui-tests/stability_test/stability.test.ts index eddb0cdb0..ff2997dbc 100644 --- a/ui-tests/stability_test/stability.test.ts +++ b/ui-tests/stability_test/stability.test.ts @@ -31,14 +31,15 @@ test.describe('Voila stability Tests', () => { ); expect(await page.screenshot()).toMatchSnapshot(`${notebookName}.png`); }); - test('Should render notebook with missing module in a box', async ({ + + test('Should not render notebook with missing module in a box', async ({ page, browserName }, testInfo) => { const notebookName = 'missing_module_inside_box'; await page.goto(`render/${notebookName}.ipynb`); - await page.waitForSelector('button'); - await page.$('text=Typesetting math: 100%'); + // await page.waitForSelector('button'); + // await page.$('text=Typesetting math: 100%'); await page.waitForSelector('#MathJax_Message', { state: 'hidden' }); expect(errorLogs).toContain( 'Class ModuleImportErrorModel not found in module widget_lib@^0.1.0' @@ -59,6 +60,17 @@ test.describe('Voila stability Tests', () => { expect(await page.screenshot()).toMatchSnapshot(`${notebookName}.png`); }); + test('Should not render notebook with model error in a box', async ({ + page, + browserName + }, testInfo) => { + const notebookName = 'module_error_inside_box'; + await page.goto(`render/${notebookName}.ipynb`); + await page.waitForSelector('#MathJax_Message', { state: 'hidden' }); + expect(errorLogs).toContain('Error: Failed to initialize model.'); + expect(await page.screenshot()).toMatchSnapshot(`${notebookName}.png`); + }); + test('Should render notebook with render error', async ({ page, browserName @@ -71,6 +83,16 @@ test.describe('Voila stability Tests', () => { expect(errorLogs).toContain('Error: Could not create view'); expect(await page.screenshot()).toMatchSnapshot(`${notebookName}.png`); }); + test('Should not render notebook with render error in a box', async ({ + page, + browserName + }, testInfo) => { + const notebookName = 'render_error_inside_box'; + await page.goto(`render/${notebookName}.ipynb`); + await page.waitForSelector('#MathJax_Message', { state: 'hidden' }); + expect(errorLogs).toContain('Error: Could not create a view'); + expect(await page.screenshot()).toMatchSnapshot(`${notebookName}.png`); + }); test('Should render notebook with semver error', async ({ page, @@ -86,4 +108,17 @@ test.describe('Voila stability Tests', () => { ); expect(await page.screenshot()).toMatchSnapshot(`${notebookName}.png`); }); + + test('Should not render notebook with semver error in a box', async ({ + page, + browserName + }, testInfo) => { + const notebookName = 'wrong_semver_inside_box'; + await page.goto(`render/${notebookName}.ipynb`); + await page.waitForSelector('#MathJax_Message', { state: 'hidden' }); + expect(errorLogs).toContain( + 'Error: Module @jupyter-widgets/controls, semver range 0.0 is not registered as a widget module' + ); + expect(await page.screenshot()).toMatchSnapshot(`${notebookName}.png`); + }); }); diff --git a/ui-tests/stability_test/stability.test.ts-snapshots/missing-module-inside-box-stability-test-linux.png b/ui-tests/stability_test/stability.test.ts-snapshots/missing-module-inside-box-stability-test-linux.png new file mode 100644 index 000000000..57143f55e Binary files /dev/null and b/ui-tests/stability_test/stability.test.ts-snapshots/missing-module-inside-box-stability-test-linux.png differ diff --git a/ui-tests/stability_test/stability.test.ts-snapshots/module-error-inside-box-stability-test-linux.png b/ui-tests/stability_test/stability.test.ts-snapshots/module-error-inside-box-stability-test-linux.png new file mode 100644 index 000000000..57143f55e Binary files /dev/null and b/ui-tests/stability_test/stability.test.ts-snapshots/module-error-inside-box-stability-test-linux.png differ diff --git a/ui-tests/stability_test/stability.test.ts-snapshots/render-error-inside-box-stability-test-linux.png b/ui-tests/stability_test/stability.test.ts-snapshots/render-error-inside-box-stability-test-linux.png new file mode 100644 index 000000000..690ef6ed5 Binary files /dev/null and b/ui-tests/stability_test/stability.test.ts-snapshots/render-error-inside-box-stability-test-linux.png differ diff --git a/ui-tests/stability_test/stability.test.ts-snapshots/wrong-semver-inside-box-stability-test-linux.png b/ui-tests/stability_test/stability.test.ts-snapshots/wrong-semver-inside-box-stability-test-linux.png new file mode 100644 index 000000000..57143f55e Binary files /dev/null and b/ui-tests/stability_test/stability.test.ts-snapshots/wrong-semver-inside-box-stability-test-linux.png differ