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: (multi-domain) add support for screenshot blackout #20150

Merged

Conversation

mschile
Copy link
Contributor

@mschile mschile commented Feb 11, 2022

User facing changelog

n/a

Additional details

Blacking our screenshot elements in multi-domain was not previously working due to the element logic being executed in the primary domain which resulted in cross-domain failures. In order to resolve the cross-domain issue, the logic is moving to the screenshot command which has access to the secondary domain.

  • Removed beforeScreenshot and afterScreenshot logic from aut-iframe.js to screenshot.ts
    • listeners removed from runner and runner-ct
  • Moved add/removeBlackouts and add/removeCssAnimationDisabler functions from runner-shared/dom.js to two new files animation.ts and blackout.ts in the driver.
  • Moved the getElementDimensions function to its own file dimensions.ts.

How has the user experience changed?

Supports blacking out elements in a screenshot:
screenshot specs -- supports the blackout option

PR Tasks

  • Have tests been added/updated?
  • [n/s] Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [n/a] Has a PR for user-facing changes been opened in cypress-documentation?
  • [n/a] Have API changes been updated in the type definitions?
  • [n/a] Have new configuration options been added to the cypress.schema.json?

@mschile mschile requested a review from a team as a code owner February 11, 2022 04:58
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 11, 2022

Thanks for taking the time to open a PR!

@mschile mschile requested review from jennifer-shehane and removed request for a team and jennifer-shehane February 11, 2022 04:58
@cypress
Copy link

cypress bot commented Feb 11, 2022



Test summary

19737 0 294 4Flakiness 4


Run details

Project cypress
Status Passed
Commit c92000b
Started Feb 14, 2022 4:06 PM
Ended Feb 14, 2022 4:19 PM
Duration 12:39 💡
OS Linux Debian - 10.10
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

commands/net_stubbing_spec.ts Flakiness
1 network stubbing > intercepting response > can 'delay' a proxy response using Promise.delay
2 network stubbing > waiting and aliasing > can timeout waiting on a single request using "alias.request"
cypress/proxy-logging_spec.ts Flakiness
1 Proxy Logging > request logging > xhr log has response body/status code
2 Proxy Logging > request logging > xhr log has response body/status code

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@mschile mschile linked an issue Feb 11, 2022 that may be closed by this pull request
Copy link
Contributor

@chrisbreiding chrisbreiding left a comment

Choose a reason for hiding this comment

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

Looks good 👍

The eslint comments are wrong in the original code, but might as well fix them while we're at it.

packages/driver/src/cy/commands/screenshot.ts Outdated Show resolved Hide resolved
packages/driver/src/cy/commands/screenshot.ts Outdated Show resolved Hide resolved
Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
@mschile mschile merged commit 0639d14 into feature-multidomain Feb 14, 2022
@mschile mschile deleted the issue-20060-multi-domain-screenshot-blackout branch February 14, 2022 18:16
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.

[Multi-Domain] Support cy.screenshot
4 participants