From 070271d58501dacaa83ec370ebb0dbeb318faf0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grand?= <francois.grand@inrae.fr> Date: Fri, 2 Dec 2022 08:57:22 +0100 Subject: [PATCH 1/3] ci: update jalhyd_branch to 330-prebarrage-puissance-dissipee-negative refs #538 --- jalhyd_branch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jalhyd_branch b/jalhyd_branch index d64531f13..ad8cc6ff7 100644 --- a/jalhyd_branch +++ b/jalhyd_branch @@ -1 +1 @@ -devel +330-prebarrage-puissance-dissipee-negative -- GitLab From 96b87a9e49ebda706014f00d576a2c187f713af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grand?= <francois.grand@inrae.fr> Date: Fri, 2 Dec 2022 09:58:49 +0100 Subject: [PATCH 2/3] test(e2e): check that predam calculation with low iteration count generates log messages refs #538 --- e2e/predam-log.e2e-spec.ts | 44 ++++++++++++++++++++++++++++++++++++++ e2e/preferences.po.ts | 6 ++++++ 2 files changed, 50 insertions(+) create mode 100644 e2e/predam-log.e2e-spec.ts diff --git a/e2e/predam-log.e2e-spec.ts b/e2e/predam-log.e2e-spec.ts new file mode 100644 index 000000000..cb06046b7 --- /dev/null +++ b/e2e/predam-log.e2e-spec.ts @@ -0,0 +1,44 @@ +import { browser, by, element } from "protractor"; +import { CalculatorPage } from "./calculator.po"; +import { ListPage } from "./list.po"; +import { Navbar } from "./navbar.po"; +import { PreferencesPage } from "./preferences.po" + +describe("check that low iteration count leads to log messages", () => { + let listPage: ListPage; + let prefPage: PreferencesPage; + let navBar: Navbar; + let calcPage: CalculatorPage; + + beforeEach(async () => { + prefPage = new PreferencesPage(); + listPage = new ListPage(); + navBar = new Navbar(); + calcPage = new CalculatorPage(); + + // disable evil option "empty fields on module creation" + await prefPage.navigateTo(); + await browser.sleep(200); + await prefPage.disableEvilEmptyFields(); + await browser.sleep(100); + }); + + it("", async () => { + browser.manage().window().setPosition(2000, 30); + + // set low iteration count + await prefPage.setIterationCount(5); + + // open predam calculator + await navBar.clickNewCalculatorButton(); + await listPage.clickMenuEntryForCalcType(30); + await browser.sleep(200); + + // run calculation + const calcButton = calcPage.getCalculateButton(); + await calcButton.click(); + + // check log messages presence + expect(calcPage.hasLog()).toBe(true); + }); +}); diff --git a/e2e/preferences.po.ts b/e2e/preferences.po.ts index 2360ff351..264ebb84f 100644 --- a/e2e/preferences.po.ts +++ b/e2e/preferences.po.ts @@ -64,4 +64,10 @@ export class PreferencesPage { await cb.click(); } } + + async setIterationCount(n: number) { + const input = this.getInputFromName("nmi"); + input.clear(); + await input.sendKeys(n.toString()); + } } -- GitLab From 209be381f1cda43a8b32933805e6c144de33595a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grand?= <francois.grand@inrae.fr> Date: Tue, 6 Dec 2022 14:21:15 +0100 Subject: [PATCH 3/3] fix(e2e): translation checks fail due to multiple imports in jalhyd/src/util/message.ts refs #538 --- scripts/check-translations.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/check-translations.js b/scripts/check-translations.js index e52f610a0..99b0058dc 100644 --- a/scripts/check-translations.js +++ b/scripts/check-translations.js @@ -38,8 +38,14 @@ jm = jm.replace(/\n/g, ""); // split on "," const messages = jm.split(","); -// remove import on 1st line (wtf) @clodo -messages[0] = messages[0].substring(24); +// remove imports +const firstLine = messages[0].split(";"); +while (firstLine.length > 1) { + if (firstLine[0].indexOf("import") !== -1) { + firstLine.splice(0, 1); + } +} +messages[0] = firstLine[firstLine.length - 1]; // read every language file const localePath = "src/locale"; -- GitLab