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

Screenshot is not attached after waiting for element fails #131

Closed
kamiloski88 opened this issue Mar 7, 2022 · 1 comment
Closed

Screenshot is not attached after waiting for element fails #131

kamiloski88 opened this issue Mar 7, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@kamiloski88
Copy link

kamiloski88 commented Mar 7, 2022

Describe the bug
Screenshot is not attached after waiting for element fails.
When test fails on cy.get(this.notificationPopupMessage).should('have.text', message);
In report I get (without screenshot)
Timed out retrying after 15000ms: Expected to find element: .ant-notification-notice-message, but never found it.

Screenshot is not attached - missing screenshot (attachment) in allure-results folder.

What I noticed - if I add .only to this test (it) then attachment is generated in allure-results and it is attached to report

I think I know when problem appears - I use 'cypress-plugin-snapshots'. When I have multiple it(), and in first it test fails on compare screenshot and then next it() fails eg. because cant find element then eg (Timed out retrying after 15000ms: Expected to find element: .ant-notification-notice-message, but never found it.) then screenshot is not in report.
When I change order of tests (first it fails because cannot find element) and second test fails on compare screenshots then all screenshots are attached to repord and exists in allure-results.
Do you know what is wrong?

@kamiloski88 kamiloski88 added the bug Something isn't working label Mar 7, 2022
@kamiloski88 kamiloski88 changed the title Screenshot is not attached after cypress-wait-until fails Screenshot is not attached after waiting for element fails Mar 7, 2022
@Shelex
Copy link
Owner

Shelex commented Oct 8, 2022

The problem with cypress-plugin-snapshots is that it overrides onAfterScreenshot config not taking into account that there could be other listeners for such event in Cypress.
From cypress-allure-reporter side we already are using separate logic without onAfterScreenshot to handle attachments and this should not be an issue.

Moreover while checking sources I have also noted that latest update for cypress-plugin-snapshots was on 11 Aug 2020, it is based on cypress v4.5.0 and a lot of things have changed dramatically since that time.
Also, there are a lot of issues doubting that plugin is maintained, according to issue meinaart/cypress-plugin-snapshots#210 there are already alternatives available.

@Shelex Shelex closed this as completed Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants