Add Robot Framework support via PercyLibrary#220
Open
neha-sanse wants to merge 12 commits intomasterfrom
Open
Conversation
Adds native Robot Framework keywords for Percy visual testing: - Percy Snapshot — capture DOM snapshots with all options (widths, percy_css, scope, labels, regions, responsive capture, etc.) - Percy Screenshot — BrowserStack Automate support - Create Percy Region — build ignore/consider region definitions - Percy Is Running — check Percy CLI availability Robot Framework import is wrapped in try/except so the existing percy-selenium package works unchanged when robotframework is not installed. When it is installed, PercyLibrary becomes available as a Robot library that delegates to the existing percy_snapshot() and percy_automate_screenshot() functions. Usage: Library percy.robot_library.PercyLibrary 17 new tests covering parse helpers, keyword dispatch, and graceful import. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Open
3 tasks
28 end-to-end Robot tests covering all Percy keywords: basic snapshots, responsive widths, min height, Percy CSS, scoped snapshots, JS/layout/ shadow DOM, labels, test case metadata, ignore/consider/intelliignore regions, responsive capture, all options combined, and utility keywords. Run with: percy exec -- robot tests/test_robot_integration.robot Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…-error in pylint Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ic-methods Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…cy_snapshot Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…schema Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Show full workflow for using Create Percy Region with both Percy Snapshot (DOM) and Percy Screenshot (Automate), including multiple regions, padding, and bounding box examples. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… in build info When Robot Framework tests use percy.robot_library.PercyLibrary, the snapshot module's CLIENT_INFO was hardcoded to percy-selenium-python, causing Percy builds to display "selenium" in the Environment field. Override the snapshot module's CLIENT_INFO and ENV_INFO when PercyLibrary is instantiated so the Percy CLI sends the correct wrapper identity (percy-robotframework-selenium) to the Percy API. The override only applies in Robot Framework context — plain Selenium users are unaffected. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move selenium import before percy imports to fix wrong-import-order. Shorten docstring examples to stay within 100-char limit. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Adds native Robot Framework keywords for Percy visual testing directly into
percy-selenium-python. No separate SDK needed — users installrobotframeworkandrobotframework-seleniumlibraryalongsidepercy-seleniumand get Robot keywords automatically.What's added
percy/robot_library.py— Robot Framework library with keywordstests/test_robot_library.py— 17 tests covering all functionalitypercy/__init__.py— no impact when robotframework is not installedKeywords
Key design decisions
import robotwrapped intry/except— existingpercy-seleniumbehavior is unchanged when robotframework is not installedpercy_snapshot()andpercy_automate_screenshot()— no code duplicationPercyLibraryclass raisesImportErrorwith a clear messageUsage
percy exec -- robot tests/Test plan
References
🤖 Generated with Claude Code