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

test(e2e): check calculation works in generated PAB from 'standard fish...

test(e2e): check calculation works in generated PAB from 'standard fish ladder' example (walls calculator)

refs #516
parent db23cc50
No related branches found
No related tags found
2 merge requests!133Release version 4.15.0,!126Resolve "Cloisons > Générer une PAB: vider les champs"
......@@ -90,3 +90,65 @@ describe("ngHyd - Check that examples fields are not empty with 'empty fields on
expect(txt === "").toEqual(false);
});
});
describe("ngHyd - Check that examples work with 'empty fields on calculator creation' enabled - ", () => {
let prefPage: PreferencesPage;
let navBar: Navbar;
let calcPage: CalculatorPage;
beforeEach(async () => {
prefPage = new PreferencesPage();
navBar = new Navbar();
calcPage = new CalculatorPage();
// enable evil option "empty fields on module creation"
await prefPage.navigateTo();
await browser.sleep(200);
await prefPage.enableEvilEmptyFields();
await browser.sleep(200);
});
fit("when calculation is run on a generated fish ladder calculator", async () => {
debugger
// start page
await navBar.clickNewCalculatorButton();
await browser.sleep(200);
// open 1st example
const examples = await element.all(by.css("#examples-list .load-example"));
await examples[0].click();
await browser.sleep(50);
// select wall module
await navBar.openNthCalculator(4);
await browser.sleep(50);
// run calculation
const calcButton = calcPage.getCalculateButton();
await calcButton.click();
await browser.sleep(200);
// click "generate PAB" button
const genButton = calcPage.getGeneratePabButton();
await genButton.click();
await browser.sleep(200);
// write "6" in basin count input
const nbBassins = calcPage.getInputById("generatePabNbBassins");
await nbBassins.sendKeys("6");
await browser.sleep(50);
// click "Generate PAB"
await element(by.css("dialog-generate-pab button#do-generate")).click();
await browser.sleep(1000);
// calculate PAB
const calcButtonPAB = calcPage.getCalculateButton();
await calcButtonPAB.click();
await browser.sleep(200);
// check that result is not empty
const hasResults = await calcPage.hasResults();
expect(hasResults).toBe(true);
});
});
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