Improved cucumber tests
This commit is contained in:
parent
b53e5d0e36
commit
b54707f2dc
6 changed files with 49 additions and 18 deletions
|
|
@ -35,35 +35,46 @@ module.exports = function doSteps(notos) {
|
|||
function waitNoBert() {
|
||||
client.pause(2000);
|
||||
if (client.isVisible('.bert-container')) {
|
||||
console.log('Removing bert alert');
|
||||
// console.log('Removing bert alert');
|
||||
client.click('.bert-container');
|
||||
client.waitForVisible('.bert-container', 10000, true);
|
||||
} else {
|
||||
console.log('No bert alert');
|
||||
// console.log('No bert alert');
|
||||
}
|
||||
}
|
||||
|
||||
function register() {
|
||||
function logoutIfLogged() {
|
||||
if (client.isVisible('#logout')) {
|
||||
client.click('#logout');
|
||||
}
|
||||
client.waitForVisible('#signup', 10000);
|
||||
}
|
||||
|
||||
function register() {
|
||||
logoutIfLogged();
|
||||
client.waitForVisible('#signup', 10000);
|
||||
client.click('#signup');
|
||||
setUserValues();
|
||||
if (!notos) {
|
||||
client.click('input[name="tos"]');
|
||||
}
|
||||
client.click('#signUpSubmit');
|
||||
client.waitForVisible('#logout', 10000);
|
||||
}
|
||||
|
||||
this.Given(/^I logout if logged$/, () => {
|
||||
waitNoBert();
|
||||
logoutIfLogged();
|
||||
});
|
||||
|
||||
this.Given(/^I have an account and I logged in$/, () => {
|
||||
register();
|
||||
});
|
||||
|
||||
function checkName() {
|
||||
client.waitForVisible('#profile', 5000);
|
||||
client.waitForText('#profile', firstName);
|
||||
client.waitForText('#profile', lastName);
|
||||
client.waitUntilText('#profile', firstName);
|
||||
client.waitUntilText('#profile', lastName);
|
||||
}
|
||||
|
||||
this.Then(/^I should be logged in$/, () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue