diff --git a/e2e/calculator.po.ts b/e2e/calculator.po.ts index d7552190a253a1a4fad88b89c59d3508acda60ff..6f8966a17bbee4c4c2679faa4a34235f295a42e6 100644 --- a/e2e/calculator.po.ts +++ b/e2e/calculator.po.ts @@ -249,6 +249,8 @@ export class CalculatorPage { || await this.presentAndVisible("pb-results pb-results-table") || + await this.presentAndVisible("pb-results pb-cloison-results") + || await this.presentAndVisible("macrorugo-compound-results macrorugo-compound-results-table") || await this.presentAndVisible("jet-results .fixed-results-container") diff --git a/e2e/prebarrages-results.e2e-spec.ts b/e2e/prebarrages-results.e2e-spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..e7af14868cf0e8d472746f0aa13c5296acba4c33 --- /dev/null +++ b/e2e/prebarrages-results.e2e-spec.ts @@ -0,0 +1,56 @@ +import { ListPage } from "./list.po"; +import { CalculatorPage } from "./calculator.po"; +import { Navbar } from "./navbar.po"; +import { browser, by, element } from "protractor"; +import { AppPage } from "./app.po"; +import { SideNav } from "./sidenav.po"; +import { PreferencesPage } from "./preferences.po"; +import { changeSelectValue, scrollPageToTop } from "./util.po"; + +/** + * Clone calculators + */ +describe("Prébarrages results - ", () => { + let listPage: ListPage; + let calcPage: CalculatorPage; + let navBar: Navbar; + let prefPage: PreferencesPage; + + beforeAll(() => { + listPage = new ListPage(); + calcPage = new CalculatorPage(); + navBar = new Navbar(); + prefPage = new PreferencesPage(); + jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 1000; + }); + + beforeEach(async () => { + // disable evil option "empty fields on module creation" + await prefPage.navigateTo(); + await prefPage.disableEvilEmptyFields(); + await browser.sleep(200); + }); + + it("every module shoud have results", async () => { + // create prébarrage calculator + await navBar.clickNewCalculatorButton(); + await listPage.clickMenuEntryForCalcType(30); + + // run calculation + const calcButton = calcPage.getCalculateButton(); + await calcButton.click(); + await browser.sleep(200); + + const nodes = element.all(by.css("g.nodes > g")); + const nb = await nodes.count(); + for (let n = 0; n < nb; n++) { + const node = nodes.get(n); + await node.click(); + await browser.sleep(200); + + // check that result is not empty + const hasResults = await calcPage.hasResults(); + expect(hasResults).toBe(true); + } + }); +}); diff --git a/src/app/formulaire/definition/form-definition.ts b/src/app/formulaire/definition/form-definition.ts index d7022502972c2cc748f6477791ce8e32ce60f977..23f9d2d9842af25f6fc5c132f443bd628b40c044 100644 --- a/src/app/formulaire/definition/form-definition.ts +++ b/src/app/formulaire/definition/form-definition.ts @@ -344,7 +344,7 @@ export abstract class FormulaireDefinition extends FormulaireNode implements Obs } } - this.completeParse(); + this.completeParse(false); } public hasParameter(symbol: string): boolean {