Commit 7a4ad699 authored by Curtis Adam's avatar Curtis Adam

WIP: Remove chimp issues

parent 3b08734d
......@@ -20,8 +20,8 @@
<tbody>
{{#each allColleges}}
<tr>
<td id="tblCollege">{{college}}</td>
<td id="tblCourse">{{course}}</td>
<td class="tblCollege-{{@index}}">{{college}}</td>
<td class="tblCourse-{{@index}}">{{course}}</td>
<td>
<button class="btn btn-danger btn-raised" type="submit"
id="deleteCollageCourse">{{_ "admin.delete"}}</button>
......@@ -54,9 +54,9 @@
</div>
<div class="row">
<div class="col-md-12">
<button type="submit" id="cancelButton" class="btn btn-default btn-raised pull-left">{{_
<button type="button" id="cancelButton" class="btn btn-default btn-raised pull-left">{{_
"admin.confirm-form.cancel"}}</button>
<button type="submit" id="insertButton" class="btn btn-success btn-raised pull-right">&ensp;{{_
<button type="button" id="insertButton" class="btn btn-success btn-raised pull-right">&ensp;{{_
"admin.confirm-form.settings.save"}}</button>
</div>
</div>
......
......@@ -141,7 +141,7 @@
class="btn btn-danger btn-raised col-xs-12 col-sm-3" onclick="history.go(-1)">{{_
"confirmcard"}}</button>
{{/if}}
<button id=" cardCancel" class="btn btn-default btn-raised cancel col-xs-12 col-sm-3"
<button id="cardCancel" class="btn btn-default btn-raised cancel col-xs-12 col-sm-3"
onclick="history.go(-1)">{{_ "declinecard"}}</button>
<button id="cardSave"
class="btn btn-success btn-raised save pull-right col-xs-12 col-sm-3" {{disableIfOffline}}>
......
......@@ -273,7 +273,7 @@
<br/>
<div class="form-group">
<div class="checkbox">
<label>
<label id="select_checkbox">
<input type="checkbox" value="" id="accept_checkbox">
<span class="checkbox-material">
<span class="check"></span>
......
......@@ -57,7 +57,7 @@
</button>
</div>
<div class="btn-group">
<button id="memoRate3" class="btn btn-default btn-raised rate-answe" data-id="3" data-toggle="tooltip"
<button id="memoRate3" class="btn btn-default btn-raised rate-answer" data-id="3" data-toggle="tooltip"
title="{{_ "cardmemo.rate3"}}">3
</button>
</div>
......
......@@ -42,7 +42,7 @@
</a>
</li>
<li class="dropdown col-lg-2">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
<a href="#" class="dropdown-toggle authorBtn" data-toggle="dropdown" role="button"
aria-haspopup="true" aria-expanded="false">
{{#if hasAuthorFilter}}
{{poolFilterAuthor}}
......@@ -66,7 +66,7 @@
</ul>
</li>
<li class="dropdown col-lg-2">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
<a href="#" class="dropdown-toggle collegeBtn" data-toggle="dropdown" role="button"
aria-haspopup="true" aria-expanded="false">
{{#if hasCollegeFilter}}
{{poolFilterCollege}}
......@@ -88,7 +88,7 @@
</ul>
</li>
<li class="dropdown col-lg-2">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
<a href="#" class="dropdown-toggle courseBtn" data-toggle="dropdown" role="button"
aria-haspopup="true" aria-expanded="false" id="collegeBtn">
{{#if hasCourseFilter}}
{{poolFilterCourse}}
......@@ -109,7 +109,7 @@
</ul>
</li>
<li class="dropdown col-lg-1">
<a href="#" id="moduleFilter" class="dropdown-toggle" data-toggle="dropdown" role="button"
<a href="#" id="moduleFilter" class="dropdown-toggle moduleBtn" data-toggle="dropdown" role="button"
aria-haspopup="true" aria-expanded="false">
{{#if hasModuleFilter}}
{{poolFilterModule}}
......
......@@ -42,7 +42,7 @@ Template.welcome.events({
// Backdoor for login in acceptance tests
'click #BackdoorLogin': function () {
if (Meteor.settings.public.displayLoginButtons.displayTestingBackdoor) {
Meteor.insecureUserLogin(document.getElementById("TestingBackdorUsername").value);
Meteor.insecureUserLogin($("#TestingBackdoorUsername").val());
}
},
......@@ -72,6 +72,6 @@ Template.welcome.onRendered(function () {
// Backdoor for login in acceptance tests
if (Meteor.settings.public.displayLoginButtons.displayTestingBackdoor) {
$('.panel-footer').append('<a id="BackdoorLogin" href=""><img src="img/social_backdoor_box_white.png" /></a>');
$('.panel-footer').append('<input id="TestingBackdorUsername" type="text" name="username" placeholder="username"></input>');
$('.panel-footer').append('<input id="TestingBackdoorUsername" name="username" placeholder="username">');
}
});
......@@ -15,8 +15,6 @@ module.exports = function () {
});
this.Given(/^user is in the back end$/, function () {
browser.waitForVisible('a.cc_btn.cc_btn_accept_all',5000);
browser.click('a.cc_btn.cc_btn_accept_all');
browser.waitForVisible("#adminpanel", 5000);
browser.click('#adminpanel');
});
......
......@@ -12,8 +12,6 @@ module.exports = function () {
});
this.Given(/^user is in the back end$/, function () {
browser.waitForVisible('a.cc_btn.cc_btn_accept_all',5000);
browser.click('a.cc_btn.cc_btn_accept_all');
browser.waitForVisible("#adminpanel", 5000);
browser.click("#adminpanel");
});
......@@ -26,18 +24,18 @@ module.exports = function () {
this.When(/^user creates a new college and course$/, function () {
browser.waitForExist('#college', 5000);
browser.setValue('#college', 'THM');
browser.setValue('#courseOfStudies', 'MSP');
browser.setValue('#courseOfStudies', 'WBS');
browser.waitForVisible('#insertButton');
browser.click("#insertButton");
});
this.Then(/^user should see the college and course in list$/, function () {
browser.waitForExist('#tblCollege', 5000);
var college = browser.getText("#tblCollege");
var course = browser.getText("#tblCourse");
browser.waitForExist('.tblCollege-2', 5000);
var college = browser.getText(".tblCollege-2");
var course = browser.getText(".tblCourse-2");
expect(college).toEqual("THM");
expect(course).toEqual("MSP");
expect(course).toEqual("WBS");
logoutAdmin();
});
......
......@@ -17,8 +17,6 @@ module.exports = function () {
});
this.Given(/^change to cardset$/, function () {
browser.waitForVisible('a.cc_btn.cc_btn_accept_all',5000);
browser.click('a.cc_btn.cc_btn_accept_all');
browser.waitForVisible('#cardsets',5000);
browser.click('#cardsets');
browser.waitForVisible("a[href='/cardset/2P6mg5iqCZ49QPPDz']",5000);
......@@ -36,7 +34,7 @@ module.exports = function () {
});
this.Then(/^they see the cardlist$/, function () {
browser.waitForExist('#set-details-region', 5000);
browser.waitForExist('#cardset-list', 5000);
});
this.Then(/^they change the view back to cardset$/, function () {
......
......@@ -25,8 +25,6 @@ module.exports = function () {
});
this.Given(/^User is on the my cardset view$/, function () {
browser.waitForVisible('a.cc_btn.cc_btn_accept_all',5000);
browser.click('a.cc_btn.cc_btn_accept_all');
browser.waitForVisible('#cardsets',5000);
browser.click('#cardsets');
browser.waitForExist('.cardsetRow', 10000);
......
......@@ -18,8 +18,6 @@ module.exports = function () {
browser.windowHandleSize();
});
this.Given(/^he is on the view of a cardset$/, function () {
browser.waitForVisible('a.cc_btn.cc_btn_accept_all',5000);
browser.click('a.cc_btn.cc_btn_accept_all');
browser.waitForVisible('#cardsets',5000);
browser.click('#cardsets');
browser.waitForVisible("a[href='/cardset/2P6mg5iqCZ49QPPDz']",5000);
......@@ -89,8 +87,8 @@ module.exports = function () {
deleteButton.click();
});
this.Then(/^he have to confirm the delete process$/, function () {
browser.waitForVisible('#cardConfirm',5000);
var confirmDeleteButton = browser.element('#cardConfirm');
browser.waitForVisible('#changeDeleteButton',5000);
var confirmDeleteButton = browser.element('#changeDeleteButton');
confirmDeleteButton.click();
});
/**
......@@ -99,7 +97,7 @@ module.exports = function () {
* ---------------------------------------------------------------------
*/
this.Then(/^he can press on the \-\-Cancel\-\- button$/, function () {
browser.waitForVisible('#cardCancel');
browser.waitForVisible('#cardCancel', 5000);
browser.click('#cardCancel');
});
this.Then(/^he should be redirected back$/, function () {
......
......@@ -7,14 +7,12 @@ module.exports = function () {
browser.url('http://localhost:3000');
});
this.Given(/^User is logged in$/, function () {
login("testuser");
agreeCookies();
login("testuser");
setResolution();
browser.windowHandleSize();
});
this.Given(/^User is on the my cardset view$/, function () {
browser.waitForVisible('a.cc_btn.cc_btn_accept_all',5000);
browser.click('a.cc_btn.cc_btn_accept_all');
browser.waitForVisible('#cardsets',5000);
browser.click('#cardsets');
var bool = browser.waitForVisible('#newCardSet', 15000);
......
......@@ -15,8 +15,6 @@ module.exports = function () {
browser.windowHandleSize();
});
this.Given(/^he is on the view of a cardset \(EaC\)$/, function () {
browser.waitForVisible('a.cc_btn.cc_btn_accept_all',5000);
browser.click('a.cc_btn.cc_btn_accept_all');
browser.waitForVisible('#cardsets',5000);
browser.click('#cardsets');
browser.waitForVisible("a[href='/cardset/2P6mg5iqCZ49QPPDz']",5000);
......@@ -30,7 +28,7 @@ module.exports = function () {
});
this.Then(/^he should be on the edit view of this card$/, function () {
var currentUrl = browser.getUrl();
var expectedUrl = "http://localhost:3000/cardset/2P6mg5iqCZ49QPPDz/editcard/AS2Yor6ArBdM8toKd";
var expectedUrl = "http://localhost:3000/cardset/2P6mg5iqCZ49QPPDz/editcard/84omt45zeyky5hNMX";
expect(currentUrl).toEqual(expectedUrl);
});
this.Then(/^he enters "([^"]*)" for the front of the card \(EaC\)$/, function (arg1) {
......@@ -66,7 +64,9 @@ module.exports = function () {
editButton.waitForVisible(5000);
editButton.click();
browser.waitForExist('#frontEditor', 5000);
browser.setValue('#frontEditor', sFront);
browser.waitForExist('#backEditor', 5000);
browser.setValue('#backEditor', sBack);
browser.waitForExist('#cardSave', 5000);
browser.click('#cardSave');
......
......@@ -23,8 +23,6 @@ module.exports = function () {
});
this.Given(/^User is on the my cardset view$/, function () {
browser.waitForVisible('a.cc_btn.cc_btn_accept_all',5000);
browser.click('a.cc_btn.cc_btn_accept_all');
browser.waitForVisible('#cardsets',5000);
browser.click('#cardsets');
var bool = browser.waitForVisible('#newCardSet', 15000);
......@@ -99,7 +97,6 @@ module.exports = function () {
});
this.Then(/^he should see the details of that cardset with the correct values$/, function () {
browser.waitUntil(function () {
console.log(browser.isExisting('.modal-open'));
return browser.isExisting('.modal-open') === false;
}, 5000, 'expected text to be different after 5s');
browser.waitForVisible('#editCardset',5000);
......
/* exported login */
export function login(username) {
browser.waitForVisible('#TestingBackdorUsername',5000);
browser.waitForExist('#TestingBackdoorUsername',15000);
var SetUsername = function (name) {
$('#TestingBackdorUsername').val(name);
$('#TestingBackdoorUsername').val(name);
};
client.execute(SetUsername, username);
browser.waitForVisible('a[id="BackdoorLogin"]',5000);
browser.click('a[id="BackdoorLogin"]');
browser.execute(SetUsername, username);
browser.waitForExist('#BackdoorLogin',15000);
browser.click('#BackdoorLogin');
}
/* exported logout */
export function logout() {
browser.waitForExist('#logout', 5000);
browser.waitForExist('#logout', 15000);
browser.click('#logout');
}
/* exported agreeCookies */
export function agreeCookies() {
browser.waitForExist('a.cc_btn.cc_btn_accept_all',15000);
browser.setCookie({name: 'cookieconsent_dismissed', value: 'yes'});
browser.click('a.cc_btn.cc_btn_accept_all');
}
/* exported firstLogin */
export function firstLogin(username) {
login(username);
browser.waitForExist('#accept_checkbox', 5000);
browser.waitForExist('#accept_checkbox', 15000);
browser.$('#accept_checkbox').click();
browser.click('button[id="accept_button"]');
}
......@@ -39,6 +41,6 @@ export function setResolution() {
/* exported logoutAdmin */
export function logoutAdmin() {
browser.waitForExist('#logout_admin', 5000);
browser.waitForExist('#logout_admin', 15000);
browser.click('#logout_admin');
}
......@@ -12,8 +12,6 @@ module.exports = function () {
agreeCookies();
setResolution();
browser.windowHandleSize();
browser.waitForVisible('a.cc_btn.cc_btn_accept_all',5000);
browser.click('a.cc_btn.cc_btn_accept_all');
});
......@@ -87,30 +85,30 @@ module.exports = function () {
});
this.When(/^I click on the Button Box one$/, function () {
browser.waitForVisible('#subject1', 10000);
browser.waitForVisible('#subject1', 5000);
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");
browser.waitForVisible('.detailfront0', 5000);
var text = browser.getText('.detailfront0');
expect(text).toBe("question 1");
});
this.Then(/^I can click on the card$/, function () {
browser.waitForVisible('#cardCarousel', 10000);
browser.waitForExist('#cardCarousel', 5000);
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");
browser.waitForExist('.detailback0', 5000);
var text = browser.getText('.detailback0');
expect(text).toBe("answer 1");
});
this.Then(/^I can click on the button Known$/, function () {
browser.waitForVisible('#known', 10000);
browser.waitForVisible('#known', 5000);
browser.click('#known');
});
......@@ -127,7 +125,7 @@ module.exports = function () {
/////////////////////////////////////////
this.When(/^I click the Button Memo$/, function () {
browser.waitForVisible('#learnMemo', 10000);
browser.waitForVisible('#learnMemo', 5000);
browser.click('#learnMemo');
});
......@@ -159,6 +157,7 @@ module.exports = function () {
this.Then(/^The buttons zero to five are shown$/, function () {
browser.waitForVisible('#memoRate0',5000);
var button = browser.isExisting('#memoRate0');
expect(button).toBe(true);
......@@ -179,15 +178,15 @@ module.exports = function () {
});
this.Then(/^I can click button three$/, function () {
browser.waitForVisible('#memoRate3', 10000);
browser.waitForExist('.frontblock span p',5000);
oldVal = browser.getText('.frontblock span p');
browser.waitForVisible('#memoRate3', 5000);
browser.waitForExist('.detailback0', 5000);
oldVal = browser.getText('.detailback0');
browser.click('#memoRate3');
});
this.Then(/^The next card is shown$/, function () {
browser.waitForExist('.frontblock span p',5000);
var same = oldVal == browser.getText('.frontblock span p');
browser.waitForExist('.detailfront0', 5000);
var same = (oldVal === browser.getText('.detailfront0'));
expect(same).toBe(false);
});
};
......
import {login, logout, agreeCookies} from "../helper_functions";
import {login, logout, setResolution, agreeCookies} from "../helper_functions";
var username = "login_testuser";
......@@ -8,6 +8,8 @@ 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');
setResolution();
browser.windowHandleSize();
agreeCookies();
});
......@@ -19,36 +21,37 @@ module.exports = function () {
this.Then(/^he should see the AGB page$/, function () {
// Write code here that turns the phrase above into concrete actions
browser.waitForExist('#first_login_content', 5000);
browser.waitForExist('#first_login_content', 15000);
});
this.Then(/^he can decline it$/, function () {
// Write code here that turns the phrase above into concrete actions
browser.click('button[id="logout_first_login"]');
browser.waitForExist('#logout_first_login', 15000);
browser.click('#logout_first_login');
});
this.Then(/^he is on the login page$/, function () {
// Write code here that turns the phrase above into concrete actions
browser.waitForExist('#welcome', 5000);
browser.waitForExist('#TestingBackdoorUsername',15000);
});
this.Then(/^he need to login again$/, function () {
// Write code here that turns the phrase above into concrete actions
browser.pause(1000);
login(username);
browser.click('#BackdoorLogin');
login(username);
});
this.Then(/^he agree the AGBs$/, function () {
// Write code here that turns the phrase above into concrete actions
browser.waitForExist('#accept_checkbox', 5000);
browser.$('#accept_checkbox').click();
browser.click('button[id="accept_button"]');
browser.waitForExist('#select_checkbox', 15000);
browser.$('#select_checkbox').click();
browser.waitForEnabled('#accept_button', 15000);
browser.click('#accept_button');
});
this.Then(/^he see the pool page$/, function () {
// Write code here that turns the phrase above into concrete actions
browser.waitForExist('#pool-category-region', 5000);
browser.waitForExist('#pool-category-region', 15000);
});
this.Then(/^he log out$/, function () {
......@@ -58,18 +61,20 @@ module.exports = function () {
this.Then(/^he login again$/, function () {
// Write code here that turns the phrase above into concrete actions
browser.waitForExist('#welcome', 5000);
browser.waitForExist('#TestingBackdoorUsername',15000);
login(username);
login(username);
});
this.Then(/^he sees the pool directly$/, function () {
// Write code here that turns the phrase above into concrete actions
browser.waitForExist('#pool-category-region', 8000);
browser.waitForExist('#pool-category-region', 15000);
});
this.Then(/^he logs off$/, function () {
// Write code here that turns the phrase above into concrete actions
logout();
browser.waitForExist('#TestingBackdoorUsername',15000);
});
};
......
......@@ -110,13 +110,13 @@ module.exports = function () {
*/
this.When(/^user clicks on the free license group button$/, function () {
browser.waitForVisible('label[class="btn btn-default btn-info active"]', 5000);
browser.click('label[class="btn btn-default btn-info active"]');
browser.waitForVisible('label[class="btn btn-default btn-info btn-sm active"]', 5000);
browser.click('label[class="btn btn-default btn-info btn-sm active"]');
});
this.Then(/^he should see the cardset list filtered by the unselected free license group$/, function () {
var cardsetList = browser.elements('.cardsetInfo');
expect(cardsetList.value.length).toEqual(cardsetListLength);
expect(cardsetList.value.length).not.toEqual(cardsetListLength);
});
/**
......@@ -126,13 +126,13 @@ module.exports = function () {
*/
this.When(/^user clicks on the edu license group button$/, function () {
browser.waitForVisible('label[class="btn btn-default btn-success active"]', 5000);
browser.click('label[class="btn btn-default btn-success active"]');
browser.waitForVisible('label[class="btn btn-default btn-success btn-sm active"]', 5000);
browser.click('label[class="btn btn-default btn-success btn-sm active"]');
});
this.Then(/^he should see the cardset list filtered by the unselected edu license group$/, function () {
var cardsetList = browser.elements('.cardsetInfo');
expect(cardsetList.value.length).toEqual(cardsetListLength);
expect(cardsetList.value.length).not.toEqual(cardsetListLength);
});
/**
......@@ -142,13 +142,13 @@ module.exports = function () {
*/
this.When(/^user clicks on the pro license group button$/, function () {
browser.waitForVisible('label[class="btn btn-default btn-danger active"]', 5000);
browser.click('label[class="btn btn-default btn-danger active"]');
browser.waitForVisible('label[class="btn btn-default btn-danger btn-sm active"]', 5000);
browser.click('label[class="btn btn-default btn-danger btn-sm active"]');
});
this.Then(/^he should see the cardset list filtered by the unselected pro license group$/, function () {
var cardsetList = browser.elements('.cardsetInfo');
expect(cardsetList.value.length).not.toEqual(cardsetListLength);
expect(cardsetList.value.length).toEqual(cardsetListLength);
logout();
});
};
......@@ -37,27 +37,20 @@ for testDir in $searchDir; do
if [ -d $testDir ]; then
echo -e $BLUE"Entering directory $testDir" $NC
# drop the database
echo -e $GREEN"Dropping database ..." $NC
if ! echo "db.dropDatabase()" | meteor mongo --allow-superuser ; then
echo -e $RED"error dropping meteor database" $NC
exit 3
fi
# Restore the database
echo -e $GREEN"Restoring database ..." $NC
if ! mongorestore --drop -h 127.0.0.1 --port 3001 -d meteor $dumpDir 1> /dev/null; then
# Drop and Restore the database
echo -e $GREEN"Dropping and Restoring database ..." $NC
if ! mongorestore --quiet --drop -h 127.0.0.1 --port 3001 -d meteor $dumpDir 1> /dev/null; then
echo -e $RED"mongorestore failed!" $NC
exit 2
fi
# Run chimp
echo -e $GREEN"Running chimp ..." $NC
if [ $DISPLAY -n ] ; then
xvfb-run --server-args="-screen 0 1920x1080x16" chimp --ddp=http://localhost:3000 --path=$testDir $1
else
chimp --ddp=http://localhost:3000 --path=$testDir $1
fi
#if [ $DISPLAY -n ] ; then
# xvfb-run --server-args="-screen 0 1920x1080x16" chimp --ddp=http://localhost:3000 --browser=firefox --path=$testDir $1
#else
chimp --ddp=http://localhost:3000 --browser=firefox --path=$testDir $1
#fi
if [ $? -ne 0 ]; then
failedTests=$((failedTests+1))
failedTestsArray+=("$testDir")
......
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