Support attachments in BeforeAll/AfterAll hooks
Open
:zap: enhancement
- Dominant language
- No language data
- Stars
- 3.4k
- Forks
- 679
- PR merge metrics
- No merged PRs in 30d
Description
I want to add a log file as an attachment to report after tests execution. I wanted to use AfterAll hook but according to this comment: https://github.com/cucumber/cucumber-js/issues/1109#issuecomment-400542113
this is impossible. How can I achieve that? Is this possible to import attach method directly to AfterAll hook?
```
// This is not working as AfterAll hook dosn't have acces to World instance
AfterAll(async function () {
const file = await fs.readFileSync('./features/support/scp_util/file.txt')
this.attach(file, 'text/plain');
});```
Contributor guide
Assessment
This issue has not been assessed yet.