multiple-cucumber-html-reporter
Advanced tools
Comparing version 0.2.1 to 1.0.0
CHANGELOG | ||
========= | ||
<a name="1.0.0"></a> | ||
## [1.0.0](https://github.com/wswebcreation/multiple-cucumber-html-reporter/compare/v0.2.1...v1.0.0) (2017-09-08) | ||
### Features | ||
* **feature:** added support for CucumberJS 3, the only thing that has changes for reporting is that the `embedding.mime_type` has been changed to `embedding.media.type`. | ||
* **feature:** metadata is not also an option, see the readme | ||
<a name="0.2.1"></a> | ||
@@ -5,0 +13,0 @@ ## [0.2.1](https://github.com/wswebcreation/multiple-cucumber-html-reporter/compare/v0.2.0...v0.2.1) (2017-07-26) |
@@ -23,15 +23,19 @@ 'use strict'; | ||
files.map(file => jsonFile.readFileSync(file).map(json => { | ||
json = Object.assign({ | ||
"metadata": { | ||
"browser": { | ||
"name": "not known", | ||
"version": "not known" | ||
}, | ||
"device": "not known", | ||
"platform": { | ||
"name": "not known", | ||
"version": "not known" | ||
if(options.metadata && !json.metadata){ | ||
json.metadata = options.metadata; | ||
} else { | ||
json = Object.assign({ | ||
"metadata": { | ||
"browser": { | ||
"name": "not known", | ||
"version": "not known" | ||
}, | ||
"device": "not known", | ||
"platform": { | ||
"name": "not known", | ||
"version": "not known" | ||
} | ||
} | ||
} | ||
}, json); | ||
}, json); | ||
} | ||
jsonOutput.push(json) | ||
@@ -47,2 +51,2 @@ })); | ||
return jsonOutput; | ||
}; | ||
}; |
'use strict'; | ||
const _ = require('lodash'); | ||
const assert = require('assert'); | ||
const chalk = require('chalk'); | ||
@@ -268,3 +267,3 @@ const fs = require('fs-extra'); | ||
/* istanbul ignore else */ | ||
if (embedding.mime_type === 'text/plain') { | ||
if (embedding.mime_type === 'text/plain' || (embedding.media && embedding.media.type === 'text/plain')) { | ||
if (!step.text) { | ||
@@ -279,3 +278,3 @@ try { | ||
} | ||
} else if (embedding.mime_type === 'image/png') { | ||
} else if (embedding.mime_type === 'image/png' || (embedding.media && embedding.media.type === 'image/png')) { | ||
step.image = 'data:image/png;base64,' + embedding.data; | ||
@@ -416,2 +415,2 @@ step.embeddings[embeddingIndex] = {}; | ||
generate: generateReport | ||
}; | ||
}; |
{ | ||
"name": "multiple-cucumber-html-reporter", | ||
"version": "0.2.1", | ||
"description": "Generate beatifull cucumberjs reports for multiple instances (browsers / devices)", | ||
"version": "1.0.0", | ||
"description": "Generate beautifull cucumberjs reports for multiple instances (browsers / devices)", | ||
"keywords": [ | ||
@@ -29,3 +29,2 @@ "cucumber", | ||
"dependencies": { | ||
"assert": "1.4.1", | ||
"chalk": "1.1.3", | ||
@@ -32,0 +31,0 @@ "find": "0.2.7", |
@@ -23,3 +23,3 @@ Multiple Cucumber HTML Reporter | ||
``` bash | ||
npm install multiple-cucumber-html-reporter | ||
npm install multiple-cucumber-html-reporter | ||
``` | ||
@@ -35,3 +35,3 @@ | ||
## Compatibility | ||
Multiple Cucumber HTML Reporter works with CucumberJS 1.3.3 or lower. We are currently working on the support for CucumberJS 2.1.0 or higher. | ||
Multiple Cucumber HTML Reporter **now works with CucumberJS 1, 2 and 3**. | ||
@@ -46,8 +46,19 @@ ## Usage | ||
jsonDir: './path-to-your-json-output/', | ||
reportPath: './path-where-the-report-needs-to-be/' | ||
reportPath: './path-where-the-report-needs-to-be/', | ||
metadata:{ | ||
browser: { | ||
name: 'chrome', | ||
version: '60' | ||
}, | ||
device: 'Local test machine', | ||
platform: { | ||
name: 'ubuntu', | ||
version: '16.04' | ||
} | ||
} | ||
}); | ||
``` | ||
> **IMPORTANT:** | ||
> **IMPORTANT:** | ||
> Make sure that, when you generate the JSON files with Cucumber, each file will have a **UNIQUE** name. If you don't provide a unique name Cucumber will **override** the JSON files. | ||
> Make sure that, when you generate the JSON files with Cucumber, each file will have a **UNIQUE** name. If you don't provide a unique name Cucumber will **override** the JSON files. | ||
@@ -88,2 +99,25 @@ > **Advice** is to use for example the name of the feature, the name of the browser / device it is running on AND a unix timestamp with for example this `(new Date).getTime();`. This will result in something like this `name_of_feature.chrome.1495298685509.json` | ||
### `metadata` | ||
- **Type:** `JSON` | ||
- **Mandatory:** No | ||
Print more data to your report, such as browser name + version, platform name + version and your environment. The values need to meet some predefined data, see [Metadata](#metadata) for more info. | ||
Data can be passed like below. | ||
> **If you provide the metadata when instantiating `multi-cucumber-html-reporter` the metadata will be added to each feature. If you already have metadata in your JSON then the metadata in the JSON will be leading** | ||
```js | ||
metadata:{ | ||
browser: { | ||
name: 'chrome', | ||
version: '60' | ||
}, | ||
device: 'Local test machine', | ||
platform: { | ||
name: 'ubuntu', | ||
version: '16.04' | ||
} | ||
} | ||
``` | ||
## Metadata | ||
@@ -93,3 +127,3 @@ The report can also show on which browser / device a feature has been executed. It is shown on the featurs overview in the table as well as on the feature overview in a container. | ||
### Adding metadata to the Cucumber JSON | ||
To be able to see this you will need to add the following to the Cucumber JSON before you save it. | ||
@@ -162,3 +196,3 @@ | ||
### Only 1 report is shown in the features overview table | ||
It could be that the name of the Cucumber JSON file that has been saved is not unique (enough). | ||
It could be that the name of the Cucumber JSON file that has been saved is not unique (enough). | ||
@@ -165,0 +199,0 @@ My advice is to use for example: |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
77352
8
778
0
256
- Removedassert@1.4.1
- Removedassert@1.4.1(transitive)
- Removedinherits@2.0.1(transitive)
- Removedutil@0.10.3(transitive)