module.exports = {
'I can log in with a correct username and password': function (browser) {
browser
.page.login().visitLoginPage() // login() as page filename is login.js
.page.login().attemptLoginWithCredentials('bob', 'bob_is_awesome')
.page.login().assertLoggedIn();
}
}
Nightwatch supports page objects which are configured through an option
page_objects_path
nightwatch.json
This allows you to shorthand several commands into a reusable method
I.e. /e2e/pages/login.js
And you use them like this
Can support for this be added?