Commit 89c1d74
Add Cucumber step definitions for Percy visual testing (#309)
* Add Cucumber step definitions for Percy visual testing
Add PercySteps class providing Gherkin step definitions for:
- Percy Snapshot (DOM): widths, min height, percy CSS, scope, layout mode,
JavaScript, labels, test case, responsive capture
- Percy Screenshot (Automate): with options and regions
- Create Percy Region: ignore/consider/intelliignore by CSS, XPath,
bounding box, with diff sensitivity and padding
- Data table support for arbitrary options
Cucumber dependency is provided scope - users bring their own version.
Includes unit tests for all step definitions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Report Cucumber environment info in Percy build metadata
- Add setClientInfo/setEnvironmentInfo to Percy and Environment classes
- PercySteps sets client to "percy-cucumber-java-selenium/<version>"
and environment to "cucumber-java/<version>; selenium-java"
- Add Percy.getSdkVersion() public static method
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add parity with Robot Framework: missing region and snapshot steps
- Add ignore/consider region with padding
- Add consider region with XPath (+ diff sensitivity)
- Add intelliignore region with XPath
- Add snapshot steps: Shadow DOM disabled, responsive capture, sync
- Add scopeOptions parsing in buildOptions helper
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add snapshot and screenshot tests for Cucumber PercySteps
The existing tests only covered lifecycle and region creation but never
invoked percy.snapshot() or 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 options.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 4bda7d4 commit 89c1d74
5 files changed
Lines changed: 954 additions & 0 deletions
File tree
- src
- main/java/io/percy/selenium
- cucumber
- test/java/io/percy/selenium/cucumber
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
90 | 103 | | |
91 | 104 | | |
92 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
25 | 34 | | |
26 | 35 | | |
27 | 36 | | |
| |||
33 | 42 | | |
34 | 43 | | |
35 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
36 | 57 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
89 | 110 | | |
90 | 111 | | |
91 | 112 | | |
| |||
0 commit comments