Skip to content
Snippets Groups Projects

Resolve "Test E2E Error: Error in "ngHyd − calculate with linked parameters − bug #329 : unexpected ERR in results table"

5 files
+ 196
154
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -57,6 +57,83 @@ describe("ngHyd − calculate with linked parameters", () => {
expect(hasResults).toBe(true);
}
it(" − bug nghyd#329 : unexpected ERR in results table", async () => {
await navBar.clickNewCalculatorButton();
await browser.pause(200);
// load session
await loadSession(navBar, sideNav, "./session/session-pab-chain-nghyd-329.json");
expect(await navBar.getAllCalculatorTabs().length).toBe(3);
// calculate PAB-Dimensions
await navBar.clickCalculatorTab(2);
await browser.pause(200);
// click "compute" button
const calcButton = await calcPage.getCalculateButton();
await calcButton.click();
await browser.pause(300);
// check that result is not empty
expect(await calcPage.hasResults()).toBe(true);
// check that ERR is not present in Volume line of results table
let frt = await calcPage.getFixedResultsTable();
let volumeRow = await calcPage.getNthRow(frt, 3);
let volumeCol = await calcPage.getNthColumn(volumeRow, 2);
let volume = await volumeCol.getText();
expect(Number(volume)).toBeCloseTo(44.565, 3);
// click PAB-Nombre tab
await navBar.clickCalculatorTab(0);
await browser.pause(200);
// go back to PAB-Dimensions
await navBar.clickCalculatorTab(2);
await browser.pause(200);
// check that ERR is not present in Volume line of results table
frt = await calcPage.getFixedResultsTable();
volumeRow = await calcPage.getNthRow(frt, 3);
volumeCol = await calcPage.getNthColumn(volumeRow, 2);
volume = await volumeCol.getText();
expect(Number(volume)).toBeCloseTo(44.565, 3);
});
it(" − a link target parameter should not be able to link to another parameter", async () => {
// create 1st PAB-Chute
await openCalculator(12, navBar, listPage);
// upstream water level should not have link mode (only one calculator)
let Z1_1 = await calcPage.getInputById("Z1");
expect(await calcPage.inputHasLinkModeButton(Z1_1)).toBe(false);
// create 2nd PAB-Chute
await openCalculator(12, navBar, listPage);
// back to 1st calculator
await navBar.clickCalculatorTab(0);
await browser.pause(200);
// upstream water level should have link mode (now there are 2 calculators)
Z1_1 = await calcPage.getInputById("Z1"); // re-request input to avoid "Request encountered a stale element - terminating request" warning (due to tab change)
expect(await calcPage.inputHasLinkModeButton(Z1_1)).toBe(true);
// back to 2nd calculator
await navBar.clickCalculatorTab(1);
await browser.pause(200);
// link upstream water level in 2nd calculator to upstream water level in 1st one
const Z1_2 = await calcPage.getInputById("Z1");
await calcPage.setParamMode(Z1_2, "link");
// back to 1st calculator
await navBar.clickCalculatorTab(0);
await browser.pause(200);
// upstream water level should not have link mode (already a link target)
Z1_1 = await calcPage.getInputById("Z1"); // re-request input to avoid "Request encountered a stale element - terminating request" warning (due to tab change)
expect(await calcPage.inputHasLinkModeButton(Z1_1)).toBe(false);
});
it(" − direct links : parameter linked to a single parameter", async () => {
// create a Régime uniforme
await openCalculator(3, navBar, listPage);
@@ -261,81 +338,4 @@ describe("ngHyd − calculate with linked parameters", () => {
expect(td.getText()).not.toBe("");
});
});
it(" − bug nghyd#329 : unexpected ERR in results table", async () => {
await navBar.clickNewCalculatorButton();
await browser.pause(200);
// load session
await loadSession(navBar, sideNav, "./session/session-pab-chain-nghyd-329.json");
expect(await navBar.getAllCalculatorTabs().length).toBe(3);
// calculate PAB-Dimensions
await navBar.clickCalculatorTab(2);
await browser.pause(200);
// click "compute" button
const calcButton = await calcPage.getCalculateButton();
await calcButton.click();
await browser.pause(300);
// check that result is not empty
expect(await calcPage.hasResults()).toBe(true);
// check that ERR is not present in Volume line of results table
let frt = await calcPage.getFixedResultsTable();
let volumeRow = await calcPage.getNthRow(frt, 3);
let volumeCol = await calcPage.getNthColumn(volumeRow, 2);
let volume = await volumeCol.getText();
expect(Number(volume)).toBeCloseTo(44.565, 3);
// click PAB-Nombre tab
await navBar.clickCalculatorTab(0);
await browser.pause(200);
// go back to PAB-Dimensions
await navBar.clickCalculatorTab(2);
await browser.pause(200);
// check that ERR is not present in Volume line of results table
frt = await calcPage.getFixedResultsTable();
volumeRow = await calcPage.getNthRow(frt, 3);
volumeCol = await calcPage.getNthColumn(volumeRow, 2);
volume = await volumeCol.getText();
expect(Number(volume)).toBeCloseTo(44.565, 3);
});
it(" − a link target parameter should not be able to link to another parameter", async () => {
// create 1st PAB-Chute
await openCalculator(12, navBar, listPage);
// upstream water level should not have link mode (only one calculator)
let Z1_1 = await calcPage.getInputById("Z1");
expect(await calcPage.inputHasLinkModeButton(Z1_1)).toBe(false);
// create 2nd PAB-Chute
await openCalculator(12, navBar, listPage);
// back to 1st calculator
await navBar.clickCalculatorTab(0);
await browser.pause(200);
// upstream water level should have link mode (now there are 2 calculators)
Z1_1 = await calcPage.getInputById("Z1"); // re-request input to avoid "Request encountered a stale element - terminating request" warning (due to tab change)
expect(await calcPage.inputHasLinkModeButton(Z1_1)).toBe(true);
// back to 2nd calculator
await navBar.clickCalculatorTab(1);
await browser.pause(200);
// link upstream water level in 2nd calculator to upstream water level in 1st one
const Z1_2 = await calcPage.getInputById("Z1");
await calcPage.setParamMode(Z1_2, "link");
// back to 1st calculator
await navBar.clickCalculatorTab(0);
await browser.pause(200);
// upstream water level should not have link mode (already a link target)
Z1_1 = await calcPage.getInputById("Z1"); // re-request input to avoid "Request encountered a stale element - terminating request" warning (due to tab change)
expect(await calcPage.inputHasLinkModeButton(Z1_1)).toBe(false);
});
});
Loading