mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
CasperJS test amends
- removing --fail-fast as this prevents screenshots - adding debug code for the good of all
This commit is contained in:
parent
6c0434fc8f
commit
b55ed1c33c
2 changed files with 17 additions and 1 deletions
|
@ -361,7 +361,7 @@ var path = require('path'),
|
|||
grunt.registerTask('spawn-casperjs', function () {
|
||||
var done = this.async(),
|
||||
options = ['host', 'noPort', 'port', 'email', 'password'],
|
||||
args = ['test', 'admin/', '--includes=base.js', '--direct', '--log-level=debug', '--port=2369', '--fail-fast'];
|
||||
args = ['test', 'admin/', '--includes=base.js', '--direct', '--log-level=debug', '--port=2369'];
|
||||
|
||||
// Forward parameters from grunt to casperjs
|
||||
_.each(options, function processOption(option) {
|
||||
|
|
|
@ -51,6 +51,22 @@ casper.writeContentToCodeMirror = function (content) {
|
|||
return this;
|
||||
};
|
||||
|
||||
|
||||
// ## Debugging
|
||||
// output all errors to the console
|
||||
casper.on('remote.message', function (msg) {
|
||||
casper.echo('GOT CONSOLE LOG: ' + msg);
|
||||
});
|
||||
|
||||
casper.on('error', function (msg, trace) {
|
||||
casper.echo('GOT ERROR, ' + msg);
|
||||
});
|
||||
|
||||
casper.on("page.error", function (msg, trace) {
|
||||
this.echo("GOT PAGE ERROR: " + msg, "ERROR");
|
||||
});
|
||||
|
||||
// on failure, grab a screenshot
|
||||
casper.test.on("fail", function captureFailure() {
|
||||
var filename = casper.test.filename || "casper_test_fail.png";
|
||||
casper.capture(new Date().getTime() + '_' + filename);
|
||||
|
|
Loading…
Reference in a new issue