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

LocalCompare doesn't compare rather only saves the diff screenshot #39

Open
IoannisPetridis opened this issue Sep 1, 2021 · 2 comments

Comments

@IoannisPetridis
Copy link

Hello,
I am initialising the service like so:

// wdio.conf.js

const novusVisualRegressionService = [
  'novus-visual-regression',
  {
    compare: new VisualRegressionCompare.LocalCompare({
      referenceName: (context) => `screenshots/${context.suite.title}-comparison screenshot.png`,
      screenshotName: (context) => `screenshots/${context.suite.title}-current screenshot.png`,
      diffName: (context) => `screenshots/${context.suite.title}-diff screenshot.png`,
      misMatchTolerance: 0.0,
    }),
  },
]
....
....
exports.config = {
  ...,
  services: [...whatever, novusVisualRegressionService],
  ...
}

I already have a reference screenshot to compare with in the correct path supplied above by

referenceName: (context) => `screenshots/${context.suite.title}-comparison screenshot.png`,

Then in the actual test file (I am using mocha), I am calling browser.checkViewport(). This does indeed produce a "diff" screenshot in the diffName returned path as provided in the service initialisation, but I was hoping that it also checks the actual difference between the 2 pictures (current and reference one). I even stretched it a bit further and tried to assert this call by calling chai.assert(browser.checkViewport(), 'Screenshot diff passes the threshold'), but I don't get any different output! Is this meant to be the case that the diff screenshot is only produced and that the the actual comparison between the reference screenshot and the current one is not happening at all? If so, can you advise towards the actual comparison method that you use in this case? Otherwise please do let me know of how I should proceed to fix this...

Regards,
Ioannis

@IoannisPetridis IoannisPetridis changed the title LocalCompare doesn't compare but rather only saves the diff screenshot LocalCompare doesn't compare rather only saves the diff screenshot Sep 1, 2021
@tsteur
Copy link

tsteur commented Oct 5, 2021

@p10petr We're having the same issue here. Did you find any solution for this?

@IoannisPetridis
Copy link
Author

I haven't gone back to try it out again, I am waiting for the author to comment on here also :(

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

2 participants