Skip to content

Test passes with different images when using 'seeVisualDiffForElement' for comparison. #80

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

Closed
Djet78 opened this issue Sep 23, 2020 · 6 comments

Comments

@Djet78
Copy link

Djet78 commented Sep 23, 2020

Hello!

I've got a test looking like that:

1 Scenario.only('Cross can be added', async (I, editorPage) => {
2    I.click(editorPage.tool.cross);
3    await I.addTool(50, 50);
4    I.saveElementScreenshot(editorPage.lastAddedTool, 'CROSS_ELEM.png');
5    I.seeVisualDiffForElement(editorPage.lastAddedTool, 'CROSS_ELEM.png',  {prepareBaseImage: false, tolerance: 0});
6 }).tag('editor').tag('tools').tag('cross');

If I change added tool (2nd line) test keep passing instead of fail.
Both images have the same dimensions.
Also, for some reason, test produces diff image, without highlighted difference.

Test run results

Test Output image: OUTPUT_CROSS_ELEM

Base image: BASE_CROSS_ELEM

Generated diff image (generates copy of base image): Diff_CROSS_ELEM

Console output:
Screenshot

Additional info

  • OS: Windows 10
  • CodeceptJS version: 2.6.10
  • codeceptjs-resemblehelper version: 1.9.2

Checked with different 'tolerance' level but got almost the same results. Diff image generated only with {tolerance: 0}
Also checked larger images - same results.

@puneet0191
Copy link
Member

It seems we have a bug with diff images being generated all the time, I will fix this issue in new release thanks a lot

@ghost
Copy link

ghost commented Mar 12, 2021

Same issue
codeceptjs: 3.0.2
codeceptjs-resemblehelper: 1.9.3
playwright: 1.7.1

@shr2
Copy link

shr2 commented May 23, 2022

The main issue here is that the obvious differences between base and current image are not detected and the test is not failing.

@puneet0191
Copy link
Member

Did you try on the latest version?

@shr2
Copy link

shr2 commented May 23, 2022

Yes I did. Heres my package json
image

@sharath2106
Copy link
Collaborator

We have released the latest version (1.9.7) of the library yesterday. I would ask to check against the latest version and let us know.

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

No branches or pull requests

4 participants