I have already seen this solution, but it did not help.
I am trying to run webdriver.io tests using mocha, here I am using browser.waitUntil() method from webdriver.io, more details can be found here: https://webdriver.io/docs/api/browser/waitUntil.html I have tried a different solution to the issue including adding 'done' to the method call and also I am giving max timeout in conf.js as well here 10000ms, but still, the page seems to get hang on the result page.
Here increase timeout:
mochaOpts: {
ui: 'bdd',
timeout: 100000
},
Changed default wait time of mocha to at 100000ms Added done as promise resolution
it('should see product and version selected', () => {
browser.url('//some url');
browser.maximizeWindow();
browser.waitUntil(() => {
return $(ProductPage.productSelector()).isDisplayed()
}, 100000, 'expected page is loaded');
let productSelector = ProductPage.otherProductSelector();
let isEnabled = productSelector.isEnabled();
if(isEnabled == true){
const spanEle = $('//span[contains(text(),"text")]');
isDisplayed = spanEle.isDisplayed();
console.log(isDisplayed);
assert.equal(isDisplayed, true, "Passed");
}
})
Error:
Timeout of 100000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.