Add Cucumber step definitions for Percy visual testing#346
Open
neha-sanse wants to merge 7 commits intomasterfrom
Open
Add Cucumber step definitions for Percy visual testing#346neha-sanse wants to merge 7 commits intomasterfrom
neha-sanse wants to merge 7 commits intomasterfrom
Conversation
Add PercySteps class in io.percy.appium.cucumber package with Gherkin step definitions for: - Percy Screenshot: basic, full page, full screen, with options - Ignore/Consider regions via XPath and accessibility ID - Device config: device name, orientation, status/nav bar height - Labels, test case, screen lengths - Auto cucumber environment info in Percy build metadata Add setClientInfo/setEnvironmentInfo to Percy and Environment for framework wrapper identification. Expose CliWrapper.getEnvironment(). Cucumber dependency is provided scope - users bring their own version. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add full SDK parity for all ScreenshotOptions features: - thTestCaseExecutionId, sync - scrollableXpath, scrollableId - topScrollviewOffset, bottomScrollviewOffset - scrollSpeed, androidScrollAreaPercentage - customIgnoreRegions, customConsiderRegions (Region top/bottom/left/right) - ignoreRegionAppiumElements, considerRegionAppiumElements (XPath locator) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
29 tests covering all step definitions: driver lifecycle, screenshot options setters, ignore/consider regions, custom regions, clear options, and error states. Matches test coverage of percy-selenium-java and percy-playwright-java cucumber PRs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Percy constructor calls driver.getSessionId().toString() and getRemoteAddress(), which NPE on unstubbed mocks. Add stubs matching the pattern used in AppPercyTest. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Percy initialization reads driver capabilities for percy.enabled and platformName. Stub getCapabilities() with DesiredCapabilities to prevent NPE. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
bfc1d48 to
ee10aab
Compare
ninadbstack
previously approved these changes
May 6, 2026
The existing tests only covered lifecycle, option setters, and region creation but never invoked percy.screenshot(). This adds tests for every @when step method using a mocked Percy instance injected via reflection, verifying that each Cucumber step correctly delegates to the Percy SDK with the right name and ScreenshotOptions. Co-Authored-By: Claude Opus 4.6 <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
PercyStepsclass inio.percy.appium.cucumberpackage with Gherkin step definitions for Percy Screenshot with AppiumsetClientInfo/setEnvironmentInfoto Percy and Environment for framework wrapper identificationCliWrapper.getEnvironment()for client info overrideprovidedscope -- users bring their own versionCucumber Steps
Screenshot
Ignore/Consider Regions
Device Config
Setup
Test plan
percy-cucumber-java-appium/<version>andcucumber-java/<version>; appium-java🤖 Generated with Claude Code