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

Help! the compareFunction is not working? #1594

Open
0helloword opened this issue Mar 5, 2025 · 1 comment
Open

Help! the compareFunction is not working? #1594

0helloword opened this issue Mar 5, 2025 · 1 comment

Comments

@0helloword
Copy link

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


Does backstopjs support calling custom comparison methods in backstop.json? I wrote a customCompare.js file to allow for a specified pixel deviation in any direction during visual comparison. I placed this file under engineOptions in backstop.json, like this:
"engineOptions": {

"compareFunction": "customCompare.js"

}
However, after executing backstop, the report does not reflect the changes. What could be the reason? Is there a configuration issue somewhere? I've looked through a lot of resources but haven't found a solution. Looking forward to your reply!

@0helloword 0helloword changed the title 最新版是否支持调用自定义的对比方法?如何使用? Help! the compareFunction is not working? Mar 6, 2025
@0helloword
Copy link
Author

@garris Please take a look at this issue, it's urgent.Thank you very much!

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

1 participant