Add viewport context manager for managing device rectangles#833
Merged
wswebcreation merged 12 commits intows/new-major-releasesfrom Apr 14, 2025
Merged
Conversation
|
- 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
- add mobile context - add wrapper per command - add and fix UT's
- fix capabilities, should be requested - assumed that the `'mobile: deviceInfo` didn't return landscape info - added new images for android
- add new images - add nativeWebScreenshot for proper webviews screenshots
- add new images
wswebcreation
added a commit
that referenced
this pull request
Apr 18, 2025
* Ws/fix-747-improve-mobile-webview-screenshot (#777) * 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 * chore: update latest deps * fix: add fallback for Android and iOS mobile screensize - add more UT's * test: add more UT's * fix: fix orientation and update ios images * Add viewport context manager for managing device rectangles (#833) * 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 * Ws/add bidi screenshot support (#831) * feat: add bidi fullpage screenshot support * chore: code optimizations * chore: add changeset * feat: deprecate root compare options (#832) * 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]> * chore: rename new bidi flag * chore: update deps * chore: provide changelogs --------- 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.
Introduce a ViewportContextManager to encapsulate the logic for storing and retrieving the viewport state, enhancing the management of device rectangles throughout the test session.
This will make it more powerfull for rotation and context switching
@todo: