1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-24 15:49:46 +02:00
planka/client/tests/acceptance/stepDefinitions/loginContext.js
2021-08-03 11:17:26 +05:45

20 lines
635 B
JavaScript

const { Given, When, Then } = require('@cucumber/cucumber');
const { client } = require('nightwatch-api');
Given('user has browsed to the login page', function () {
return client.url(client.launchUrl + '/login');
});
When(
'user logs in with username {string} and password {string}',
function (username, password) {
return client
.setValue('input[name=emailOrUsername]', username)
.setValue('input[name=password]', password)
.click('.field > button');
}
);
Then('user should be in dashboard page', async function () {
return client.assert.containsText('.menu > .item:nth-child(3)', 'Demo Demo');
});