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

Allow snapshot strategy to be configured #122

Merged
merged 1 commit into from
Jan 23, 2025
Merged

Allow snapshot strategy to be configured #122

merged 1 commit into from
Jan 23, 2025

Conversation

trotzig
Copy link
Contributor

@trotzig trotzig commented Jan 21, 2025

Similar to localSnapshots: true, we want people to be able to use the new "clip" snapshot strategy that happo-e2e has made available.

https://docs.happo.io/docs/cypress#locally-produced-images

The clip strategy means the whole dom is included in the snapshot, and happo workers will clip the screenshot based on where the [data-happo-clip] element is located.

@lencioni
Copy link
Contributor

Docs: happo/docs#93

Copy link
Contributor

@lencioni lencioni left a comment

Choose a reason for hiding this comment

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

We should add a test

@lencioni lencioni force-pushed the clip-strategy branch 2 times, most recently from 575d330 to 6a0f6c5 Compare January 21, 2025 16:48
We want people to be able to use the new "clip" snapshot strategy that
happo-e2e has made available.

The clip strategy means the whole dom is included in the snapshot, and
happo workers will clip the screenshot based on where the
`[data-happo-clip]` element is located.
@lencioni
Copy link
Contributor

@lencioni lencioni merged commit f6dbdb7 into main Jan 23, 2025
13 of 16 checks passed
@lencioni lencioni deleted the clip-strategy branch January 23, 2025 17:49
lencioni added a commit to happo/happo-playwright that referenced this pull request Jan 24, 2025
This matches the `snapshotStrategy` option we recently added to
happo-cypress:

happo/happo-cypress#122

The clip strategy means the whole DOM is included in the snapshot, and
happo workers will clip the screenshot based on where the
`[data-happo-clip]` element is located. This data attribute is added by
happo-e2e when using the clip snapshot strategy:

happo/happo-e2e#54
lencioni added a commit to happo/happo-playwright that referenced this pull request Jan 24, 2025
This matches the `snapshotStrategy` option we recently added to
happo-cypress:

happo/happo-cypress#122

The clip strategy means the whole DOM is included in the snapshot, and
happo workers will clip the screenshot based on where the
`[data-happo-clip]` element is located. This data attribute is added by
happo-e2e when using the clip snapshot strategy:

happo/happo-e2e#54
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.

2 participants