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

test(e2e): check that a linked parameter in a parametric section calculator...

test(e2e): check that a linked parameter in a parametric section calculator remains linked after changing section type

refs #572
parent 0b2021b2
No related branches found
No related tags found
1 merge request!177Resolve "Un paramètre lié ne change pas d'état après la suppression du module cible"
Pipeline #139928 passed
...@@ -145,6 +145,17 @@ export class CalculatorPage { ...@@ -145,6 +145,17 @@ export class CalculatorPage {
return await button.getAttribute("ng-reflect-checked") === "true"; return await button.getAttribute("ng-reflect-checked") === "true";
} }
/**
* @returns true if "linked mode" button linked to an input is selected
*/
async inputIsInLinkedMode(input: ElementFinder): Promise<boolean> {
// get parent (div.container)
const container = await this.findParentContainer(input);
// find calc radio button
const button: ElementFinder = container.element(by.css("mat-button-toggle.radio_link"));
return await button.getAttribute("ng-reflect-checked") === "true";
}
async hasResults() { async hasResults() {
return ( return (
await this.presentAndVisible("fixedvar-results fixed-results > .fixed-results-container") await this.presentAndVisible("fixedvar-results fixed-results > .fixed-results-container")
......
import { browser } from "protractor";
import { ListPage } from "./list.po";
import { Navbar } from "./navbar.po";
import { PreferencesPage } from "./preferences.po";
import { CalculatorPage } from "./calculator.po";
describe("linked parameter in calculator with section - ", () => {
let listPage: ListPage;
let navBar: Navbar;
let calcPage: CalculatorPage;
let prefPage: PreferencesPage;
beforeAll(async () => {
listPage = new ListPage();
navBar = new Navbar();
calcPage = new CalculatorPage();
prefPage = new PreferencesPage();
});
beforeEach(async () => {
// disable evil option "empty fields on module creation"
await prefPage.navigateTo();
await prefPage.disableEvilEmptyFields();
await browser.sleep(200);
});
it("modify section type", async () => {
browser.manage().window().setPosition(2000, 30);
// open first "parametric section" calculator
await navBar.clickNewCalculatorButton();
await listPage.clickMenuEntryForCalcType(2);
await browser.sleep(200);
// open second "parametric section" calculator
await navBar.clickNewCalculatorButton();
await listPage.clickMenuEntryForCalcType(2);
await browser.sleep(200);
// set Q parameter to linked mode
const inputQ = calcPage.getInputById("Q");
await calcPage.setParamMode(inputQ, "link");
// change section type
await calcPage.changeSelectValue(calcPage.getSelectById("select_section"), 3); // mode "parabolique"
// check Q is still in linked mode
expect(await calcPage.inputIsInLinkedMode(inputQ)).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