testarmada-nightwatch-extra
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -11,3 +11,3 @@ // Base test class that should be used for all Magellan tests | ||
var closeSession = function(client) { | ||
var closeSession = function (client) { | ||
@@ -21,3 +21,3 @@ var deferred = Q.defer(); | ||
var updateSauceStats = function(client, numFailures) { | ||
var updateSauceStats = function (client, numFailures) { | ||
@@ -36,3 +36,3 @@ var deferred = Q.defer(); | ||
var emitStartedTest = function(client) { | ||
var emitStartedTest = function (client) { | ||
if (settings.isWorker === true) { | ||
@@ -53,3 +53,3 @@ var testName = client.currentTest.module; | ||
var emitFinishedTest = function(client, numFailures) { | ||
var emitFinishedTest = function (client, numFailures) { | ||
@@ -105,2 +105,4 @@ if (settings.isWorker === true) { | ||
before: function (client) { | ||
this.failures = []; | ||
this.passed = 0; | ||
}, | ||
@@ -147,11 +149,15 @@ | ||
this.failures = this.failures || []; | ||
this.passed = (this.passed || 0) + this.results.passed; | ||
if (this.results) { | ||
// in case we failed in `before` | ||
// keep track of failed tests for reporting purposes | ||
if (this.results.failed || this.results.errors) { | ||
// Note: this.client.currentTest.name is also available to display | ||
// the name of the specific step within the test where we've failed. | ||
this.failures.push(this.client.currentTest.module); | ||
} | ||
// keep track of failed tests for reporting purposes | ||
if (this.results.failed || this.results.errors) { | ||
// Note: this.client.currentTest.name is also available to display | ||
// the name of the specific step within the test where we've failed. | ||
this.failures.push(this.client.currentTest.module); | ||
}; | ||
if (this.results.passed) { | ||
this.passed += this.results.passed; | ||
} | ||
} | ||
callback(); | ||
@@ -173,6 +179,11 @@ }, | ||
emitFinishedTest(client, numFailures) | ||
.then(function() { return updateSauceStats(client, numFailures); }) | ||
.then(function() { return closeSession(client); }) | ||
.then(function() { | ||
.then(function () { | ||
return updateSauceStats(client, numFailures); | ||
}) | ||
.then(function () { | ||
return closeSession(client); | ||
}) | ||
.then(function () { | ||
callback(); | ||
@@ -179,0 +190,0 @@ }); |
{ | ||
"name": "testarmada-nightwatch-extra", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "extra useful nightwatch command and assertion", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
84444
1529