wdio-timeline-reporter
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -276,3 +276,3 @@ const events = require('events'); | ||
const currentTestKey = tests[tests.length - 1]; | ||
let filePath = this.getScreenshotPath(runner.filename); | ||
let filePath = this.resolveScreenshotPath(runner.filename); | ||
spec.suites[lastKey].tests[currentTestKey].screenshots.push(filePath); | ||
@@ -282,3 +282,3 @@ | ||
let { quality, resize, reductionRatio } = images; | ||
quality = (Number.isInteger(quality) && 0 < quality && 100 >= quality) ? Math.round(quality) : 100; | ||
quality = (Number.isInteger(quality) && 0 < quality && 100 >= quality) ? Math.round(quality) : 70; | ||
reductionRatio = (Number.isInteger(reductionRatio) && 0 < reductionRatio && 5 >= reductionRatio) ? Math.round(reductionRatio) : 5; | ||
@@ -441,10 +441,12 @@ | ||
getScreenshotPath(filename) { | ||
let filePath = filename;; | ||
resolveScreenshotPath(filename) { | ||
let resolvedFilePath; | ||
if (!fs.pathExistsSync(filename)) { | ||
if (this.config.screenshotPath && fs.pathExistsSync(`${this.config.screenshotPath}${filename}`)) { | ||
filePath = `${this.config.screenshotPath}${filename}`; | ||
const fileWithScreenshotPath = path.resolve(this.config.screenshotPath, filename); | ||
if (this.config.screenshotPath && fs.pathExistsSync(fileWithScreenshotPath)) { | ||
resolvedFilePath = fileWithScreenshotPath; | ||
} | ||
} | ||
return filePath; | ||
resolvedFilePath = resolvedFilePath || filename; | ||
return resolvedFilePath; | ||
} | ||
@@ -457,3 +459,3 @@ | ||
images: { | ||
quality: 100, | ||
quality: 70, | ||
embed: true, | ||
@@ -460,0 +462,0 @@ resize: false, |
{ | ||
"name": "wdio-timeline-reporter", | ||
"version": "1.0.2", | ||
"description": "", | ||
"version": "1.0.3", | ||
"description": "A WebdriverIO reporter. Creates a simple HTML report after test runs", | ||
"main": "lib/timeline-reporter.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
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
21968
449