Created
June 5, 2013 02:21
-
-
Save phadej/5711191 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Test</title> | |
<script src="tests/lib/winjs/base.js"></script> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('Loading a web page'); | |
var page = require('webpage').create(); | |
page.onConsoleMessage = function(msg, lineNum, sourceId) { | |
console.log('CONSOLE: ' + msg + ' (from line #' + lineNum + ' in "' + sourceId + '")'); | |
}; | |
page.onError = function(msg, trace) { | |
var msgStack = ['ERROR: ' + msg]; | |
if (trace && trace.length) { | |
msgStack.push('TRACE:'); | |
trace.forEach(function(t) { | |
msgStack.push(' -> ' + t.file + ': ' + t.line + (t.function ? ' (in function "' + t.function + '")' : '')); | |
}); | |
} | |
console.error(msgStack.join('\n')); | |
}; | |
var url = 'phantom-test.html'; | |
page.open(url, function (status) { | |
//Page is loaded! | |
phantom.exit(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% phantomjs phantom-test.js | |
Loading a web page | |
ERROR: TypeError: 'undefined' is not a function (evaluating 'listeners.removeEventListener.bind(listeners)') | |
TRACE: | |
-> file:///Users/ogre/Documents/.../tests/lib/winjs/base.js: 760 (in function "resourcesInit") | |
-> file:///Users/ogre/Documents/.../tests/lib/winjs/base.js: 863 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment