I am using Nightwatch + Cucumber for some automated tests and I noticed that when a element can't be found then functions like click and sendKeys won't fail the test. The error message is shown in the console like:
An error occurred while running .sendKeys() command on <.demo>: Timed out while waiting for element ".demo" with "css selector" to be present for 5000 milliseconds.
but the rest of the test will continue. My nightwatch default profile includes those flags:
suppressNotFoundErrors: false,
abortOnAssertionFailure: true,
abortOnElementLocateError: true,
Here is some example code (notice that i am using the page object model)
login: async function(email, password) {
await this.sendKeys('@emailField', email)
await this.click('@continueButton')
await this.sendKeys('@passwordField', password)
await this.click('@confirmPasswordButton')
await this.expect.element('@uniquePageElement').to.not.be.present;
},
Also, is it correct to not chain the commands?
I am using Nightwatch + Cucumber for some automated tests and I noticed that when a element can't be found then functions like click and sendKeys won't fail the test. The error message is shown in the console like:
An error occurred while running .sendKeys() command on <.demo>: Timed out while waiting for element ".demo" with "css selector" to be present for 5000 milliseconds.but the rest of the test will continue. My nightwatch default profile includes those flags:
Here is some example code (notice that i am using the page object model)
Also, is it correct to not chain the commands?