Commit b9351bc0 b9351bc084ab34ed1ba2e36d5704e9ddb4ae1187 by Julien Muetton

Decouple Casper `skip` from Tester.

In fact for now the `tester.skip` uses `casper.skip`.
1 parent b4eb8ee4
......@@ -1619,9 +1619,27 @@ Casper.prototype.thenOpen = function thenOpen(location, settings, then) {
* @param Integer nb number of tests to skip
* @param String message message to display
*/
Casper.prototype.skip = function skip(nb, message) {
"use strict";
var step = this.step,
steps = this.steps,
last = steps.length;
this.checkStarted();
this.step = Math.min(step + nb, last);
return this;
};
/**
* Skip `nb` steps.
*
* @param Integer nb number of tests to skip
* @param String message message to display
*/
Casper.prototype.thenSkip = function (nb, message) {
return this.then(function () {
this.test.skip(nb, message);
this.skip(nb, message);
});
};
......@@ -1638,7 +1656,7 @@ Casper.prototype.thenSkipIf = function (condition, nb, message) {
condition = condition();
}
if (utils.isTruthy(condition)) {
this.test.skip(nb, message);
this.skip(nb, message);
}
});
};
......@@ -1656,7 +1674,7 @@ Casper.prototype.thenSkipUnless = function (condition, nb, message) {
condition = condition();
}
if (utils.isFalsy(condition)) {
this.test.skip(nb, message);
this.skip(nb, message);
}
});
};
......
......@@ -236,11 +236,8 @@ Tester.prototype.abort = function abort(message) {
*/
Tester.prototype.skip = function skip(nb, message) {
"use strict";
var step = this.casper.step,
steps = this.casper.steps,
last = steps.length;
this.casper.step = Math.min(step + nb, last);
this.casper.skip(nb, message);
return this.processAssertionResult({
success: null,
......