Commit 4166f842 authored by Kevin Stroeher's avatar Kevin Stroeher Committed by Curtis Adam

change login to be more reliable

parent 8bc60969
import {login, logout, agreeCookies} from "../helper_functions";
var username = "testuser";
import {login, logout, agreeCookies, setResolution} from "../helper_functions";
module.exports = function () {
'use strict';
......@@ -8,12 +6,14 @@ module.exports = function () {
this.Given(/^I am on the site$/, function () {
// Write code here that turns the phrase above into concrete actions
browser.url('http://localhost:3000');
agreeCookies();
});
this.Given(/^He loges in$/, function () {
// Write code here that turns the phrase above into concrete actions
login(username);
browser.pause(1000);
login("testuser");
agreeCookies();
setResolution();
});
this.Given(/^change to cardset$/, function () {
......@@ -24,12 +24,12 @@ module.exports = function () {
this.Then(/^they are on the cardset$/, function () {
// Write code here that turns the phrase above into concrete actions
browser.waitForExist('#cardsetInfo', 5000);
browser.waitForExist('.cardsetInfo', 5000);
});
this.Then(/^they change the view to cardlist$/, function () {
// Write code here that turns the phrase above into concrete actions
browser.click('#editCard');
browser.click('#btnToListLayout');
});
this.Then(/^they see the cardlist$/, function () {
......@@ -44,7 +44,7 @@ module.exports = function () {
this.Then(/^they se cardset again$/, function () {
// Write code here that turns the phrase above into concrete actions
browser.waitForExist('#cardsetInfo', 5000);
browser.waitForExist('.cardsetInfo', 5000);
});
this.Then(/^they log out$/, function () {
......
......@@ -6,7 +6,7 @@ export function login(username) {
browser.waitForExist("#TestingBackdorUsername", 5000);
client.execute(SetUsername, username);
browser.click('a[id="BackdoorLogin"]');
browser.click('a[id="BackdoorLogin"]');
browser.pause(1000);
}
/* exported logout */
......
......@@ -14,6 +14,7 @@ module.exports = function () {
this.Given(/^submit the login form$/, function () {
// Write code here that turns the phrase above into concrete actions
login(username);
login(username);
});
this.Then(/^he should see the AGB page$/, function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment