html-reporter
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -5,2 +5,17 @@ # Change Log | ||
<a name="1.3.0"></a> | ||
# [1.3.0](https://github.com/gemini-testing/html-reporter/compare/v1.2.0...v1.3.0) (2018-01-22) | ||
### Bug Fixes | ||
* change metaInfo in data.js from html-string to object ([2ea8301](https://github.com/gemini-testing/html-reporter/commit/2ea8301)) | ||
### Features | ||
* suites colored in grey if all children are skipped ([b8f784b](https://github.com/gemini-testing/html-reporter/commit/b8f784b)) | ||
<a name="1.2.0"></a> | ||
@@ -7,0 +22,0 @@ # [1.2.0](https://github.com/gemini-testing/html-reporter/compare/v1.1.0...v1.2.0) (2017-12-25) |
@@ -9,3 +9,3 @@ 'use strict'; | ||
import {SectionBrowser} from './section-browser'; | ||
import {hasFails, hasRetries} from '../../modules/utils'; | ||
import {allSkipped, hasFails, hasRetries} from '../../modules/utils'; | ||
import Title from './title/simple'; | ||
@@ -28,2 +28,3 @@ | ||
const retried = hasRetries(suite); | ||
const skipped = allSkipped(suite); | ||
@@ -33,3 +34,3 @@ this.setState({ | ||
retried, | ||
skipped: suite.skipped, | ||
skipped, | ||
collapsed: this._shouldBeCollapsed(failed, retried) | ||
@@ -36,0 +37,0 @@ }); |
@@ -13,3 +13,4 @@ 'use strict'; | ||
state: PropTypes.shape({ | ||
metaInfo: PropTypes.string.isRequired, | ||
suiteUrl: PropTypes.string.isRequired, | ||
metaInfo: PropTypes.object.isRequired, | ||
error: PropTypes.bool, | ||
@@ -27,3 +28,3 @@ success: PropTypes.bool, | ||
render() { | ||
const {metaInfo, error, success, fail, reason, image, | ||
const {suiteUrl, metaInfo, error, success, fail, reason, image, | ||
expectedPath, actualPath, diffPath} = this.props.state; | ||
@@ -43,3 +44,3 @@ | ||
<Fragment> | ||
<MetaInfo metaInfo={metaInfo}/> | ||
<MetaInfo metaInfo={metaInfo} suiteUrl={suiteUrl}/> | ||
{elem} | ||
@@ -46,0 +47,0 @@ </Fragment> |
@@ -6,7 +6,18 @@ 'use strict'; | ||
import classNames from 'classnames'; | ||
import Parser from 'html-react-parser'; | ||
import map from 'lodash'; | ||
const mkLinkToUrl = (url, text) => { | ||
return <a data-suite-view-link={url} className="section__icon_view-local" target="_blank" href={url}>{text}</a>; | ||
}; | ||
const metaToElements = (metaInfo) => { | ||
return map(metaInfo, (value, key) => { | ||
return <div className="meta-info__item"><span className="meta-info__item-key">{key}</span>: {value}</div>; | ||
}); | ||
}; | ||
export default class MetaInfo extends Component { | ||
static propTypes = { | ||
metaInfo: PropTypes.string.isRequired | ||
metaInfo: PropTypes.object.isRequired, | ||
suiteUrl: PropTypes.string.isRequired | ||
} | ||
@@ -26,2 +37,10 @@ | ||
const {url, file, sessionId} = this.props.metaInfo; | ||
const {suiteUrl} = this.props; | ||
const metaElements = metaToElements({ | ||
url: mkLinkToUrl(suiteUrl, url), | ||
file, | ||
sessionId | ||
}); | ||
return ( | ||
@@ -31,3 +50,3 @@ <div className={className}> | ||
<div className="meta-info__content"> | ||
{Parser(this.props.metaInfo)} | ||
{metaElements} | ||
</div> | ||
@@ -34,0 +53,0 @@ </div> |
'use strict'; | ||
import {some} from 'lodash'; | ||
export function hasFails(node) { | ||
@@ -15,4 +13,9 @@ const isFailed = node.result && (node.result.error || node.result.fail); | ||
function walk(node, cb) { | ||
return some(node.browsers, cb) || some(node.children, cb); | ||
export function allSkipped(node) { | ||
const isSkipped = node.result && node.result.skipped; | ||
return Boolean(isSkipped || walk(node, allSkipped, Array.prototype.every)); | ||
} | ||
function walk(node, cb, fn = Array.prototype.some) { | ||
return node.browsers && fn.call(node.browsers, cb) || node.children && fn.call(node.children, cb); | ||
} |
@@ -105,3 +105,3 @@ 'use strict'; | ||
const metaInfo = { | ||
url: mkLinkToUrl(suiteUrl, suite.fullUrl), | ||
url: suite.fullUrl, | ||
file: suite.file, | ||
@@ -114,3 +114,3 @@ sessionId: result.sessionId || 'unknown session id' | ||
name: browserId, | ||
metaInfo: stringifyMeta(metaInfo) || 'Meta info is not available' | ||
metaInfo | ||
}, props); | ||
@@ -177,6 +177,2 @@ | ||
function mkLinkToUrl(url, text) { | ||
return `<a data-suite-view-link="${url}" class="section__icon_view-local" target="_blank" href="${url}">${text}</a>`; | ||
} | ||
function wrapLinkByTag(text) { | ||
@@ -187,7 +183,1 @@ return text.replace(/https?:\/\/[^\s]*/g, (url) => { | ||
} | ||
function stringifyMeta(obj) { | ||
return _(obj) | ||
.map((value, key) => `<div class="meta-info__item"><span class="meta-info__item-key">${key}</span>: ${value}</div>`) | ||
.join(''); | ||
} |
{ | ||
"name": "html-reporter", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Plugin for gemini which is intended to aggregate the results of tests running into html report", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
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
0
4
397465
46
2497