diff --git a/.changeset/implement-web-ignore-regions.md b/.changeset/implement-web-ignore-regions.md deleted file mode 100644 index 3bb033cf9..000000000 --- a/.changeset/implement-web-ignore-regions.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -'@wdio/image-comparison-core': minor -'@wdio/visual-service': minor ---- - -## #857 Support ignore regions for web screenshots - -Add `ignore` support 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 `determineWebFullPageIgnoreRegions` function that calculates ignore-region rectangles for full-page screenshots, including a `fullPageCropTopPaddingCSS` correction for mobile scroll-and-stitch scenarios where the address-bar shadow padding shifts element positions -- **Consolidated `ignoreRegionPadding`:** moved `ignoreRegionPadding` into `BaseWebScreenshotOptions` so it is inherited by all web methods instead of being duplicated per method -- **Fix `isAndroidNativeWebScreenshot` type:** ensure `nativeWebScreenshot` is always a boolean (was accidentally an object for LambdaTest capabilities), preventing ignore-region DPR scaling failures -- **Fix viewport rounding for mobile:** restore `Math.round()` in `injectWebviewOverlay` and remove `Math.min` clamping in `getMobileViewPortPosition` to prevent 1-pixel crop shifts during full-page stitching -- **Fix `scrollElementIntoView` for scrolled pages:** account for `currentPosition` (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](https://github.com/wswebcreation)) diff --git a/packages/image-comparison-core/CHANGELOG.md b/packages/image-comparison-core/CHANGELOG.md index 46a3757d8..e202523ce 100644 --- a/packages/image-comparison-core/CHANGELOG.md +++ b/packages/image-comparison-core/CHANGELOG.md @@ -1,5 +1,27 @@ # @wdio/image-comparison-core +## 1.2.0 + +### Minor Changes + +- 994f4da: ## #857 Support ignore regions for web screenshots + + Add `ignore` support 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 `determineWebFullPageIgnoreRegions` function that calculates ignore-region rectangles for full-page screenshots, including a `fullPageCropTopPaddingCSS` correction for mobile scroll-and-stitch scenarios where the address-bar shadow padding shifts element positions + - **Consolidated `ignoreRegionPadding`:** moved `ignoreRegionPadding` into `BaseWebScreenshotOptions` so it is inherited by all web methods instead of being duplicated per method + - **Fix `isAndroidNativeWebScreenshot` type:** ensure `nativeWebScreenshot` is always a boolean (was accidentally an object for LambdaTest capabilities), preventing ignore-region DPR scaling failures + - **Fix viewport rounding for mobile:** restore `Math.round()` in `injectWebviewOverlay` and remove `Math.min` clamping in `getMobileViewPortPosition` to prevent 1-pixel crop shifts during full-page stitching + - **Fix `scrollElementIntoView` for scrolled pages:** account for `currentPosition` (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](https://github.com/wswebcreation)) + ## 1.1.4 ### Patch Changes diff --git a/packages/image-comparison-core/package.json b/packages/image-comparison-core/package.json index b5a488f17..ff37ef6c4 100644 --- a/packages/image-comparison-core/package.json +++ b/packages/image-comparison-core/package.json @@ -1,6 +1,6 @@ { "name": "@wdio/image-comparison-core", - "version": "1.1.4", + "version": "1.2.0", "author": "Wim Selles - wswebcreation", "description": "Image comparison core module for @wdio/visual-service - WebdriverIO visual testing framework", "keywords": [ diff --git a/packages/visual-service/CHANGELOG.md b/packages/visual-service/CHANGELOG.md index 84f6b4d3b..57ec0d6a5 100644 --- a/packages/visual-service/CHANGELOG.md +++ b/packages/visual-service/CHANGELOG.md @@ -1,5 +1,32 @@ # @wdio/visual-service +## 9.2.0 + +### Minor Changes + +- 994f4da: ## #857 Support ignore regions for web screenshots + + Add `ignore` support 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 `determineWebFullPageIgnoreRegions` function that calculates ignore-region rectangles for full-page screenshots, including a `fullPageCropTopPaddingCSS` correction for mobile scroll-and-stitch scenarios where the address-bar shadow padding shifts element positions + - **Consolidated `ignoreRegionPadding`:** moved `ignoreRegionPadding` into `BaseWebScreenshotOptions` so it is inherited by all web methods instead of being duplicated per method + - **Fix `isAndroidNativeWebScreenshot` type:** ensure `nativeWebScreenshot` is always a boolean (was accidentally an object for LambdaTest capabilities), preventing ignore-region DPR scaling failures + - **Fix viewport rounding for mobile:** restore `Math.round()` in `injectWebviewOverlay` and remove `Math.min` clamping in `getMobileViewPortPosition` to prevent 1-pixel crop shifts during full-page stitching + - **Fix `scrollElementIntoView` for scrolled pages:** account for `currentPosition` (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](https://github.com/wswebcreation)) + +### Patch Changes + +- Updated dependencies [994f4da] + - @wdio/image-comparison-core@1.2.0 + ## 9.1.6 ### Patch Changes diff --git a/packages/visual-service/package.json b/packages/visual-service/package.json index 6808d5832..70594ebde 100644 --- a/packages/visual-service/package.json +++ b/packages/visual-service/package.json @@ -2,7 +2,7 @@ "name": "@wdio/visual-service", "author": "Wim Selles - wswebcreation", "description": "Image comparison / visual regression testing for WebdriverIO", - "version": "9.1.6", + "version": "9.2.0", "license": "MIT", "homepage": "https://webdriver.io/docs/visual-testing", "repository": {