selenium-cucumber-js
selenium-cucumber-js copied to clipboard
how to use attach inside of a step
trafficstars
Looking to use the "attach" to include a screenshot of a particular step. This is outlined in cucumber-js as seen by this code:
Given(/^a basic step$/, function() {
this.attach('Some info.')
this.attach('{"some", "JSON"}}', 'application/json')
})
from: https://github.com/cucumber/cucumber-js/blob/master/docs/support_files/attachments.md
error is:
this.attach is not a function
At first I thought it was because I was using an arrow function (per the cucumber notes this doesn't work because of rebinding), but I switched to a regular function and still no luck.
Thanks!