Having error in helper method in wdio in async mode

80 Views Asked by At

Helper files that use other browser commands have to be moved to before hook.

NavigationByTextInSideMenu(page) {
    const sideMenu = {}
    await browser.waitUntil(async () => {
        await this.$$sideBarMenu.map(async (elem) => elem.isDisplayed()).length > 10;
    }, { timeout: 10000, timeoutMsg: 'Not all elements were visible' });
    await this.$$sideBarMenu.forEach(async (element) => {
        sideMenu[await element.getText()] = element;

    });
    console.log(Object.keys(sideMenu))
    await sideMenu[page].click();
} ``` 
0

There are 0 best solutions below