Skip to content

Commit

Permalink
updated selenium log method name and removed references to util.print
Browse files Browse the repository at this point in the history
  • Loading branch information
beatfactor committed Apr 10, 2015
1 parent bf78e5b commit e29d06b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
30 changes: 15 additions & 15 deletions lib/api/client-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ module.exports = function(client) {
*
* ```
* this.demoTest = function(client) {
* this.getLogTypes(function( typesArray ) {
* this.getLogTypes(function(typesArray) {
*
* });
* };
Expand All @@ -395,30 +395,30 @@ module.exports = function(client) {
* @api commands
* @see logTypes
*/
getLogTypes: function( callback ) {
return this.logTypes( function( response ) {
if ( callback ) {
callback( response.value );
}
} );
getLogTypes: function(callback) {
return this.sessionLogTypes(function(response) {
if (callback) {
callback(response.value);
}
});
},

/**
* Gets a log from selenium
*
* ```
* this.demoTest = function(client) {
* this.getLog( 'browser', function( logEntriesArray ) {
* console.log( "Log length: " + logEntriesArray.length );
* logEntriesArray.forEach( function( log ) {
* console.log( "[" + log.level + "] " + log.timestamp + " : " + log.message );
* } );
* this.getLog('browser', function(logEntriesArray) {
* console.log('Log length: ' + logEntriesArray.length);
* logEntriesArray.forEach(function(log) {
* console.log('[' + log.level + '] ' + log.timestamp + ' : ' + log.message);
* });
* });
* };
* ```
*
* @method getLog
* @param {string} typeString Log type to request
* @param {string|function} typeString Log type to request
* @param {function} [callback] Optional callback function to be called when the command finishes.
* @api commands
* @see log
Expand All @@ -430,7 +430,7 @@ module.exports = function(client) {
}
typeString = 'browser';
}
return this.log(typeString, function (response) {
return this.sessionLog(typeString, function (response) {
if (callback) {
callback(response.value);
}
Expand All @@ -442,7 +442,7 @@ module.exports = function(client) {
*
* ```
* this.demoTest = function(browser) {
* browser.isLogAvailable("browser", function(isAvailable) {
* browser.isLogAvailable('browser', function(isAvailable) {
* // do something more in here
* });
* }
Expand Down
4 changes: 2 additions & 2 deletions lib/api/protocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ module.exports = function(Nightwatch) {
* @returns {Array} Array of the text entries of the log.
* @api protocol
*/
Actions.log = function(typeString, callback) {
Actions.sessionLog = function(typeString, callback) {
return postRequest('/log', {type: typeString}, callback);
};

Expand All @@ -964,7 +964,7 @@ module.exports = function(Nightwatch) {
* @returns {Array} Available log types
* @api protocol
*/
Actions.logTypes = function(callback) {
Actions.sessionLogTypes = function(callback) {
return getRequest('/log/types', callback);
};

Expand Down
6 changes: 3 additions & 3 deletions lib/runner/selenium.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ SeleniumServer.prototype.setCliArgs = function() {
};

SeleniumServer.prototype.start = function() {
util.print(Logger.colors.light_purple('Starting selenium server' + (this.settings.parallelMode ? ' in parallel mode' : '') +'... '));
process.stdout.write(Logger.colors.light_purple('Starting selenium server' + (this.settings.parallelMode ? ' in parallel mode' : '') +'... '));
this.setCliArgs();
this.process = child_process.spawn('java', this.cliOpts);
this.process.host = this.host;
Expand Down Expand Up @@ -119,8 +119,8 @@ SeleniumServer.prototype.checkProcessStarted = function(data) {
var exitHandler = this.exitHandlerFn;

this.process.removeListener('exit', exitHandler);
util.print(Logger.colors.light_purple('started - PID: ' ) + ' ' +
this.process.pid + '\n' + (this.settings.parallelMode ? '\n' : ''));
process.stdout.write(Logger.colors.light_purple('started - PID: ' ) + ' ' +
this.process.pid + '\n' + (this.settings.parallelMode ? '\n' : ''));
this.onStarted(null, this.process);
}
};
Expand Down

0 comments on commit e29d06b

Please sign in to comment.