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

feat: added wait before and after screenshot #15878

Closed
wants to merge 3 commits into from

Conversation

galr52
Copy link

@galr52 galr52 commented Apr 8, 2021

added wait after screenshot

  • Closes

User facing changelog

Additional details

How has the user experience changed?

PR Tasks

  • Have tests been added/updated?
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Has the original issue or this PR been tagged with a release in ZenHub?
  • Have API changes been updated in the type definitions?
  • Have new configuration options been added to the cypress.schema.json?

added wait after screenshot
@galr52 galr52 requested a review from a team as a code owner April 8, 2021 15:49
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 8, 2021

Thanks for taking the time to open a PR!

@CLAassistant
Copy link

CLAassistant commented Apr 8, 2021

CLA assistant check
All committers have signed the CLA.

@galr52 galr52 changed the title added wait before and after screenshot feat: added wait before and after screenshot Apr 8, 2021
@jennifer-shehane jennifer-shehane requested review from jennifer-shehane and removed request for a team April 21, 2021 14:45
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@galr52 Could you give an explanation on why this new feature is necessary or link to an existing issue where people have requested this feature?

We'd like an understanding on why anyone would want this feature. We're not likely to add features without understanding the benefit because it is more to maintain in the future. Thanks.

@galr52
Copy link
Author

galr52 commented Apr 21, 2021

@galr52 Could you give an explanation on why this new feature is necessary or link to an existing issue where people have requested this feature?

We'd like an understanding on why anyone would want this feature. We're not likely to add features without understanding the benefit because it is more to maintain in the future. Thanks.

in my app i have a screen that rerender on window resize.
when i was trying to make a screenshot tests for that screen i faced an issue when the screen size is changing (the left panel is closing and etc).

i found this open issue #9443

with this feature i can workaround the issue, wait a few ms and let my screen rerender before the screenshot

@jennifer-shehane
Copy link
Member

@galr52 Can you provide a failing test cast that would now be passing with this solution? We need tests for all fixes and new features.

Is there a reason adding cy.wait(xxx) instead would not work in your case?

Just off of this information, I think it would be more worthwhile to investigate the window:resize triggers on the screenshot than add an arbitrary wait feature. This seems to be adding a new feature to fix an issue instead of just fixing the issue outright.

@galr52
Copy link
Author

galr52 commented Apr 21, 2021

@jennifer-shehane the only solution i could think about that can fix the resize issue is to wait for all the "before:screenshot" subscribers.

i cant provide a failing test because the image resolution is changing on screenshot events

cy.wait(xxx) wont fix the problem the because the screen is changing on 'before:screenshot' is emitted, and this occurs only when you take a screenshot (raise 'take:screenshot' event)

@jennifer-shehane
Copy link
Member

@galr52 Thanks for taking the time with this PR. We'd like to see a solution for the resize events triggers overall instead of adding a generic wait before/after screenshot as a feature. Going to close this PR for now.

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

Successfully merging this pull request may close these issues.

3 participants