-
Notifications
You must be signed in to change notification settings - Fork 37
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
Ability to use the current mask but "inverted" #221
Comments
This is an interesting use case for masks. |
The elements shots as you describe them seems to be exactly what I originally had in mind! English is not my native language and I'm not sure what you mean by And this raises an additional question for me: do lost-pixel makes any kind of resize or treatment on screenshots before doing the pixel comparison? If so wouldn't it be dangerous to use an element shot? As if the whole element change from 200px width to 300px while keeping the exact same ratio, if resized to compare images they will match almost perfectly, or within the threshold, and therefore will not raise any error? And sorry for the long message but while I'm on it about threshold param and the reliability of comparisons, do you intend to add some others params for this purposes? (Ability to ignore antialiasing, ignore colors, set our own diff colors and transparency, those kind of things) |
Oh yes, I see the difference between masking a whole area and taking screenshots of what we want only thanks! For what I'm trying to achieve the elements shots seems to be the most useful with better performance. Thanks for the better understanding of how lost-pixel comparison works. I totally have missed the possibility to define threshold for individual stories and will have to look into it, it will permit to have really trustworthy comparison tests for all components. As for the refining ideas (like ignoring colors etc), it's just some features I saw in others visual regression testing frameworks and found the idea interesting, but I don't have a real need for it at the moment. I'll may open an issue in the future with precise use cases. Thanks a lot for your time and all your explanations. I'm eager to see this new feature at work 😀 |
Mode
Storybook
Feature description
Use Case: Same type of use as the current mask but "reversed".
In a capture of a storybook component or a page I want to be able to isolate only the element on which I perform the visual non-regression test. Ideally by cropping everything that is outside the selector given in the config.
This would allow to compare only what is necessary to compare, and thus to gain in performance by limiting the writing and the comparison of the pixels which do not interest us, to limit the false positives, to have a finer adjustment of the threshold and to move less data each time we push or pull.
As I tend to try to have the screenshots unified in their size. I'd find this solution more elegant than having the same size for every component screenshots. Some component have a width of 200px, others have a width of 1080px, I don't think it makes sense to use the same viewport for everyone.
The text was updated successfully, but these errors were encountered: