Skip to content
Snippets Groups Projects
Commit f7f20968 authored by François Grand's avatar François Grand
Browse files

test(e2e): check calculate button is disabled when a parallel structures input is empty

refs #616
parent f45aad92
No related branches found
No related tags found
2 merge requests!225Release v4.17.0,!219Resolve "Le bouton calculer est activé malgré un champ en erreur"
......@@ -138,4 +138,42 @@ describe("Calculate button - ", () => {
expect(await upstream.getAttribute('class')).not.toContain("node-error");
});
});
async function checkCalculateButtonValidity(calcType: number) {
// open calculator
await navBar.clickNewCalculatorButton();
await listPage.clickMenuEntryForCalcType(calcType);
await browser.sleep(200);
// for each input, set empty and check calculate button is not active
const inputs = calcPage.getParamInputs();
const ninp = await inputs.count();
for (let i = 0; i < ninp; i++) {
const inp = inputs.get(i);
// set input to fixed mode
await calcPage.setParamMode(inp, "fix");
await browser.sleep(100);
// clear input
await calcPage.clearInput(inp);
await browser.sleep(10);
// check calculate button is disabled
await calcPage.checkCalcButtonEnabled(false);
await browser.sleep(100);
// refill input
await inp.sendKeys("1");
await browser.sleep(100);
}
}
it("check status for various calculators", async () => {
// "parallel structures" calculator
await checkCalculateButtonValidity(8);
// "fish ladder : cross walls" calculator
await checkCalculateButtonValidity(10);
});
});
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