-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Pass previous subject through .screenshot()
in new screenshot usage
#1726
Milestone
Comments
After some discussion, we decided to yield the following object: {
el, // previous subject if cy.get().screenshot(), else undefined for cy.screenshot()
path, // path to screenshot
size, // size of screenshot (bytes)
dimensions, // { width, height } of screenshot
takenAt, // ISO8601 date string
duration, // duration in milliseconds of how long it took
pixelRatio, // pixel ratio of screenshot (determined by comparing screenshot dimensions w/ viewport dimensions)
multipart, // boolean as to whether scrolling & stitching was necessary
...screenshotConfig, // all the config properties, merged from defaults, user defaults, and overrides passed to cy.screenshot()
} |
|
The idea was to have it be a flat object with each option key, hence the |
Released in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The new implementation of
.screenshot()
from #1504 documents.screenshot()
always yieldingnull
.In the new use case of
cy.get('table').screenshot()
, I would like the.screenshot()
to yield the previous DOM subject, thetable
.This would technically be a breaking change - if someone were not following the recommendations within the docs about chaining, but honestly, I couldn't even come up with an example that would work -> then break after these updates.
The text was updated successfully, but these errors were encountered: