html-reporter
Advanced tools
Comparing version 2.15.0 to 2.16.0
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="2.16.0"></a> | ||
# [2.16.0](https://github.com/gemini-testing/html-reporter/compare/v2.15.0...v2.16.0) (2018-05-17) | ||
### Features | ||
* **hermione:** show the first 'assertView' command result ([873c002](https://github.com/gemini-testing/html-reporter/commit/873c002)) | ||
<a name="2.15.0"></a> | ||
@@ -7,0 +17,0 @@ # [2.15.0](https://github.com/gemini-testing/html-reporter/compare/v2.14.0...v2.15.0) (2018-04-22) |
@@ -31,3 +31,3 @@ 'use strict'; | ||
this._eventSource = new EventSource(); | ||
this._reportBuilder = ReportBuilderFactory.create(toolName, tool.config, pluginConfig); | ||
this._reportBuilder = ReportBuilderFactory.create(toolName, tool, pluginConfig); | ||
} | ||
@@ -34,0 +34,0 @@ |
@@ -46,3 +46,3 @@ 'use strict'; | ||
_run(prepareData, prepareImages) { | ||
const reportBuilder = ReportBuilderFactory.create(this._toolName, this._tool.config, this._config); | ||
const reportBuilder = ReportBuilderFactory.create(this._toolName, this._tool, this._config); | ||
const generateReport = Promise | ||
@@ -49,0 +49,0 @@ .all([ |
@@ -10,5 +10,5 @@ 'use strict'; | ||
module.exports = { | ||
create: (toolName, toolConfig, pluginConfig) => { | ||
return ReportBuilder.create(toolConfig, pluginConfig, adapters[toolName]); | ||
create: (toolName, tool, pluginConfig) => { | ||
return ReportBuilder.create(tool, pluginConfig, adapters[toolName]); | ||
} | ||
}; |
@@ -14,10 +14,10 @@ 'use strict'; | ||
module.exports = class ReportBuilder { | ||
static create(toolConfig, pluginConfig, TestAdapter) { | ||
return new ReportBuilder(toolConfig, pluginConfig, TestAdapter); | ||
static create(tool, pluginConfig, TestAdapter) { | ||
return new ReportBuilder(tool, pluginConfig, TestAdapter); | ||
} | ||
constructor(toolConfig, pluginConfig, TestAdapter) { | ||
constructor(tool, pluginConfig, TestAdapter) { | ||
this._tree = {name: 'root'}; | ||
this._skips = []; | ||
this._toolConfig = toolConfig; | ||
this._tool = tool; | ||
this._pluginConfig = pluginConfig; | ||
@@ -28,3 +28,3 @@ this._TestAdapter = TestAdapter; | ||
format(result) { | ||
return this._TestAdapter.create(result, this._toolConfig); | ||
return this._TestAdapter.create(result, this._tool); | ||
} | ||
@@ -31,0 +31,0 @@ |
@@ -9,6 +9,6 @@ 'use strict'; | ||
module.exports = class GeminiTestResultAdapter extends TestAdapter { | ||
constructor(testResult, config) { | ||
constructor(testResult, tool = {}) { | ||
super(testResult); | ||
this._suite = GeminiSuiteAdapter.create(this._testResult.suite, config); | ||
this._suite = GeminiSuiteAdapter.create(this._testResult.suite, tool.config); | ||
} | ||
@@ -15,0 +15,0 @@ |
@@ -10,5 +10,5 @@ 'use strict'; | ||
module.exports = class HermioneTestResultAdapter extends TestAdapter { | ||
constructor(testResult, config = {}) { | ||
constructor(testResult, tool) { | ||
super(testResult); | ||
this._config = config; | ||
this._tool = tool; | ||
@@ -19,11 +19,18 @@ this._suite = HermioneSuiteAdapter.create(this._testResult); | ||
saveDiffTo(...args) { | ||
return this._testResult.err.saveDiffTo(...args); | ||
return (this._firstAssertViewFail || this._testResult.err).saveDiffTo(...args); | ||
} | ||
hasDiff() { | ||
return _.get(this._testResult, 'err.type') === IMAGE_DIFF_ERROR; | ||
return this._firstAssertViewFail | ||
? this._firstAssertViewFail instanceof this._tool.errors.ImageDiffError | ||
: _.get(this._testResult, 'err.type') === IMAGE_DIFF_ERROR; | ||
} | ||
// hack which should be removed when html-reporter is able to show all assert view fails for one test | ||
get _firstAssertViewFail() { | ||
return _.find(this._testResult.assertViewResults, (result) => result instanceof Error); | ||
} | ||
get error() { | ||
return _.pick(this._testResult.err, ['message', 'stack', 'stateName']); | ||
return _.pick(this._firstAssertViewFail || this._testResult.err, ['message', 'stack', 'stateName']); | ||
} | ||
@@ -44,3 +51,3 @@ | ||
const {retry} = this._config.forBrowser(this._testResult.browserId); | ||
const {retry} = this._tool.config.forBrowser(this._testResult.browserId); | ||
return this._testResult.retriesLeft >= 0 | ||
@@ -57,7 +64,11 @@ ? retry - this._testResult.retriesLeft - 1 | ||
get referencePath() { | ||
return _.get(this._testResult, 'err.refImagePath'); | ||
return this._firstAssertViewFail | ||
? _.get(this._firstAssertViewFail, 'refImagePath') | ||
: _.get(this._testResult, 'err.refImagePath'); | ||
} | ||
get currentPath() { | ||
return _.get(this._testResult, 'err.currentImagePath'); | ||
return this._firstAssertViewFail | ||
? _.get(this._firstAssertViewFail, 'currentImagePath') | ||
: _.get(this._testResult, 'err.currentImagePath'); | ||
} | ||
@@ -70,3 +81,5 @@ | ||
get assertViewState() { | ||
return _.get(this._testResult, 'err.stateName'); | ||
return this._firstAssertViewFail | ||
? _.get(this._firstAssertViewFail, 'stateName') | ||
: _.get(this._testResult, 'err.stateName'); | ||
} | ||
@@ -73,0 +86,0 @@ |
'use strict'; | ||
module.exports = class TestAdapter { | ||
static create(testResult = {}, config = {}) { | ||
return new this(testResult, config); | ||
static create(testResult = {}, tool) { | ||
return new this(testResult, tool); | ||
} | ||
@@ -7,0 +7,0 @@ |
{ | ||
"name": "html-reporter", | ||
"version": "2.15.0", | ||
"version": "2.16.0", | ||
"description": "Plugin for gemini and hermione which is intended to aggregate the results of tests running into html report", | ||
@@ -5,0 +5,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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1052097
6454