1 year ago
#346428
Sergei
Having error in helper method in wdio in async mode
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();
} ```
node.js
asynchronous
wdio
0 Answers
Your Answer