New Major Release#830
Merged
wswebcreation merged 14 commits intomainfrom Apr 18, 2025
Merged
Conversation
* chore: update deps * chore: revert major eslint * feat: initial setup for device layer calculations - this is work in progress * chore: fixed some stuff and updated some broken UT's * fix: right import and export * fix: fix mocks * chore: optimise code a bit and add docs * chore: fix linking and types * fix: fix return data from overlay * feat: add Android support for blockouts based on device rectangles * feat: support ios and android for checkScreen - simplify determineStatusAddressToolBarRectangles - reduce rectangle tests - fix data url loading in Safari * feat: add checkElement support * fix: optimise code and fix UTs for element * feat: support savefullpagescreenshot with new viewport data for Android * feat: support fullpage for iOS portrait * test: fix tests * fix: multiple fixes for fullpage - iOS had issues on landscape - removed not needed code and files * chore: remove logs * fix: fix Android Appium 1 issues - add fallback - remove logs - update images for android phones * chore: update iOS stuff - add LANDSCAPE for local android * chore: updated safari desktop screenshots * test: update snapshots * feat: move the new logic to the webdriver-image-comparison module * fix: fix unit tests * breaking: taking element screenshot for iOS - some other small fixes * chore: optimise deviceRectangles - remove devicePlatformRect - enrich deviceRectangles with statusBar and homeBar - change devicePlatformRect output to x/y instead of left/top to match a coordinate system - fix UTs * chore: refactor stuff - rename function - add screendata for deviceRectangles * chore: improve readability for vars in utils * chore: update baseline and workflow * chore: last image updates
🦋 Changeset detectedLatest commit: 348ef0e The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Member
erwinheitzman
left a comment
There was a problem hiding this comment.
Love the feature but I have to say it's a lot of code to go through that does a lot of things differently from what I would expect so it was a bit of a tough cookie but I hope the review adds value nonetheless 👍
- add more UT's
* feat: add viewport context manager * feat: add new context manager - revert old one - add a wrapper for each command that checks for changes - fix screensizes when the orientation changes and provide better fallback There is a TODO regarding Multiremote on the global browser * chore: fix UT's * chore: add a last test * feat: enhance context manager - add mobile context - add wrapper per command - add and fix UT's * fix: multiple fixes - fix capabilities, should be requested - assumed that the `'mobile: deviceInfo` didn't return landscape info - added new images for android * fix: reset orientation * Fix: fix iOS orientation and make it generic * chore: new iOS images * fix: support proper appium cap present - add new images - add nativeWebScreenshot for proper webviews screenshots * test: add iOS for webview tests - add new images * fix: fix tests
* feat: add bidi fullpage screenshot support * chore: code optimizations * chore: add changeset
* feat: deprecate root compare options * chore: add changeset * Update packages/webdriver-image-comparison/src/helpers/options.ts Co-authored-by: alcpereira <[email protected]> * Update packages/webdriver-image-comparison/src/helpers/utils.ts Co-authored-by: alcpereira <[email protected]> * Update packages/webdriver-image-comparison/src/helpers/utils.ts Co-authored-by: alcpereira <[email protected]> * chore: updated the options docs * chore: updated tests after feedback --------- Co-authored-by: alcpereira <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💥 BREAKING CHANGES
🔍 Viewport Screenshot Logic Reworked for Mobile Web & Hybrid Apps
What was the problem?
Screenshots for mobile devices were inconsistent due to platform differences. iOS captures the entire device screen (including status and address bars), while Android (using ChromeDriver) only captures the webview, unless the capability
"appium:nativeWebScreenshot": trueis used.What changed?
We’ve reimplemented the logic to correctly handle both platforms by default.
This fix addresses [#747](#747).
💡 Credit to Benjamin Karran (@ebekebe) for pointing us in the right direction to improve this logic!
What’s the advantage?
✅ More accurate full-page and element screenshots on both Android and iOS.
⚠️ But this change may break your current baselines, especially on Android and iOS.
🍏 iOS Element Screenshot Strategy Changed
What was the problem?
iOS element screenshots were previously cut from full-device screenshots, which could lead to misalignment or off-by-a-few-pixels issues.
What changed?
We now use the element screenshot endpoint directly.
What’s the advantage?
✅ More accurate iOS element screenshots.
⚠️ But again, this may affect your existing baselines.
🖥️ New Full-Page Screenshot Strategy for Desktop Web
What was the problem?
The "previous" scroll-and-stitch method simulated user interaction by scrolling the page, waiting, taking a screenshot, and repeating until the entire page was captured.
This works well for lazy-loaded content, but it is slow and unstable on other pages.
What changed?
We now use WebDriver BiDi’s [
[browsingContext.captureScreenshot](https://webdriver.io/docs/api/webdriverBidi#browsingcontextcapturescreenshot)] to capture full-page screenshots in one go. This is the new default strategy for desktop web browsers.📌 Mobile platforms (iOS/Android) still use the scroll-and-stitch approach for now.
What’s the advantage?
✅ Execution time reduced by 50%+
✅ Logic is greatly simplified
✅ More consistent and stable results on static or non-lazy pages
📸
Still want the old scroll-and-stitch behavior or need fullpage screenshots for pages who have lazy-loading?
Use the
userBasedFullPageScreenshotoption to simulate user-like scrolling. This remains the better choice for pages with lazy-loading:Or per test:
💅 Polish
What was the problem?
Compare options were allowed at the root level of the service config, making them harder to group or discover.
What changed?
You now get a warning if you still use root-level keys. Please move them under the
compareOptionsproperty instead.Example warning:
📘 See: [compareOptions docs](https://webdriver.io/docs/visual-testing/service-options#compare-options)
🐛 Bug Fixes
🔧 Other