Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attachement in afterEach hook in mocha #131

Open
12masta opened this issue Jul 16, 2020 · 3 comments
Open

Attachement in afterEach hook in mocha #131

12masta opened this issue Jul 16, 2020 · 3 comments

Comments

@12masta
Copy link

12masta commented Jul 16, 2020

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.

@ghost
Copy link

ghost commented Sep 18, 2020

+1

@WarpRat
Copy link

WarpRat commented Sep 8, 2022

@12masta - did you ever figure this out? I'm having the same issue attempting to add a cypress screenshot to the generated junit report and not having any luck.

@12masta
Copy link
Author

12masta commented Sep 20, 2022

@12masta - did you ever figure this out? I'm having the same issue attempting to add a cypress screenshot to the generated junit report and not having any luck.

Unfortunately not. Maybe it is changed since I faced this and there is some way to accomplish it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants