diff --git a/e2e/pressure-loss-empty-fields.e2e-spec.ts b/e2e/pressure-loss-empty-fields.e2e-spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..93befa97eb9117cacf7246341190aedfd3cbf1cf --- /dev/null +++ b/e2e/pressure-loss-empty-fields.e2e-spec.ts @@ -0,0 +1,40 @@ +import { ListPage } from "./list.po"; +import { Navbar } from "./navbar.po"; +import { browser } from "protractor"; +import { CalculatorPage } from "./calculator.po"; +import { PreferencesPage } from "./preferences.po"; + +fdescribe("Check fields are empty in 'pressure loss' calculator when created with 'empty fields' option -", () => { + 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 () => { + // enable evil option "empty fields on module creation" + await prefPage.navigateTo(); + await prefPage.enableEvilEmptyFields(); + await browser.sleep(200); + }); + + it("with Lechapt-Calmon pressure loss law", async () => { + // open "pressure loss" calculator + await navBar.clickNewCalculatorButton(); + await listPage.clickMenuEntryForCalcType(35); + await browser.sleep(200); + + // select Lechapt-Calmon pressure loss law + const materialSelect = calcPage.getSelectById("select_pressurelosstype"); + await calcPage.changeSelectValue(materialSelect, 0); + await browser.sleep(200); + + expect(calcPage.checkEmptyOrFilledFields(["Q", "D", "Lg", "Kloc"], [true, true, true, true])); + }); +});