mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 21:29:43 +02:00
27 lines
753 B
JavaScript
27 lines
753 B
JavaScript
|
const { Given, When, Then } = require("@cucumber/cucumber");
|
||
|
const { client } = require("nightwatch-api");
|
||
|
const assert = require("assert");
|
||
|
|
||
|
const loginPage = client.page.loginPage();
|
||
|
const dashboardPage = client.page.dashboardPage();
|
||
|
|
||
|
Given("user has browsed to the login page", function () {
|
||
|
return loginPage.navigate();
|
||
|
});
|
||
|
|
||
|
When(
|
||
|
"user logs in with username/email {string} and password {string} using the webUI",
|
||
|
function (username, password) {
|
||
|
return loginPage.logIn(username, password);
|
||
|
}
|
||
|
);
|
||
|
|
||
|
Then("the user should be in the dashboard page", async function () {
|
||
|
const isDashboard = await dashboardPage.isDashboardPage();
|
||
|
assert.strictEqual(
|
||
|
isDashboard,
|
||
|
true,
|
||
|
"Expected to see dashboard page but not visible"
|
||
|
);
|
||
|
});
|