Commit b807e0c3 authored by Kevin Stroeher's avatar Kevin Stroeher Committed by Curtis Adam

Fix failing testcases

parent 648f2b42
......@@ -33,6 +33,7 @@ module.exports = function () {
this.Then(/^the cardset should not be in the list anymore$/, function () {
browser.waitForVisible("#cardsetConfirmModalAdmin", 5000, true);
browser.pause(1000);
var elements = browser.elements(".delete");
expect(elements.value.length - 1).toEqual(numberOfCardsets - 1);
......
......@@ -18,6 +18,7 @@ module.exports = function () {
this.Given(/^change to cardset$/, function () {
// Write code here that turns the phrase above into concrete actions
browser.pause(2000);
browser.url('http://localhost:3000/cardset/2P6mg5iqCZ49QPPDz');
browser.waitForExist('.cardsetInfo', 5000);
});
......
......@@ -25,15 +25,15 @@ module.exports = function () {
});
this.Given(/^User is on the my cardset view$/, function () {
browser.pause(2000);
browser.url('http://localhost:3000/created');
while (browser.elements('.cardsetRow').value.length === 0) {
browser.pause(500);
}
browser.waitForExist('.cardsetRow', 10000);
cardsetsBeforeCreated = browser.elements('.cardsetRow').value.length;
});
this.When(/^User clicks on the create cardset button$/, function () {
browser.click('#newCardSet');
browser.pause(2000);
});
this.Then(/^he is redirected to the new cardset form$/, function () {
......
......@@ -13,6 +13,7 @@ module.exports = function () {
browser.windowHandleSize();
});
this.Given(/^User is on the my cardset view$/, function () {
browser.pause(1000);
browser.url('http://localhost:3000/created');
var bool = browser.waitForVisible('#newCardSet', 15000);
expect(bool).toBe(true);
......@@ -32,11 +33,11 @@ module.exports = function () {
});
this.Then(/^he should be able to press the delete cardset button$/, function () {
browser.click('#cardSetDelete');
browser.pause(500);
browser.pause(1000);
});
this.Then(/^he should be able to press the delete cardset button again to be sure$/, function () {
browser.click('#cardSetConfirm');
browser.pause(500);
browser.pause(1000);
});
this.Then(/^he should be returned to the my cardset view$/, function () {
browser.waitForVisible('#cardSetView', 5000);
......
......@@ -23,6 +23,7 @@ module.exports = function () {
});
this.Given(/^User is on the my cardset view$/, function () {
browser.pause(1000);
browser.url('http://localhost:3000/created');
var bool = browser.waitForVisible('#newCardSet', 15000);
expect(bool).toBe(true);
......
......@@ -21,6 +21,7 @@ module.exports = function () {
//
/////////////////////////////////////////
this.Given(/^I am on the cardset view of the testcardset$/, function () {
browser.pause(2000);
browser.url('http://localhost:3000/created');
var bool = browser.waitForVisible('#newCardSet', 15000);
expect(bool).toBe(true);
......@@ -30,6 +31,7 @@ module.exports = function () {
});
this.When(/^I click the Button Letiner's learning box$/, function () {
browser.waitForExist('#learnBox', 10000);
browser.click('#learnBox');
});
......@@ -40,6 +42,7 @@ module.exports = function () {
});
this.Then(/^Box one contains two cards$/, function () {
browser.waitForExist('#subject1 span.badge', 10000);
var cards = browser.getText('#subject1 span.badge');
expect(cards).toBe("2");
});
......@@ -60,6 +63,7 @@ module.exports = function () {
expect(cards).toBe("0");
logout();
browser.pause(2000);
});
......@@ -69,6 +73,7 @@ module.exports = function () {
//
/////////////////////////////////////////
this.Given(/^I went to the box view of the testcardset$/, function () {
browser.pause(1000);
browser.url('http://localhost:3000/created');
var bool = browser.waitForVisible('#newCardSet', 15000);
expect(bool).toBe(true);
......@@ -79,25 +84,30 @@ module.exports = function () {
});
this.When(/^I click on the Button Box one$/, function () {
browser.waitForExist('#subject1', 10000);
browser.click('#subject1');
});
this.Then(/^The frontside of first card is shown$/, function () {
browser.waitForExist('.front0 p', 10000);
var text = browser.getText('.front0 p');
expect(text).toBe("question1");
});
this.Then(/^I can click on the card$/, function () {
browser.waitForExist('#cardCarousel', 10000);
browser.click('#cardCarousel');
});
this.Then(/^The backside of the first card is shown$/, function () {
browser.waitForExist('.back0 p', 10000);
var text = browser.getText('.back0 p');
expect(text).toBe("answer1");
});
this.Then(/^I can click on the button Known$/, function () {
browser.waitForExist('#known', 10000);
browser.click('#known');
});
......@@ -118,6 +128,7 @@ module.exports = function () {
/////////////////////////////////////////
this.When(/^I click the Button Memo$/, function () {
browser.waitForExist('#learnMemo', 10000);
browser.click('#learnMemo');
});
......@@ -170,6 +181,7 @@ module.exports = function () {
});
this.Then(/^I can click button three$/, function () {
browser.waitForExist('#memoRate3', 10000);
oldVal = browser.getText('.frontblock span p');
browser.click('#memoRate3');
});
......
......@@ -15,6 +15,7 @@ module.exports = function () {
});
this.Given(/^User is on the pool view$/, function () {
browser.pause(2000);
browser.url('http://localhost:3000/pool');
browser.waitForVisible('#bs-example-navbar-collapse-1', 5000);
});
......@@ -25,6 +26,7 @@ module.exports = function () {
});
this.Then(/^he is shown the details of the cardset$/, function () {
browser.pause(2000);
var url = browser.getUrl();
expect(url).toBe("http://localhost:3000/cardset/2P6mg5iqCZ49QPPDz");
......
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