Commit 90e3d8e0 authored by Grand Francois's avatar Grand Francois
Browse files

fix(e2e): migrate predams test to WebdriverIO

refs #618
Showing with 14 additions and 11 deletions
+14 -11
import { ListPage } from "./list.po"; import { ListPage } from "./list.po";
import { CalculatorPage } from "./calculator.po"; import { CalculatorPage } from "./calculator.po";
import { Navbar } from "./navbar.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 { PreferencesPage } from "./preferences.po";
import { changeSelectValue, scrollPageToTop } from "./util.po"; import { browser, $, $$, expect } from '@wdio/globals'
import { scrollToElement } from "./util.po";
/** /**
* Clone calculators * Clone calculators
...@@ -27,26 +25,31 @@ describe("Prébarrages results - ", () => { ...@@ -27,26 +25,31 @@ describe("Prébarrages results - ", () => {
beforeEach(async () => { beforeEach(async () => {
// disable evil option "empty fields on module creation" // disable evil option "empty fields on module creation"
await prefPage.navigateTo(); await prefPage.navigateTo();
await browser.pause(200);
await prefPage.disableEvilEmptyFields(); await prefPage.disableEvilEmptyFields();
await browser.sleep(200); await browser.pause(200);
}); });
it("every module shoud have results", async () => { it("every module shoud have results", async () => {
// create prébarrage calculator // create prébarrage calculator
await navBar.clickNewCalculatorButton(); await navBar.clickNewCalculatorButton();
await browser.pause(200);
await listPage.clickMenuEntryForCalcType(30); await listPage.clickMenuEntryForCalcType(30);
await browser.pause(200);
// run calculation // run calculation
const calcButton = calcPage.getCalculateButton(); const calcButton = await calcPage.getCalculateButton();
await calcButton.click(); await calcButton.click();
await browser.sleep(200); await browser.pause(200);
const nodes = element.all(by.css("g.nodes > g")); const nodes = await $$("g.nodes > g");
const nb = await nodes.count(); const nb = nodes.length;
for (let n = 0; n < nb; n++) { 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 node.click();
await browser.sleep(200); await browser.pause(200);
// check that result is not empty // check that result is not empty
const hasResults = await calcPage.hasResults(); const hasResults = await calcPage.hasResults();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment