browser.wait() doesn't seem to work as documented
See original GitHub issueAs documented here: http://zombie.labnotes.org/API#browser-wait-done-callback the wait()
function should accept two functions as arguments, the first of which is a return condition that, once met, will run the second argument function.
However, in my mocha test, this is a failing example of a try at this, and the second function still runs, even though the first return returns false.
I’m honestly not even sure the hashChanged function is ever run, any attempt to put a debugger;
or console.log( ... );
in the function never seems to catch or output anything.
it('should change the location hash', function (done) {
function hashChanged (window) {
return window.location.hash === 'THIS IS NEVER, AND WILL NEVER BE TRUE!';
}
browser.pressButton('sign-in', function (err) {
expect(err).to.be.undefined;
browser.wait(hashChanged, function () {
browser.evaluate('window.location.hash').should.equal('#');
done();
});
});
});
Issue Analytics
- State:
- Created 10 years ago
- Comments:16 (5 by maintainers)
Top Results From Across the Web
Why does browser.wait seem to work even with a wait time of 0?
var wait = 0 // Count to three then change content to 'Times up' var timeout = setTimeout(timesUp, wait) function timesUp() { document.body....
Read more >browser.wait() does not work when there is no spinner #4481
I am facing very weird behaviour of browser.wait(). In my test website sometime Spinner appear and sometime it does not appear to handle ......
Read more >Protractor: how to write a test that waits for a screen element to ...
I've looked at the object returned by browser.getCurrentUrl(), and it doesn't have any methods that allow comparison with another value. Any suggestions? I'm ......
Read more >How To Wait For Element In WebdriverIO - YouTube
In this video, we will discuss how to wait for some element which is not displayed. We will use waitForDisplayed () from wdio...
Read more >WebDriver - W3C
WebDriver is a remote control interface that enables introspection and control of user agents. It provides a platform- and language-neutral ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah! Maybe that is my real issue then…
My application connects the socket, and then fills out the HTML page with the data it gets over-the-wire, which I was trying to wait for with the above examples…
Ok, thanks for all the help with this!