Skip to content

Commit 496be52

Browse files
Merge branch 'main' into ws/fix-1000-ios-fullpage
2 parents dd1036c + 2c109b3 commit 496be52

9 files changed

+19
-13
lines changed

.changeset/twenty-apes-pump.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
"@wdio/image-comparison-core": patch
3+
"@wdio/visual-service": patch
4+
---
5+
6+
# 🐛 Bugfixes
7+
8+
## #1038 fix incorrect determination of ignore area
9+
Ignore regions with `left: 0` and `right:0` lead to an incorrect width which lead to an incorrect ignore area. This is now fixed
10+
11+
12+
# Committers: 1
13+
14+
- Wim Selles ([@wswebcreation](https://github.com/wswebcreation))

packages/image-comparison-core/src/methods/__snapshots__/rectangles.test.ts.snap

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -347,18 +347,6 @@ exports[`rectangles > prepareIgnoreRectangles > should include mobile web rectan
347347
"right": 2688,
348348
"top": 5842,
349349
},
350-
{
351-
"bottom": 5842,
352-
"left": 0,
353-
"right": 0,
354-
"top": 640,
355-
},
356-
{
357-
"bottom": 5842,
358-
"left": 2688,
359-
"right": 2688,
360-
"top": 640,
361-
},
362350
]
363351
`;
364352

packages/image-comparison-core/src/methods/rectangles.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,12 @@ export async function prepareIgnoreRectangles(options: PrepareIgnoreRectanglesOp
337337

338338
if (webStatusAddressToolBarOptions.length > 0) {
339339
// There's an issue with the resemble lib when all the rectangles are 0,0,0,0, it will see this as a full
340-
// blockout of the image and the comparison will succeed with 0 % difference
340+
// blockout of the image and the comparison will succeed with 0 % difference.
341+
// Additionally, rectangles with either width or height equal to 0 will result in an entire axis being ignored
342+
// due to how resemble handles falsy values. Filter those out up front.
341343
webStatusAddressToolBarOptions = webStatusAddressToolBarOptions
342344
.filter((rectangle) => !(rectangle.x === 0 && rectangle.y === 0 && rectangle.width === 0 && rectangle.height === 0))
345+
.filter((rectangle) => rectangle.width > 0 && rectangle.height > 0)
343346
}
344347

345348
// Handle home bar (iOS) blockOut for full page screenshots

tests/configs/wdio.saucelabs.shared.conf.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export const config: WebdriverIO.Config = {
4949
createJsonReportFiles: true,
5050
rawMisMatchPercentage: !!process.env.RAW_MISMATCH || false,
5151
enableLayoutTesting: true,
52+
ignoreAntialiasing: true,
5253
} satisfies VisualServiceOptions,
5354
],
5455
],
-1.99 KB
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)