Skip to content
Snippets Groups Projects
Commit 8fa2f302 authored by mathias.chouet's avatar mathias.chouet
Browse files

Update e2e for Prebarrage

parent 3410bfb7
No related branches found
No related tags found
1 merge request!93Resolve "Ajout du module Prébarrage"
......@@ -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
......
......@@ -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);
});
......
......@@ -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);
}
}
......
......@@ -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
];
......@@ -39,7 +39,7 @@
"path": "verification.jpg",
"credits": "S. Richard / OFB"
},
"calculators": [ 31, 30 ]
"calculators": [ 34, 33 ]
},
{
"name": "DEVALAISON",
......
......@@ -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",
......
......@@ -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",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment