diff --git a/e2e/calculate-all-params.e2e-spec.ts b/e2e/calculate-all-params.e2e-spec.ts index 18a2f844b1cf4dc0fcd407fc0b88e15cf43169e9..a74e4e1381d904d80d1510ab07c8be7096fd2b27 100644 --- a/e2e/calculate-all-params.e2e-spec.ts +++ b/e2e/calculate-all-params.e2e-spec.ts @@ -2,7 +2,7 @@ import { ListPage } from "./list.po"; import { CalculatorPage } from "./calculator.po"; import { Navbar } from "./navbar.po"; import { PreferencesPage } from "./preferences.po"; -import { browser, element, by, ElementFinder } from "protractor"; +import { browser, element, by } from "protractor"; import { testedCalcTypes } from "./tested_calctypes"; /** @@ -36,8 +36,13 @@ describe("ngHyd − calculate all parameters of all calculators", async () => { // for each calculator for (const ct of calcTypes) { - if (ct === 22) { - // omit 22 - Solveur is not calculated here because it is not independent + if ([ 22, 31, 32, 33, 34 ].includes(ct)) { + // omit 22 - Solveur + // omit 31 - PbCloison + // omit 32 - PbBassin + // omit 33 - Espece + // omit 34 - Verificateur + // (not calculated here because they are not independent) continue; } describe(" − calculate all parameters of calculator type [" + ct + "]", async () => { @@ -53,6 +58,14 @@ describe("ngHyd − calculate all parameters of all calculators", async () => { if (inputs.length > 0) { // for each param for (let i = 0; i < inputs.length; i++) { + // for PreBarrage, switch back to "input" after calculating, so + // that the calculable parameters are shown + if (ct === 30 && i > 0) { + // prevents "Element is not clickable at point" + await browser.executeScript("window.scrollTo(0, 0);"); + const inputLink = element(by.css("#pb-data-results-selector .drs-item a")); + await inputLink.click(); + } // grab input again because calculating the module just refreshed all the fieldsets const input = (await calcPage.getParamInputsHavingCalcMode())[i]; // click "calc" mode button for this parameter diff --git a/e2e/calculate-linked-params.e2e-spec.ts b/e2e/calculate-linked-params.e2e-spec.ts index 443e7939b4bc4f031c1d7a28e10159183489e3c1..3436c8092544a75f4b2de9dee52311351cc03ee3 100644 --- a/e2e/calculate-linked-params.e2e-spec.ts +++ b/e2e/calculate-linked-params.e2e-spec.ts @@ -287,7 +287,7 @@ describe("ngHyd − calculate with linked parameters", () => { let frt = calcPage.getFixedResultsTable(); let volumeRow = calcPage.getNthRow(frt, 3); let volumeCol = calcPage.getNthColumn(volumeRow, 2); - let volume = await volumeCol.getText(); + let volume = await volumeCol.getAttribute("textContent"); expect(Number(volume)).toBeCloseTo(44.565, 3); // click PAB-Nombre tab @@ -302,7 +302,7 @@ describe("ngHyd − calculate with linked parameters", () => { frt = calcPage.getFixedResultsTable(); volumeRow = calcPage.getNthRow(frt, 3); volumeCol = calcPage.getNthColumn(volumeRow, 2); - volume = await volumeCol.getText(); + volume = await volumeCol.getAttribute("textContent"); expect(Number(volume)).toBeCloseTo(44.565, 3); }); diff --git a/e2e/calculator.po.ts b/e2e/calculator.po.ts index 6053029af65d2e09faa8a505e417fdbdadace995..1194295c9979387c0b51149569b81ca4ca2d04e2 100644 --- a/e2e/calculator.po.ts +++ b/e2e/calculator.po.ts @@ -80,11 +80,11 @@ export class CalculatorPage { } getAllVariatedResultsTableHeaders() { - return element.all(by.css("var-results table thead th")); + return element.all(by.css("fixedvar-results var-results table thead th")); } getAllVariatedResultsRows() { - return element.all(by.css("var-results table tbody tr")); + return element.all(by.css("fixedvar-results var-results table tbody tr")); } scrollTo(elt: ElementFinder) { @@ -131,6 +131,8 @@ export class CalculatorPage { || await this.presentAndVisible("pab-results pab-results-table") || + await this.presentAndVisible("pb-results pb-results-table") + || await this.presentAndVisible("macrorugo-compound-results macrorugo-compound-results-table") || await this.presentAndVisible("jet-results .fixed-results-container") @@ -294,7 +296,7 @@ export class CalculatorPage { if (!hasDot && !hasExponent && !isN) { keys = "." + keys; } - if (! isOb) { + if (! isOb && await i.getAttribute("disabled") === null) { await i.sendKeys(keys); } } diff --git a/e2e/tested_calctypes.ts b/e2e/tested_calctypes.ts index 49b141aac5d19ed56855fb12f27d73186eac4428..cdd1fc76623d3d0408d0232848ed10438a92395a 100644 --- a/e2e/tested_calctypes.ts +++ b/e2e/tested_calctypes.ts @@ -9,6 +9,7 @@ export const testedCalcTypes = [ // omit 16 - CloisonAval 17, 18, 19, 20, 21, 22, 23, 24, 25, // omit 26 - YAXN - 27, 28, 29, 30 + 27, 28, 29, 30, // omit 31 - PbCloison and 32 - PbBassin + 33, 34 ]; diff --git a/src/app/config.json b/src/app/config.json index 6a7b7f921207b6ba1f7cf81536dd08da0019546e..97f3c60d6743c80c47231016f0666d26fb40e77d 100644 --- a/src/app/config.json +++ b/src/app/config.json @@ -39,7 +39,7 @@ "path": "verification.jpg", "credits": "S. Richard / OFB" }, - "calculators": [ 31, 30 ] + "calculators": [ 34, 33 ] }, { "name": "DEVALAISON", diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json index c0e3e9e1a33f022185cfbfd669268ef5a3dfbada..2e3202b0d14b43f1b28b4d980fd61df802eca074 100644 --- a/src/locale/messages.en.json +++ b/src/locale/messages.en.json @@ -536,6 +536,7 @@ "INFO_PB_NEW_WALL_DOWN_BASIN": "Downstream basin", "INFO_PB_SCHEMA": "Basins layout", "INFO_PREBARRAGE_TITRE": "Pre-dams", + "INFO_PREBARRAGE_DESCRIPTION": "fishes basins cross-walls barrages", "INFO_PREBARRAGE_TITRE_COURT": "Pre-dams", "INFO_QUICKNAV_CHARTS": "charts", "INFO_QUICKNAV_INPUT": "input", diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json index e83b62b87044461c9942055a754610a80f9563fe..ac6778e5114576a1200d398f7ce22fbf24a2a4d5 100644 --- a/src/locale/messages.fr.json +++ b/src/locale/messages.fr.json @@ -537,6 +537,7 @@ "INFO_PB_NEW_WALL_DOWN_BASIN": "Bassin aval", "INFO_PB_SCHEMA": "Organisation des bassins", "INFO_PREBARRAGE_TITRE": "Prébarrages", + "INFO_PREBARRAGE_DESCRIPTION": "poissons cloisons bassins", "INFO_PREBARRAGE_TITRE_COURT": "Prébarrages", "INFO_QUICKNAV_CHARTS": "graphiques", "INFO_QUICKNAV_INPUT": "données",