Minor Changes
-
994f4da: ## #857 Support ignore regions for web screenshots
Add
ignoresupport to all web screenshot methods (saveScreen/checkScreen,saveElement/checkElement,saveFullPageScreen/checkFullPageScreen) so that specified elements can be blocked out during visual comparison. This brings web parity with the native-app ignore-region support that already existed.Changes
- Ignore regions for full-page screenshots: new
determineWebFullPageIgnoreRegionsfunction that calculates ignore-region rectangles for full-page screenshots, including afullPageCropTopPaddingCSScorrection for mobile scroll-and-stitch scenarios where the address-bar shadow padding shifts element positions - Consolidated
ignoreRegionPadding: movedignoreRegionPaddingintoBaseWebScreenshotOptionsso it is inherited by all web methods instead of being duplicated per method - Fix
isAndroidNativeWebScreenshottype: ensurenativeWebScreenshotis always a boolean (was accidentally an object for LambdaTest capabilities), preventing ignore-region DPR scaling failures - Fix viewport rounding for mobile: restore
Math.round()ininjectWebviewOverlayand removeMath.minclamping ingetMobileViewPortPositionto prevent 1-pixel crop shifts during full-page stitching - Fix
scrollElementIntoViewfor scrolled pages: account forcurrentPosition(existing scroll offset) when computing the target scroll position, so elements are scrolled into view correctly when the page is already scrolled - Dismiss Chrome Start Surface on Android: when Chrome's tab-overview UI blocks the webview overlay, automatically press the Android Back button (up to 4 retries) to restore the active tab before measuring the viewport
- Add hybrid status bar blockout: on hybrid apps the statusbar was not blocked out which could result in flaky tests regarding battery and reception
Committers: 1
- Wim Selles (@wswebcreation)
- Ignore regions for full-page screenshots: new