html-reporter
Advanced tools
Comparing version 0.7.1 to 1.0.0
@@ -5,2 +5,10 @@ # Change Log | ||
<a name="1.0.0"></a> | ||
# [1.0.0](https://github.com/gemini-testing/html-reporter/compare/v0.5.0...v1.0.0) (2017-10-19) | ||
### Features | ||
* Implement view mode switcher ([6237582](https://github.com/gemini-testing/html-reporter/commit/6237582)) | ||
* Remove "errorsOnly" option | ||
<a name="0.7.1"></a> | ||
@@ -7,0 +15,0 @@ ## [0.7.1](https://github.com/gemini-testing/html-reporter/compare/v0.7.0...v0.7.1) (2017-10-18) |
@@ -76,6 +76,2 @@ 'use strict'; | ||
function handleTestResultEvent_(testResult) { | ||
if (pluginConfig.errorsOnly && testResult.equal) { | ||
return Promise.resolve(); | ||
} | ||
const actions = [ | ||
@@ -82,0 +78,0 @@ copyImage(testResult.referencePath, utils.getReferenceAbsolutePath(testResult, reportDir)) |
@@ -11,2 +11,3 @@ 'use strict'; | ||
const ENV_PREFIX = 'html_reporter_'; | ||
const CLI_PREFIX = '--html-reporter-'; | ||
@@ -24,6 +25,5 @@ const getParser = () => { | ||
}), | ||
errorsOnly: option({ | ||
defaultValue: false, | ||
parseEnv: JSON.parse, | ||
validate: _.isBoolean | ||
defaultView: option({ | ||
defaultValue: 'all', | ||
validate: _.isString | ||
}), | ||
@@ -34,3 +34,3 @@ baseHost: option({ | ||
}) | ||
}), {envPrefix: ENV_PREFIX}); | ||
}), {envPrefix: ENV_PREFIX, cliPrefix: CLI_PREFIX}); | ||
}; | ||
@@ -37,0 +37,0 @@ |
@@ -49,1 +49,15 @@ /* global Handlebars */ | ||
}); | ||
Handlebars.registerHelper('view-mode-select', function(defaultValue) { | ||
const selectData = [ | ||
{value: 'all', text: 'Show all'}, | ||
{value: 'failed', text: 'Show only failed'} | ||
]; | ||
const selectOptions = selectData.map((d) => { | ||
const selected = d.value === defaultValue ? 'selected="selected"' : ''; | ||
return `<option value="${d.value}" ${selected}>${d.text}</option>`; | ||
}).join(''); | ||
return `<select id="viewMode">${selectOptions}</select>`; | ||
}); |
@@ -21,6 +21,2 @@ 'use strict'; | ||
addSkipped(result) { | ||
if (this._pluginConfig.errorsOnly) { | ||
return; | ||
} | ||
const comment = result.suite.skipComment && wrapLinkByTag(result.suite.skipComment); | ||
@@ -40,6 +36,2 @@ | ||
addSuccess(result) { | ||
if (this._pluginConfig.errorsOnly) { | ||
return; | ||
} | ||
this._addTestResult(result, { | ||
@@ -99,7 +91,8 @@ success: true, | ||
getResult(stats) { | ||
const {defaultView, baseHost} = this._pluginConfig; | ||
return _.extend({ | ||
skips: _.uniq(this._skips, JSON.stringify), | ||
suites: this._tree.children, | ||
errorsOnly: this._pluginConfig.errorsOnly, | ||
baseHost: this._pluginConfig.baseHost | ||
config: {defaultView, baseHost} | ||
}, stats); | ||
@@ -106,0 +99,0 @@ } |
{ | ||
"name": "html-reporter", | ||
"version": "0.7.1", | ||
"version": "1.0.0", | ||
"description": "Plugin for gemini which is intended to aggregate the results of tests running into html report", | ||
@@ -12,2 +12,3 @@ "main": "index.js", | ||
"prepublish": "webpack", | ||
"start": "webpack --watch", | ||
"commitmsg": "conventional-changelog-lint -e", | ||
@@ -38,3 +39,3 @@ "release": "standard-version" | ||
"fs-extra": "^2.0.0", | ||
"gemini-configparser": "^0.4.0", | ||
"gemini-configparser": "^1.0.0", | ||
"lodash": "^4.17.4", | ||
@@ -41,0 +42,0 @@ "urijs": "^1.18.12" |
@@ -22,3 +22,5 @@ # html-reporter | ||
directory. | ||
* **errorsOnly** (optional) `Boolean` - report with only failed tests; by default `false` | ||
* **defaultView** (optional) `String` - default view mode. Available values are: | ||
* `all` - show all tests. Default value. | ||
* `failed` - show only failed tests. | ||
* **baseHost** (optional) - `String` - it changes original host for view in the browser; by default original host does not change | ||
@@ -28,3 +30,10 @@ | ||
(see [configparser](https://github.com/gemini-testing/configparser)). | ||
Use `html_reporter_` prefix for the environment variables and `--html-reporter-` for the cli options. | ||
For example you can override `path` option like so: | ||
```bash | ||
$ html_reporter_path=custom/dir gemini test | ||
$ gemini test --html-reporter-path custom/dir | ||
``` | ||
### Usage | ||
@@ -42,3 +51,3 @@ | ||
path: 'my/gemini-reports', | ||
errorsOnly: false, | ||
defaultView: 'all', | ||
baseHost: 'test.com' | ||
@@ -45,0 +54,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
220863
19
927
69
5
+ Addedgemini-configparser@1.4.1(transitive)
- Removedbabel-runtime@5.8.38(transitive)
- Removedcore-js@1.2.7(transitive)
- Removedgemini-configparser@0.4.0(transitive)
Updatedgemini-configparser@^1.0.0