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

test(e2e): check that calculate button enabled status does not depend of other...

test(e2e): check that calculate button enabled status does not depend of other calculators validity status

refs #544
parent df4d60fd
No related branches found
No related tags found
1 merge request!144Resolve "PréBarrages: les changements de couleur du schéma ne sont pas instantanées"
import { ListPage } from "./list.po";
import { CalculatorPage } from "./calculator.po";
import { Navbar } from "./navbar.po";
import { browser } from "protractor";
import { PreferencesPage } from "./preferences.po";
describe("Calculate button - ", () => {
let listPage: ListPage;
let calcPage: CalculatorPage;
let navBar: Navbar;
let prefPage: PreferencesPage;
beforeAll(async () => {
prefPage = new PreferencesPage();
listPage = new ListPage();
calcPage = new CalculatorPage();
navBar = new Navbar();
});
beforeEach(async () => {
await prefPage.navigateTo();
// disable evil option "empty fields on module creation"
await prefPage.disableEvilEmptyFields();
await browser.sleep(200);
});
it("check button status only depends on calculator (no link between calculators)", async () => {
// start page
await navBar.clickNewCalculatorButton();
await browser.sleep(200);
// open PAB: chute calculator
await listPage.clickMenuEntryForCalcType(12);
await browser.sleep(200);
// start page
await navBar.clickNewCalculatorButton();
await browser.sleep(200);
// open PAB: dimensions
await listPage.clickMenuEntryForCalcType(5);
await browser.sleep(200);
// fill width field with invalid data
const inputW = calcPage.getInputById("W");
await inputW.clear();
await browser.sleep(20);
await inputW.sendKeys("-1");
await browser.sleep(200);
debugger
// check that "compute" button is inactive
let calcButtonClone = calcPage.getCalculateButton();
let disabledStateClone = await calcButtonClone.getAttribute("disabled");
expect(disabledStateClone).toBe("true");
// back to PAB: chute
await navBar.clickCalculatorTab(0);
await browser.sleep(200);
// check that "compute" button is active
calcButtonClone = calcPage.getCalculateButton();
disabledStateClone = await calcButtonClone.getAttribute("disabled");
expect(disabledStateClone).not.toBe("true");
// back to PAB: dimensions
await navBar.clickCalculatorTab(1);
await browser.sleep(200);
// check that "compute" button is inactive
calcButtonClone = calcPage.getCalculateButton();
disabledStateClone = await calcButtonClone.getAttribute("disabled");
expect(disabledStateClone).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