Nightwatch: Test an URL with expect

Created on 13 Feb 2016  路  16Comments  路  Source: nightwatchjs/nightwatch

For a smoothState'd application, I'd love be to be able to use:
browser.expect.url.to.be("http://foo.com/bar").before(2000)

enhancement

Most helpful comment

I really don't likes +1's

All 16 comments

This exists with the assert commands: http://nightwatchjs.org/api#assert-urlEquals

browser.assert.urlEquals("http://foo.com/bar");

The expect syntax is much better because you can poll with .before(timeout). We would love this.

We'll look at adding this. In the mean time, may or may not help but you can add timeouts on assert at a global level with retryAssertionTimeout

+1 to being able to do this with expect syntax!

+1. This would be very helpful because it would allow the use of .to.match with the url. This could be used when clicking on a list of elements and checking that the new url contains an id based on a RegEx.

+1 Please add this :)

+1

+1

I really don't likes +1's

@QuantumInformation in that case please suggest us a better way to vote on features we would like to see?

Simply mark the thumbs up on the OP, hardly very difficult is it? Getting these annoying emails to everyone is not going to make the issue get done quicker.

@QuantumInformation you can manage your notifications.
screen shot 2017-12-03 at 8 08 09 am

Some of us are actually interested in useful comments though.

--

Kind regards

Nikos
quantumjs.com

browser.url(currentUrl => {
browser.expect(currentUrl.value).to.not.contain('q=');
});

Is this not now fixed? https://nightwatchjs.org/api/#expect-url-

Yes it is.

Was this page helpful?
0 / 5 - 0 ratings