Skip to content

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 <stracker.phil@gmail.com>
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 <stracker.phil@gmail.com> * Update Version Co-authored-by: Philipp Stracker <stracker.phil@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants