Add responsive capture and cross iframe features#26
Open
yashmahamulkar-bs wants to merge 2 commits intomainfrom
Open
Add responsive capture and cross iframe features#26yashmahamulkar-bs wants to merge 2 commits intomainfrom
yashmahamulkar-bs wants to merge 2 commits intomainfrom
Conversation
Author
|
@yashmahamulkar-bs I've opened a new pull request, #27, to work on those changes. Once the pull request is ready, I'll request review from you. |
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.
This pull request introduces significant improvements to the Percy Ruby SDK, focusing on enhancing cross-origin iframe handling, adding Percy Automate support, and improving caching and configuration. The changes introduce a new caching system with tests, robust cross-origin iframe serialization, new environment/configuration options, and a dedicated API for Percy Automate screenshots. Additionally, the Percy CLI dependency is updated.
Major enhancements and new features:
Cross-origin iframe support and responsive snapshot improvements:
get_serialized_dommethod inpercy.rbto process cross-origin iframes, including logic to switch frames, handle errors, and serialize their DOMs. Added helper methods likeunsupported_iframe_src?,get_origin, andprocess_framefor robust iframe handling.Percy Automate support:
percy_screenshotAPI for Percy Automate sessions, with input validation and error handling. Introduced aDriverMetaDataclass to extract and cache session metadata, and updated the cache management logic. [1] [2] [3]percy_enabled?method to detect session type (automateor not) and enforce correct API usage for snapshot vs. screenshot. [1] [2]Caching and configuration improvements:
Caching system:
Cacheclass for session-based caching of metadata, with automatic timeout and cleanup. Added a comprehensive test suite for the cache. [1] [2]Configuration and environment options:
PERCY_RESPONSIVE_CAPTURE_RELOAD_PAGEandPERCY_RESPONSIVE_CAPTURE_MIN_HEIGHTenvironment variables to control responsive snapshot behavior. [1] [2]Dependency update:
package.json.Summary of most important changes:
Cross-origin iframe and responsive snapshot improvements
data-percy-element-id.Percy Automate support
percy_screenshotAPI for Automate sessions, with strict validation and error reporting, and a newDriverMetaDataclass for session metadata extraction and caching. [1] [2]percy_snapshotis now disallowed on Automate sessions and vice versa, with clear error messages. [1] [2]Caching system and tests
Cacheclass for metadata caching, with timeout and cleanup logic, and comprehensive RSpec tests for all cache functionality. [1] [2]Configuration and environment improvements
PERCY_RESPONSIVE_CAPTURE_RELOAD_PAGEandPERCY_RESPONSIVE_CAPTURE_MIN_HEIGHT. [1] [2]Dependency update
@percy/clifrom version 1.30.9 to 1.31.10 inpackage.json.