1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-08-02 12:05:24 +02:00

test: Setup UI test using BDD approach (#152)

This commit is contained in:
Amrita 2024-10-18 00:03:31 +05:45 committed by GitHub
parent 7f4bc1bb62
commit 4efc3be8d5
7 changed files with 131 additions and 1 deletions

View file

@ -0,0 +1,26 @@
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"
);
});