test: Setup UI test using BDD approach (#152)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
module.exports = {
|
||||
url: function () {
|
||||
return this.api.launchUrl + "/dashboard";
|
||||
},
|
||||
commands: {
|
||||
isDashboardPage: async function () {
|
||||
let result = false;
|
||||
await this.waitForElementVisible("@dashboardHeader");
|
||||
await this.isVisible("@dashboardHeader", (res) => {
|
||||
result = res.value;
|
||||
});
|
||||
return result;
|
||||
},
|
||||
},
|
||||
elements: {
|
||||
dashboardHeader: {
|
||||
selector: "a.Header_title__3SEjb",
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
module.exports = {
|
||||
url: function () {
|
||||
return this.api.launchUrl + "/login";
|
||||
},
|
||||
commands: {
|
||||
logIn: function (email, password) {
|
||||
return this.waitForElementVisible("@emailInput")
|
||||
.setValue("@emailInput", email)
|
||||
.waitForElementVisible("@passwordInput")
|
||||
.setValue("@passwordInput", password)
|
||||
.waitForElementVisible("@loginBtn")
|
||||
.click("@loginBtn");
|
||||
},
|
||||
},
|
||||
elements: {
|
||||
emailInput: {
|
||||
selector: "input[name=emailOrUsername]",
|
||||
},
|
||||
passwordInput: {
|
||||
selector: "input[name=password]",
|
||||
},
|
||||
loginBtn: {
|
||||
selector: "form button",
|
||||
},
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user