add resize test checking frame content

Moved shared methods to a head.js file
This commit is contained in:
Julian Descottes
2017-01-08 18:15:04 +01:00
committed by juliandescottes
parent 569b508fd5
commit a328e4d20e
10 changed files with 129 additions and 76 deletions

View File

@@ -0,0 +1,30 @@
/**
* Collection of shared methods for casperjs integration tests.
*/
function evalLine(line) {
return casper.evaluate(
'function () {return ' + line + '}'
);
}
function getValue(selector) {
return casper.evaluate(
'function () { \
return document.querySelector(\'' + selector + '\').value;\
}');
}
function isChecked(selector) {
return casper.evaluate(
'function () { \
return document.querySelector(\'' + selector + '\').checked;\
}');
}
function isDrawerExpanded() {
return casper.evaluate(function () {
var settingsElement = document.querySelector('[data-pskl-controller="settings"]');
return settingsElement.classList.contains('expanded');
});
}