Skip to content

New option compareWithImage to compare a screenshot with a custom file #90

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

Merged
merged 5 commits into from
Aug 10, 2021
Merged

New option compareWithImage to compare a screenshot with a custom file #90

merged 5 commits into from
Aug 10, 2021

Conversation

stracker-phil
Copy link
Contributor

A new and optional option value that allows to compare a screenshot to a base-image with a different file name.

Reasons for this:

  1. If you want to compare a single screenshot against multiple base images - for example, when you want to validate that the main menu element is identical on all app pages.
  2. If parts of an image contain intended visual differences for different browsers or operating systems.
  3. Possibly, there are even more other use-cases

}
if (options.prepareBaseImage !== undefined && options.prepareBaseImage) {

if (this._getPrepareBaseImage(options)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change also addresses the following bug report:

#88

@puneet0191
Copy link
Member

thanks a lot for the PR, I am going to test the changes also requested @fsblemos to also verify the PR, will prepare a new release post that with your improvement and fixes

@puneet0191 puneet0191 changed the base branch from master to 1.9.5 August 10, 2021 12:28
@puneet0191 puneet0191 merged commit d0f79cd into codeceptjs:1.9.5 Aug 10, 2021
puneet0191 added a commit that referenced this pull request Aug 10, 2021
…ile (#90) (#91)

* Add option `compareWithImage`

* Cleanup changes from previous commit

* Document changes for `compareWithImage` option

* Improve `compareWithImage` documentation

* Fix issues from previous commit

1. Code ignored the flag `config.prepareBaseImage`
2. There was a typo in the function name `_getBaseImageName()`

Co-authored-by: Philipp Stracker <[email protected]>
puneet0191 added a commit that referenced this pull request Aug 10, 2021
* New option `compareWithImage` to compare a screenshot with a custom file (#90) (#91)

* Add option `compareWithImage`

* Cleanup changes from previous commit

* Document changes for `compareWithImage` option

* Improve `compareWithImage` documentation

* Fix issues from previous commit

1. Code ignored the flag `config.prepareBaseImage`
2. There was a typo in the function name `_getBaseImageName()`

Co-authored-by: Philipp Stracker <[email protected]>

* Update Version

Co-authored-by: Philipp Stracker <[email protected]>
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