You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.
Im using this package in a pattern like you have in the docs:
module.exports = {
'Catch all XHRs, trigger click': function (browser) {
browser
.url('some/path')
.someStuff()
.moreStuff()
.waitForXHR('', 1000, function browserTrigger() {
browser.click('.tracking-link-1');
}, function assertValues(xhrs) {
browser.assert.equal(xhrs[0].status, "success");
browser.assert.equal(xhrs[0].method, "POST");
browser.assert.equal(xhrs[0].requestData, "200");
browser.assert.equal(xhrs[0].httpResponseCode, "200");
browser.assert.equal(xhrs[0].responseData, "");
});
}
}
Im wondering why waitForXHR blocks tests from continuing after the XHR assertion. Is there a different pattern I should be using to keep tests running after asserting the correct XHR status code? Currently, If I call .waitForXHR() the rest of my test will not run. I would like to do something like this:
module.exports = {
'Catch all XHRs, trigger click': function (browser) {
browser
.url('some/path')
.someStuff()
.moreStuff()
.waitForXHR('', 1000, function browserTrigger() {
browser.click('.tracking-link-1');
}, function assertValues(xhrs) {
browser.assert.equal(xhrs[0].status, "success");
browser.assert.equal(xhrs[0].method, "POST");
browser.assert.equal(xhrs[0].requestData, "200");
browser.assert.equal(xhrs[0].httpResponseCode, "200");
browser.assert.equal(xhrs[0].responseData, "");
});
.moreStuff()
.moreStuff()
}
}
Thanks!
The text was updated successfully, but these errors were encountered:
Hi, maybe I might be wrong but I found "assert" to be blocking tests.
It is to be used in case we know that something is so completely wrong that further tests are no more relevant at this point. Nightwatch has method "verify" which does you wish it did.
Please see description from NW api
The built-in extendable assert/verify library is available on the Nightwatch instance as two namespaces containing the same methods which perform assertions on elements:
.assert - when an assertion fails, the test ends, skipping all other assertions.
.verify - when an assertion fails, the test logs the failure and continues with other assertions.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hey everyone,
Im using this package in a pattern like you have in the docs:
Im wondering why waitForXHR blocks tests from continuing after the XHR assertion. Is there a different pattern I should be using to keep tests running after asserting the correct XHR status code? Currently, If I call .waitForXHR() the rest of my test will not run. I would like to do something like this:
Thanks!
The text was updated successfully, but these errors were encountered: