selenium-cucumber-js icon indicating copy to clipboard operation
selenium-cucumber-js copied to clipboard

how to use attach inside of a step

Open stevenraines opened this issue 7 years ago • 0 comments
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!

stevenraines avatar May 11 '18 11:05 stevenraines