derby-casperjs
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -12,14 +12,27 @@ // Generated by CoffeeScript 1.9.2 | ||
set: function(path, value, cb) { | ||
casper.evaluate(function(path, value, operation) { | ||
return app.model.set(path, value, function() { | ||
return window.__operation = operation; | ||
var operation, prevValue; | ||
operation = ++__operation; | ||
prevValue = casper.evaluate(function(path, value, operation, hasCb) { | ||
return app.model.set(path, value, hasCb ? function() { | ||
if (window.__ops == null) { | ||
window.__ops = {}; | ||
} | ||
return window.__ops[operation] = true; | ||
} : void 0); | ||
}, path, value, operation, cb != null); | ||
if (cb != null) { | ||
casper.waitFor(function() { | ||
return casper.evaluate(function(operation) { | ||
if (window.__ops[operation]) { | ||
delete window.__ops[operation]; | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
}, operation); | ||
}, function() { | ||
return cb(); | ||
}); | ||
}, path, value, ++__operation); | ||
return casper.waitFor(function() { | ||
return casper.evaluate(function(operation) { | ||
return window.__operation === operation; | ||
}, __operation); | ||
}, function() { | ||
return typeof cb === "function" ? cb() : void 0; | ||
}); | ||
} | ||
return prevValue; | ||
}, | ||
@@ -26,0 +39,0 @@ get: function(path) { |
@@ -11,7 +11,7 @@ // Generated by CoffeeScript 1.9.2 | ||
var shot; | ||
shot = function(index) { | ||
if (!((index != null) && _.isNumber(index))) { | ||
index = ++shotIndex; | ||
shot = function(name) { | ||
if (name == null) { | ||
name = ++shotIndex; | ||
} | ||
return casper.capture('test/screenshots/' + index + '.png'); | ||
return casper.capture('test/screenshots/' + name + '.png'); | ||
}; | ||
@@ -18,0 +18,0 @@ return casper.shot = shot; |
{ | ||
"name": "derby-casperjs", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Helpers and tweaks for Casper.js to test Derby.js apps", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
15152
241