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:
parent
7f4bc1bb62
commit
4efc3be8d5
7 changed files with 131 additions and 1 deletions
26
client/tests/acceptance/stepDefinitions/loginContext.js
Normal file
26
client/tests/acceptance/stepDefinitions/loginContext.js
Normal 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"
|
||||
);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue