-
Notifications
You must be signed in to change notification settings - Fork 0
Description
It's typical for golden images to be intrinsically sized. For example, a golden might show a snippet of text, or a button. These widgets are sized based on their content, which in turn sizes the golden. Goldens might include decorations, such as borders. If the content, such as glyphs of text, happen to occupy a width or height that's not exactly an integer value, then various details in the golden image end up landing on partial pixel boundaries. For example, the whole golden image might be 153.74px wide and 98.37px tall.
Partial pixel boundaries result in pixel colors that are partially shaded to make it appear as if a boundary sits between pixels. These partially shaded pixels are a candidate for flaky false negatives, where tests fail for reasons that don't matter.
We should look for strategies that tend to size golden content to exactly integer width and height values, to help reduce this problem.
One thing we can do is add a custom render object at the top of the default scaffold, which checks its child's size, and if it's not exactly an integer, increases the size of the child to become an exact integer.