mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-08-15 15:32:32 +02:00
fixed casper tests with polyfill
This commit is contained in:
parent
1ff2a731fb
commit
b9337909ba
3 changed files with 27 additions and 1 deletions
|
@ -4,6 +4,15 @@ var screenshotRoot = './src/__tests__/casperjs/screenshots/entirePage';
|
||||||
|
|
||||||
var CasperUtils = {
|
var CasperUtils = {
|
||||||
|
|
||||||
|
start: function(casper, url, callback) {
|
||||||
|
// Setup some sanity error handling
|
||||||
|
casper.on('page.error', function(msg, trace) {
|
||||||
|
casper.echo('Error: ' + msg, 'ERROR');
|
||||||
|
casper.echo('Stack: ' + trace);
|
||||||
|
});
|
||||||
|
casper.start(url, callback);
|
||||||
|
},
|
||||||
|
|
||||||
getRoot: function() {
|
getRoot: function() {
|
||||||
// Unfortunately this is hardcoded for now :*( cant get the path
|
// Unfortunately this is hardcoded for now :*( cant get the path
|
||||||
// variable synchronously when running this test, and CasperJS does
|
// variable synchronously when running this test, and CasperJS does
|
||||||
|
|
|
@ -1,7 +1,15 @@
|
||||||
var CasperUtils = require('./casperUtils').CasperUtils;
|
var CasperUtils = require('./casperUtils').CasperUtils;
|
||||||
|
|
||||||
|
casper.on('page.error', function(msg, trace) {
|
||||||
|
casper.echo('Error: ' + msg, 'ERROR');
|
||||||
|
casper.echo('Stack: ' + JSON.stringify(trace));
|
||||||
|
});
|
||||||
|
casper.options.logLevel ="debug";
|
||||||
|
|
||||||
casper.start(
|
casper.start(
|
||||||
CasperUtils.getUrl(),
|
CasperUtils.getUrlForCommands([
|
||||||
|
'asd'
|
||||||
|
]),
|
||||||
function() {
|
function() {
|
||||||
this.test.assertTitle('Learn Git Branching');
|
this.test.assertTitle('Learn Git Branching');
|
||||||
|
|
||||||
|
|
|
@ -97,6 +97,15 @@
|
||||||
{{jsDependencies}}
|
{{jsDependencies}}
|
||||||
|
|
||||||
<script src="lib/jquery-ui-1.9.0.custom.min.js"></script>
|
<script src="lib/jquery-ui-1.9.0.custom.min.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
// PhantomJS doesn't support bind yet LOL. polyfill
|
||||||
|
Function.prototype.bind = Function.prototype.bind || function (thisp) {
|
||||||
|
var fn = this;
|
||||||
|
return function () {
|
||||||
|
return fn.apply(thisp, arguments);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
<!-- Templates from here on out. Someone seriously needs to fix template
|
<!-- Templates from here on out. Someone seriously needs to fix template
|
||||||
management for node.js apps. I know there is the text plugin
|
management for node.js apps. I know there is the text plugin
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue