Back
I am looking to create reusable components within my nightwatch.js tests.
ie. login to the web app, logout of the web app
What is the best method/pattern for creating these steps in a reusable way?
You can create custom commands for that: http://nightwatchjs.org/guide#writing-custom-commands
exports.command = function(username, password) ;
Use the custom command in your test:
.login("your_username", "your_password")
31k questions
32.8k answers
501 comments
693 users