cucumber-html-reporter
Advanced tools
Comparing version 0.1.6 to 0.2.0
@@ -0,1 +1,8 @@ | ||
### 0.2.0 (2016-07-10) | ||
#### Support for Cucumber@1.2.0 version | ||
* Screenshot attachment support for Cucumber release >= @1.2.0 (https://github.com/cucumber/cucumber-js/blob/master/CHANGELOG.md#bug-fixes-1) | ||
### 0.1.6 (2016-07-07) | ||
@@ -2,0 +9,0 @@ |
@@ -79,3 +79,3 @@ 'use strict'; | ||
step.embeddings.forEach(function(embedding) { | ||
if (embedding.mime_type === "text/plain") { | ||
if (embedding.mime_type === 'text/plain') { | ||
if (!step.text) { | ||
@@ -93,7 +93,3 @@ step.text = Base64.decode(embedding.data); | ||
var filename = path.join(screenShotDirectory, name); | ||
fs.writeFile(filename, new Buffer(embedding.data, 'base64'), function(err) { | ||
if (err) { | ||
console.error('Error saving screenshot ' + filename); //asynchronously save screenshot | ||
} | ||
}); | ||
fs.writeFileSync(filename, embedding.data, 'base64'); | ||
step.image = 'screenshot/' + name; | ||
@@ -100,0 +96,0 @@ } |
{ | ||
"name": "cucumber-html-reporter", | ||
"version": "0.1.6", | ||
"version": "0.2.0", | ||
"description": "Generates Cucumber HTML reports in three different themes", | ||
@@ -21,3 +21,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"cucumber": "^1.2.0" | ||
"cucumber": "^1.2.1" | ||
}, | ||
@@ -24,0 +24,0 @@ "repository": { |
@@ -92,4 +92,6 @@ cucumber-html-reporter | ||
## Attach Screenshots to HTML report | ||
## Tips | ||
#### Attach Screenshots to HTML report | ||
Capture and Attach screenshots to the Cucumber Scenario and HTML report will render the screenshot image | ||
@@ -100,3 +102,3 @@ | ||
driver.takeScreenshot().then(function (buffer) { | ||
return scenario.attach(new Buffer(buffer, 'base64').toString('binary'), 'image/png'); | ||
return scenario.attach(new Buffer(buffer, 'base64'), 'image/png'); | ||
} | ||
@@ -106,3 +108,3 @@ | ||
## Attach Plain Text to HTML report | ||
#### Attach Plain Text to HTML report | ||
@@ -117,2 +119,12 @@ Attach plain-texts/data to HTML report to help debug/review the results | ||
#### Attach pretty JSON to HTML report | ||
Attach JSON to HTML report | ||
```javascript | ||
scenario.attach(JSON.stringity(myJsonObject, undefined, 4)); | ||
``` | ||
## Credits | ||
@@ -119,0 +131,0 @@ |
@@ -40,2 +40,10 @@ 'use strict'; | ||
this.scenario.attach(testData); | ||
var myJsonObject = { | ||
name: 'cucumber-html-reporter', | ||
format: 'html' | ||
}; | ||
this.scenario.attach(JSON.stringify(myJsonObject, undefined, 2)); | ||
callback(); | ||
@@ -42,0 +50,0 @@ }); |
Sorry, the diff of this file is not supported yet
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
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
2367794
16203
138