You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -60,38 +73,23 @@ var {After, Status} = require('@cucumber/cucumber');
60
73
After(function (testCase) {
61
74
if (testCase.result.status===Status.FAILED) {
62
75
var buffer =getScreenshotOfError();
63
-
this.attach(buffer, 'image/png');
64
-
}
65
-
});
66
-
```
67
-
68
-
If you've already got a base64-encoded string, you can prefix your mime type with `base64:` to indicate this:
69
-
70
-
```javascript
71
-
var {After, Status} =require('@cucumber/cucumber');
72
-
73
-
After(function (testCase) {
74
-
if (testCase.result.status===Status.FAILED) {
75
-
var base64String =getScreenshotOfError();
76
-
this.attach(base64String, 'base64:image/png');
76
+
this.attach(buffer, { mediaType:'image/png' });
77
77
}
78
78
});
79
79
```
80
80
81
-
Here is an example of saving a screenshot using [Selenium WebDriver](https://www.npmjs.com/package/selenium-webdriver)
81
+
If you've already got a base64-encoded string, you can prefix your mime type with `base64:` to indicate this. Here's an example of saving a screenshot using [Selenium WebDriver](https://www.npmjs.com/package/selenium-webdriver)
82
82
when a scenario fails:
83
83
84
84
```javascript
85
85
var {After, Status} =require('@cucumber/cucumber');
0 commit comments