From 8284a1a09e42e6ac8f3dec8f377f79ad445f9817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grand?= <francois.grand@inrae.fr> Date: Mon, 6 Mar 2023 11:24:33 +0100 Subject: [PATCH] fix(e2e): Mathjax formula in help tests fail after first language refs #608 --- e2e/documentation.e2e-spec.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/e2e/documentation.e2e-spec.ts b/e2e/documentation.e2e-spec.ts index ea30f5ab5..e3a142432 100644 --- a/e2e/documentation.e2e-spec.ts +++ b/e2e/documentation.e2e-spec.ts @@ -20,7 +20,7 @@ describe("documentation − ", () => { }); async function checkMathjaxInHelp(lang: number) { - // change setup to French + // change language setup await prefPage.navigateTo(); await prefPage.changeLanguage(lang); await browser.sleep(200); @@ -38,10 +38,23 @@ describe("documentation − ", () => { browser.getAllWindowHandles().then(async (handles) => { browser.ignoreSynchronization = true; // deprecated but the only solution to work in the newly opened tab + + // switch to help tab browser.switchTo().window(handles[1]).then(async () => { // check Mathjax element is present - expect(element.all(by.css("mjx-container")).isPresent()).toBe(true); + expect(element(by.css("mjx-container")).isPresent()).toBe(true); + }).then(async () => { + // close help tab + await browser.close(); + // switch back to calculator (required to avoid failure of next language test) + await browser.switchTo().window(handles[0]); + browser.ignoreSynchronization = false; }); + + // switch back to calculator (required to avoid failure of next language test) + await browser.switchTo().window(handles[0]); + + browser.ignoreSynchronization = false; }); } -- GitLab