diff --git a/e2e/calculator.po.ts b/e2e/calculator.po.ts index 2639f2077eac7d2b9d11d01ad144ae54d469a062..fb065df26c3ffe322c83c6429a1b6e8e6b32ec94 100644 --- a/e2e/calculator.po.ts +++ b/e2e/calculator.po.ts @@ -121,22 +121,27 @@ export class CalculatorPage { async hasResults() { return ( - await element(by.css("fixedvar-results fixed-results > .fixed-results-container")).isPresent() + await this.presentAndVisible("fixedvar-results fixed-results > .fixed-results-container") || - await element(by.css("fixedvar-results results-chart > chart-results-container")).isPresent() + await this.presentAndVisible("fixedvar-results results-chart > chart-results-container") || - await element(by.css("section-results fixed-results > .fixed-results-container")).isPresent() + await this.presentAndVisible("section-results fixed-results > .fixed-results-container") || - await element(by.css("remous-results #main-chart")).isPresent() + await this.presentAndVisible("remous-results #main-chart") || - await element(by.css("pab-results pab-results-table")).isPresent() + await this.presentAndVisible("pab-results pab-results-table") || - await element(by.css("macrorugo-compound-results macrorugo-compound-results-table")).isPresent() + await this.presentAndVisible("macrorugo-compound-results macrorugo-compound-results-table") || - await element(by.css("jet-results .fixed-results-container")).isPresent() + await this.presentAndVisible("jet-results .fixed-results-container") ); } + async presentAndVisible(selector: string): Promise<boolean> { + const elt = element(by.css(selector)); + return await elt.isPresent() && await elt.isDisplayed(); + } + /** * For a given <table> element, check that values of all cells of all rows in <tbody> are * different from "NaN", "ERR" and optionally "" diff --git a/e2e/compute-reset-chained-links.e2e-spec.ts b/e2e/compute-reset-chained-links.e2e-spec.ts index c0ba8e5f462edf7d4da0bb623c778c089eefe02c..75ac102b9a124dfe9031abf5445963af7600f3e8 100644 --- a/e2e/compute-reset-chained-links.e2e-spec.ts +++ b/e2e/compute-reset-chained-links.e2e-spec.ts @@ -45,6 +45,7 @@ describe("ngHyd − compute then reset chained results − ", () => { // down-most module should have results let hasResults = await calcPage.hasResults(); + expect(hasResults).toBe(true); // up-most should not await navbar.clickCalculatorTabForUid("ZTFxeW"); hasResults = await calcPage.hasResults();