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

Use errorThreshold from global options #80

Conversation

nelson-amorim
Copy link
Contributor

As described here, global options are only took in consideration if we pass an empty object as the second argument.

This PR intends to solve this issue passing the empty object as the default value for the params parameter.
With this we guarantee that the code bellow will work:

compareSnapshotCommand({
  capture: "fullPage",
  errorThreshold: 0.04,
});

cy.compareSnapshot("home"); // use global options errorThreshold (0.04)
cy.compareSnapshot("home", 0.03); // use 0.03 as errorThreshold
cy.compareSnapshot("home"); // use 0.0 as errorThreshold

@mjhea0
Copy link
Collaborator

mjhea0 commented Jun 22, 2021

This looks good to me. Are you still working on it?

@nelson-amorim nelson-amorim marked this pull request as ready for review June 24, 2021 08:27
@nelson-amorim
Copy link
Contributor Author

This looks good to me. Are you still working on it?

It was on draft because I wanted to test it again before.
Tested again, working as expected.

=)

@antonioballesteros
Copy link

When do you think you could merge this PR ?
thanks in advance

@mjhea0 mjhea0 merged commit 0ba3dab into cypress-visual-regression:master Sep 5, 2021
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.

None yet

3 participants