diff --git a/e2e/prebarrages-results.e2e-spec.ts b/e2e/prebarrages-results.e2e-spec.ts index e7af14868cf0e8d472746f0aa13c5296acba4c33..09c79d23b2f5527fdb744664d70aa3023ce6a2ee 100644 --- a/e2e/prebarrages-results.e2e-spec.ts +++ b/e2e/prebarrages-results.e2e-spec.ts @@ -1,11 +1,9 @@ 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"; +import { browser, $, $$, expect } from '@wdio/globals' +import { scrollToElement } from "./util.po"; /** * Clone calculators @@ -27,26 +25,31 @@ describe("Prébarrages results - ", () => { beforeEach(async () => { // disable evil option "empty fields on module creation" await prefPage.navigateTo(); + await browser.pause(200); await prefPage.disableEvilEmptyFields(); - await browser.sleep(200); + await browser.pause(200); }); it("every module shoud have results", async () => { // create prébarrage calculator await navBar.clickNewCalculatorButton(); + await browser.pause(200); await listPage.clickMenuEntryForCalcType(30); + await browser.pause(200); // run calculation - const calcButton = calcPage.getCalculateButton(); + const calcButton = await calcPage.getCalculateButton(); await calcButton.click(); - await browser.sleep(200); + await browser.pause(200); - const nodes = element.all(by.css("g.nodes > g")); - const nb = await nodes.count(); + const nodes = await $$("g.nodes > g"); + const nb = nodes.length; for (let n = 0; n < nb; n++) { - const node = nodes.get(n); + const node = nodes[n]; + await scrollToElement(node); + await browser.pause(100); await node.click(); - await browser.sleep(200); + await browser.pause(200); // check that result is not empty const hasResults = await calcPage.hasResults();