diff --git a/e2e/predam-log.e2e-spec.ts b/e2e/predam-log.e2e-spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..cb06046b709d03132c176a13c38a1ac1e80889fc --- /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 2360ff3513f4dfe94c40ba8a542b17a957bb80c4..264ebb84fdc7f9ab570bb8524e7f61ccd26adb02 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()); + } } diff --git a/jalhyd_branch b/jalhyd_branch index 3c757134f639b70824e3015c1c2631ce2b09c902..ad8cc6ff7b8344f465bc2897a53a5a5ecdc60783 100644 --- a/jalhyd_branch +++ b/jalhyd_branch @@ -1 +1 @@ -333-remous-renommer-la-ligne-d-eau-en-z-et-fournir-le-tirant-d-eau-d-apres-celle-ci +330-prebarrage-puissance-dissipee-negative diff --git a/scripts/check-translations.js b/scripts/check-translations.js index e52f610a09d5681a1808e1962b65acd557e3e979..99b0058dcb219f58c6dab5bee6b74be3300e202a 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";