Commit 7069852b 7069852b969b56ba55ac27d69c281a7e4c927477 by Nicolas Perriault

code reorganization

1 parent a6d2a59a
......@@ -1193,6 +1193,22 @@ Casper.prototype.start = function start(location, then) {
};
/**
* Returns the current status of current instance
*
* @param Boolean asString Export status object as string
* @return Object
*/
Casper.prototype.status = function status(asString) {
var properties = ['currentHTTPStatus', 'defaultWaitTimeout', 'loadInProgress', 'navigationRequested',
'options', 'pendingWait', 'requestUrl', 'started', 'step', 'url'];
var currentStatus = {};
properties.forEach(function(property) {
currentStatus[property] = this[property];
}.bind(this));
return asString === true ? utils.dump(currentStatus) : currentStatus;
};
/**
* Schedules the next step in the navigation process.
*
* @param function step A function to be called as a step
......@@ -1313,23 +1329,6 @@ Casper.prototype.toString = function toString() {
};
/**
* Returns the current status of current instance
*
* @param Boolean asString Export status object as string
* @return Object
*/
Casper.prototype.status = function status(asString) {
var properties = ['currentHTTPStatus', 'defaultWaitTimeout', 'loadInProgress', 'navigationRequested',
'options', 'pendingWait', 'requestUrl', 'started', 'step', 'url'];
var currentStatus = {};
properties.forEach(function(property) {
console.log(this[property]);
currentStatus[property] = this[property];
}.bind(this));
return asString === true ? utils.dump(currentStatus) : currentStatus;
};
/**
* Sets the user-agent string currently used when requesting urls.
*
* @param String userAgent User agent string
......