Attachement in afterEach hook in mocha
12masta opened this issue · comments
Hey,
I am unable to add attachment in afterEach hook. It is working only in the test itself.
I am using proper cmd args like:
--reporter-options attachments=true
Not working:
afterEach(async function afterEach() { this.test.attachments = [
file.mp4]; }
Working:
it('test', async function() { this.test.attachments = [
file.mp4]; });
Unfortunately with that approach function is useless - because in my cases I want only recordings of failed tests only. Beside that I don't want to put that line for every test.
I saw that topic but it is unresolved: #85
It is resolved in Cypress and in Codecept so im sure that there Is a way to resolve it! But after digging arround have no idea.
+1