protractor-jasmine2-screenshot-reporter
Advanced tools
Comparing version 0.1.1 to 0.1.2
42
index.js
@@ -7,15 +7,17 @@ var fs = require('fs'), | ||
require('string.prototype.startsWith'); | ||
function Jasmine2ScreenShotReporter(opts) { | ||
'use strict'; | ||
var suites = {}, // suite clones | ||
specs = {}, // tes spec clones | ||
runningSuite = null, // currently running suite | ||
var suites = {}, // suite clones | ||
specs = {}, // tes spec clones | ||
runningSuite = null, // currently running suite | ||
// report marks | ||
marks = { | ||
pending:'<span style="padding:0 1em;color:orange;">~</span>', | ||
failed: '<span style="padding:0 1em;color:red;">✗</span>', | ||
passed: '<span style="padding:0 1em;color:green;">✓</span>' | ||
}; | ||
// report marks | ||
marks = { | ||
pending:'<span style="padding:0 1em;color:orange;">~</span>', | ||
failed: '<span style="padding:0 1em;color:red;">✗</span>', | ||
passed: '<span style="padding:0 1em;color:green;">✓</span>' | ||
}; | ||
@@ -128,2 +130,3 @@ // write data into opts.dest as filename | ||
this.specDone = function(spec) { | ||
var file; | ||
spec = getSpecClone(spec); | ||
@@ -142,2 +145,5 @@ spec._finished = Date.now(); | ||
file = opts.pathBuilder(spec, suites); | ||
spec.filename = file + '.png'; | ||
browser.takeScreenshot().then(function (png) { | ||
@@ -147,7 +153,4 @@ browser.getCapabilities().then(function (capabilities) { | ||
metadataPath, | ||
metadata, | ||
file; | ||
metadata; | ||
file = opts.pathBuilder(spec, suites, capabilities); | ||
spec.filename = file + '.png'; | ||
screenshotPath = path.join(opts.dest, spec.filename); | ||
@@ -190,2 +193,7 @@ metadata = opts.metadataBuilder(spec, suites, capabilities); | ||
_.each(suite._specs, function(spec) { | ||
spec = specs[spec.id]; | ||
output += '<li>' + marks[spec.status] + '<a href="' + spec.filename + '">' + spec.fullName.replace(suite.fullName, '').trim() + '</a> (' + getDuration(spec) + ' s)</li>'; | ||
}); | ||
if (suite._suites.length) { | ||
@@ -195,10 +203,6 @@ _.each(suite._suites, function(childSuite) { | ||
}); | ||
} else { | ||
_.each(suite._specs, function(spec) { | ||
spec = specs[spec.id]; | ||
output += '<li>' + marks[spec.status] + '<a href="' + spec.filename + '">' + spec.fullName.replace(suite.fullName, '').trim() + '</a> (' + getDuration(spec) + ' s)</li>'; | ||
}); | ||
output += '</ul>'; | ||
} | ||
output += '</ul>'; | ||
return output; | ||
@@ -205,0 +209,0 @@ } |
{ | ||
"name": "protractor-jasmine2-screenshot-reporter", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Use the screenshot reporter to capture screenshots after each executed Protractor test case.", | ||
@@ -14,3 +14,4 @@ "main": "index.js", | ||
"mkdirp": "^0.5.0", | ||
"path": "^0.11.14" | ||
"path": "^0.11.14", | ||
"string.prototype.startswith": "^0.2.0" | ||
}, | ||
@@ -31,3 +32,14 @@ "keywords": [ | ||
}, | ||
"homepage": "https://github.com/mlison/protractor-jasmine2-screenshot-reporter" | ||
"homepage": "https://github.com/mlison/protractor-jasmine2-screenshot-reporter", | ||
"contributors": [ | ||
{ | ||
"name": "Antti Arponen", | ||
"email": "antti.arponen@rovio.com" | ||
}, | ||
{ | ||
"name": "Alex Novikov", | ||
"email": "alex@asnovikov.ru", | ||
"url": "http://www.asnovikov.ru/" | ||
} | ||
] | ||
} |
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
11133
5
+ Addedstring.prototype.startswith@0.2.0(transitive)