diff --git a/e2e/predam-log.e2e-spec.ts b/e2e/predam-log.e2e-spec.ts index 8327fb0ffecec4baa5ac193066772c55bf9a0cb2..0e7e99fe922d45e8a9af8916e0552fe43febf9f6 100644 --- a/e2e/predam-log.e2e-spec.ts +++ b/e2e/predam-log.e2e-spec.ts @@ -95,4 +95,37 @@ describe("predams - ", () => { // check log messages absence expect(await calcPage.hasLog()).toBe(false); }); + + it("check submergence error and results if dichotomy did not converge", async () => { + await startPage.navigateTo(); + await browser.pause(200); + + // open predams example + const examples = await $$("#examples-list .load-example"); + await examples[6].click(); + await browser.pause(500); + + // modify iteration count,precision + await prefPage.navigateTo(); + await browser.pause(200); + await prefPage.setIterationCount(10); + await prefPage.setComputePrecision(1e-15); + + // back to module + await navBar.openNthCalculator(0); + await browser.pause(500); + + // calculate module + const calcBtn = await calcPage.getCalculateButton(); + await calcBtn.click(); + await browser.pause(300); + + // check log messages presence + expect(await calcPage.hasLog()).toBe(true); + expect(await calcPage.nbLogEntries()).toBe(12); + + // check that results are not empty (dichotomy did not convergence but results should be displayed anyway) + const hasResults = await calcPage.hasResults(); + expect(hasResults).toBe(true); + }); }); diff --git a/e2e/preferences.po.ts b/e2e/preferences.po.ts index 4a3a5755cc3ebf7aec84f2e198608662da8ff6fc..57f921dd1a82ccab94ffe320daf0f57a9161d67f 100644 --- a/e2e/preferences.po.ts +++ b/e2e/preferences.po.ts @@ -84,4 +84,9 @@ export class PreferencesPage { const input = await this.getInputFromName("nmi"); await input.setValue(n.toString()); } + + async setComputePrecision(p: number) { + const input = await this.getInputFromName("cp"); + await input.setValue(p.toString()); + } }