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

HTML report generation cypress-mochawesome-reporter plugin broken when updating cypress-image-diff-js from V1.26.0 to V1.30.1 #177

Closed
MelvinBaaijAviva opened this issue Sep 12, 2023 · 3 comments

Comments

@MelvinBaaijAviva
Copy link

Hi,

I am experiencing a problem. My cypress-mochawesome-reporter plugin (V3.6.0) does not generate html reports after updating cypress-image-diff-js from V1.26.0 to V1.30.1 (using Typescript and Cypress 12.7.4 ).
I am not using a seperate cypress-image-diff.config.js

@kien-ht
Copy link
Collaborator

kien-ht commented Sep 12, 2023

Hi. Can you share the code where you configured cypress-mochawesome-reporter and our plugin please?

@kien-ht
Copy link
Collaborator

kien-ht commented Sep 12, 2023

I assume this is the Cypress multiple on events issue, cypress-io/cypress#5240.
I have taken a look at the cypress-mochawesome-reporter codebase, and interestingly they also use the after:run hook, and so does our plugin. If we register the same event more than once, Cypress will only apply the handler of the last one. We have one issue related to this, #172 (comment).

You could wrap the on function before passing it to any plugins and forward all events. I believe there are solutions for this and cypress-plugin-init is one of them.

@MelvinBaaijAviva
Copy link
Author

I assume this is the Cypress multiple on events issue, cypress-io/cypress#5240. I have taken a look at the cypress-mochawesome-reporter codebase, and interestingly they also use the after:run hook, and so does our plugin. If we register the same event more than once, Cypress will only apply the handler of the last one. We have one issue related to this, #172 (comment).

You could wrap the on function before passing it to any plugins and forward all events. I believe there are solutions for this and cypress-plugin-init is one of them.

@kien-ht thanks for the fast reply and further investigation. I implemented the cypress-plugin-init solution. I will close this issue because this fixes my problem. Thank you!

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