nightwatch
Advanced tools
Comparing version 0.4.9 to 0.4.10
@@ -21,10 +21,13 @@ /** | ||
.waitForElementPresent('body', 1000) | ||
.setValue('input[type=text]', 'nightwatch') | ||
.waitForElementVisible('button[name=btnG]', 1000) | ||
.click('button[name=btnG]') | ||
.pause(1000) | ||
.assert.containsText('#main', 'The Night Watch') | ||
.end(); | ||
.setValue('input[type=text]', 'nightwatch', function() { | ||
this | ||
.waitForElementVisible('button[name=btnG]', 1000) | ||
.click('button[name=btnG]', function() { | ||
this | ||
.pause(500) | ||
.assert.containsText('#main', 'The Night Watch'); | ||
}); | ||
}).end(); | ||
} | ||
}; | ||
@@ -195,3 +195,3 @@ /*! | ||
Nightwatch.prototype.printResult = function() { | ||
Nightwatch.prototype.printResult = function(startTime) { | ||
if (this.options.output) { | ||
@@ -202,6 +202,6 @@ var ok = false; | ||
} | ||
var elapsedTime = new Date().getTime() - startTime; | ||
if (ok && this.results.passed > 0) { | ||
console.log(Logger.colors.green('OK.'), | ||
Logger.colors.green(this.results.passed) + ' assertions passed.'); | ||
Logger.colors.green(this.results.passed) + ' assertions passed. (' + elapsedTime + ' ms)'); | ||
} else if (ok && this.results.passed === 0) { | ||
@@ -235,3 +235,3 @@ console.log(Logger.colors.green('No assertions ran.')); | ||
return ' and' + $1; | ||
})); | ||
}), '(' + elapsedTime + ' ms)'); | ||
} | ||
@@ -238,0 +238,0 @@ } |
@@ -33,3 +33,3 @@ var util = require('util'); | ||
if (this.currentNode.started && !this.currentNode.done && !this.currentNode.reset) { | ||
this.traverse(); | ||
this.scheduleTraverse(); | ||
} | ||
@@ -45,3 +45,4 @@ }; | ||
var timems = new Date().getTime() - node.startTime; | ||
Logger.log(Logger.colors.light_gray(' - Completed command ' + Logger.colors.light_green(node.name)), '(' + timems, 'ms)'); | ||
Logger.log(' ' + Logger.colors.green('→') + | ||
' Completed command ' + Logger.colors.light_green(node.name), '(' + timems, 'ms)'); | ||
@@ -72,2 +73,3 @@ // checking if new children have been added while running this command which haven't finished yet | ||
this.currentNode = context.parent; | ||
context.done = true; | ||
this.walkDown(context.parent); | ||
@@ -131,2 +133,14 @@ }; | ||
AsyncTree.prototype.scheduleTraverse = function() { | ||
if (this.scheduled) { | ||
return; | ||
} | ||
this.scheduled = true; | ||
var self = this; | ||
process.nextTick(function() { | ||
self.traverse(); | ||
self.scheduled = false; | ||
}); | ||
}; | ||
AsyncTree.prototype.traverse = function() { | ||
@@ -133,0 +147,0 @@ try { |
@@ -779,3 +779,3 @@ module.exports = function(Nightwatch) { | ||
* @link /session/:sessionId/keys | ||
* @param {Array} keys The keys sequence to be sent. The sequence is defined in the [send keys](https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/value) command. | ||
* @param {Array} keys The keys sequence to be sent. The sequence is defined in the send keys format available at: https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/value. | ||
* @param {function} [callback] Optional callback function to be called when the command finishes. | ||
@@ -782,0 +782,0 @@ * @api protocol |
{ | ||
"name": "nightwatch", | ||
"description": "A node.js bindings implementation for selenium 2.0/webdriver", | ||
"version": "0.4.9", | ||
"version": "0.4.10", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Andrei Rusu", |
@@ -13,2 +13,3 @@ /** | ||
module.exports = new (function() { | ||
var startTime; | ||
var globalResults = { | ||
@@ -65,3 +66,3 @@ passed : 0, | ||
client.printResult(); | ||
client.printResult(startTime); | ||
@@ -168,5 +169,6 @@ if (client.terminated) { | ||
function printResults(testresults, modulekeys) { | ||
function printResults(testresults, modulekeys, startTime) { | ||
var elapsedTime = new Date().getTime() - startTime; | ||
if (testresults.passed > 0 && testresults.errors === 0 && testresults.failed === 0) { | ||
console.log(Logger.colors.green('\nOK. ' + testresults.passed, Logger.colors.background.black), 'total assertions passed.'); | ||
console.log(Logger.colors.green('\nOK. ' + testresults.passed, Logger.colors.background.black), 'total assertions passed. (' + elapsedTime + ' ms)'); | ||
} else { | ||
@@ -185,3 +187,3 @@ var skipped = ''; | ||
console.log(Logger.colors.light_red('\nTEST FAILURE:'), Logger.colors.red(testresults.errors + testresults.failed) + | ||
' assertions failed, ' + Logger.colors.green(testresults.passed) + ' passed' + skipped); | ||
' assertions failed, ' + Logger.colors.green(testresults.passed) + ' passed' + skipped, '(' + elapsedTime + ' ms)'); | ||
} | ||
@@ -341,2 +343,4 @@ } | ||
var paths; | ||
startTime = new Date().getTime(); | ||
finishCallback = finishCallback || function() {}; | ||
@@ -393,3 +397,3 @@ | ||
if (opts.output && (testresults.tests != globalResults.tests || testresults.steps.length > 1)) { | ||
printResults(globalResults, modulekeys); | ||
printResults(globalResults, modulekeys, startTime); | ||
} | ||
@@ -396,0 +400,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
274211
7855