From bf7258441565536859cf0cfd2128861ce25b03bf Mon Sep 17 00:00:00 2001 From: Duc Trung LE Date: Fri, 15 Oct 2021 14:52:48 +0200 Subject: [PATCH] Update test for widgets inside box --- ui-tests/stability_test/stability.test.ts | 41 ++++++++++++++++-- ...module-inside-box-stability-test-linux.png | Bin 0 -> 5320 bytes ...-error-inside-box-stability-test-linux.png | Bin 0 -> 5320 bytes ...-error-inside-box-stability-test-linux.png | Bin 0 -> 7234 bytes ...semver-inside-box-stability-test-linux.png | Bin 0 -> 5320 bytes 5 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 ui-tests/stability_test/stability.test.ts-snapshots/missing-module-inside-box-stability-test-linux.png create mode 100644 ui-tests/stability_test/stability.test.ts-snapshots/module-error-inside-box-stability-test-linux.png create mode 100644 ui-tests/stability_test/stability.test.ts-snapshots/render-error-inside-box-stability-test-linux.png create mode 100644 ui-tests/stability_test/stability.test.ts-snapshots/wrong-semver-inside-box-stability-test-linux.png 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 0000000000000000000000000000000000000000..57143f55e3447177e90fb1df3fddd195bc41ce9a GIT binary patch literal 5320 zcmeAS@N?(olHy`uVBq!ia0y~yURWm5O{KE&L8SWV}FoO7J7+8Q*g8{Pu zNc0eo1Bl`<9+eyogwd2RnjL^?U^Ea$17Wmw7_A~l+XfiT)fVrbaFeOQfi&W~k%p`e1%)78&qol`;+0BJ-yod5s; literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..57143f55e3447177e90fb1df3fddd195bc41ce9a GIT binary patch literal 5320 zcmeAS@N?(olHy`uVBq!ia0y~yURWm5O{KE&L8SWV}FoO7J7+8Q*g8{Pu zNc0eo1Bl`<9+eyogwd2RnjL^?U^Ea$17Wmw7_A~l+XfiT)fVrbaFeOQfi&W~k%p`e1%)78&qol`;+0BJ-yod5s; literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..690ef6ed56e100262497a08158bc7c072663b5ec GIT binary patch literal 7234 zcmeHL`&*J(9)Gh|tC@0poXy8HtdXSItf|;kLZq6Kc)WGlYRLvbs&9 zwwR+N=*%?LQ##(T@NTUsVhWj=mn5sCS#w2F9e{}BlK6S%Z_vD_8}DN}YFgeCMNgndw%#AO_UoK3|2d;gxo zo08E=i`9!FRUc+>Gn4*{U3?i@Wue(+e@ZzU^J#CV>zv1xJ$Iyw4MMTaBQW+}$NN>c; z>C-qmvmCvB_wL>6KqAl&FW+h3!WYnN*BWREe5U|f4v$-x?SaE)cgO~WJv)~C86JMS zA{`Eg0-$9eq@S_b01v-#_}xDmGbF^sblu)1S9o^>a(70h(%@p>v5T<(d+N@@Mz7hV zI?d}4^?XmTG8;SHKlv!Stk&I?Ie(baS@3W0*;=GN7MiANB{iin+OmwznDMprbl&@tE2H^2buk>!ZQAy!FXL7gA|U!R+ZY;xWi&-MWs+0f8WK z{AFl@cvFPPvLM1!&Ys;&aJjG_acS(wN-X3R(|?m}p37&LR3gFYmJFBpCrfH49+p&H zoEqe@4C9PBF$&ExEqIWdd>q3P4}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