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

Backstopjs is not properly comparing photos! #1584

Open
AndreiGorea opened this issue Sep 9, 2024 · 5 comments
Open

Backstopjs is not properly comparing photos! #1584

AndreiGorea opened this issue Sep 9, 2024 · 5 comments

Comments

@AndreiGorea
Copy link

I've noticed for some time that backstop doesn't compare pictures well, for example if we have a field with some data in it like the date and we do a test and remove this date with removeSelector Backstop won't see this change. Before about 2 weeks ago Backstop was noticing this change.

What would be the problem?

I use misMatchThreshold": 0.1

@garris
Copy link
Owner

garris commented Sep 9, 2024

If the screenshot is very large you may need to use a smaller ratio.

@AndreiGorea
Copy link
Author

AndreiGorea commented Sep 10, 2024

Hi, thanks for a quick reply @garris but the problem is not with the ratio, because I didn't make any changes to the tests that a ran before.

I will show you an example:

This is my scenario array from backstop.json

"scenarios": [

{"misMatchThreshold": 0.1,"requireSameDimensions": true,"postInteractionWait": 1000,"label": "Dashboard Page","url": "https://dxnet-test-de.crossinx.com/crossnet/en_DE_xchannel/layouts/finx/common/welcome","waitForSelector": "fa fa-power-off, .fa-power-off","removeSelector": "#selectvalue ","hideSelectors": [".d-flex > small:nth-child(1) > strong:nth-child(1), [class='horizontalbarchart-container']"],"delay": 1000}

],

I have this reference photo:

ref-image

And I made a test and I have this test photo:

test-image

Obviously there is a difference, in test photo we don't have data in the fields

But backstopjs in html report tells that test is passed and there are no changes!

backstop-comparing

Maybe there were made some changes to backstop?
It's a strange and new behaviour.

@garris
Copy link
Owner

garris commented Sep 10, 2024

There were somewhat recent changes that might have interacted. #1558

Maybe that?

@jRaczy
Copy link

jRaczy commented Nov 28, 2024

I am also having some problems but maybe it's connected to old bug reported #850
image
image

@0helloword
Copy link

0helloword commented Feb 28, 2025

你好,请问backstopjs支持在backstop.json中调用自定义的对比方法么,我写了一个customCompare.js文件实现视觉对比时允许元素在任何方向下有指定像素的偏差,我把这个文件放到了backstop.json中的engineOptions下,如
"engineOptions": {
"compareFunction": "customCompare.js"
}
但是执行backstop test后查看报告却并没有生效,是什么原因呢?是哪里配置有问题么?
我看了很多资料也没有找到解决方法,盼回复!

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