dolibarr/test/acceptance/stepDefinitions/loginContext.js
SwikritiT 1ef46d082c Feature files created to login, add users and logout
Co-authored-by: Yamuna Adhikari <adhikariamuna4444@gmail.com>
2020-10-08 12:59:56 +05:45

23 lines
797 B
JavaScript

const { Given, When, Then } = require('cucumber')
const { client } = require('nightwatch-api')
Given('the user has browsed to the login page', function () {
return client.page.loginPage().navigate();
});
When('user logs in with username {string} and password {string}', function (username, password) {
return client.page.loginPage().userLogsInWithUsernameAndPassword(username, password);
});
Then('the user should be directed to the homepage', function () {
return client.page.loginPage().successfulLogin();
});
Then('the user should not be able to login', function () {
return client.page.loginPage().unsuccessfulLogin();
});
Then('error message {string} should be displayed in the webUI', function (errormessage) {
return client.page.loginPage().loginErrorDisplayed(errormessage);
});