@@ -183,6 +183,49 @@ public void iCreateIntelliIgnoreRegionCSS(String cssSelector) {
183183 regions .add (percy .createRegion (params ));
184184 }
185185
186+ @ Given ("I create a Percy ignore region with CSS selector {string} and padding {int}" )
187+ public void iCreateIgnoreRegionCSSWithPadding (String cssSelector , int padding ) {
188+ Map <String , Object > params = new HashMap <>();
189+ params .put ("algorithm" , "ignore" );
190+ params .put ("elementCSS" , cssSelector );
191+ params .put ("padding" , padding );
192+ regions .add (percy .createRegion (params ));
193+ }
194+
195+ @ Given ("I create a Percy ignore region with XPath {string} and padding {int}" )
196+ public void iCreateIgnoreRegionXPathWithPadding (String xpath , int padding ) {
197+ Map <String , Object > params = new HashMap <>();
198+ params .put ("algorithm" , "ignore" );
199+ params .put ("elementXpath" , xpath );
200+ params .put ("padding" , padding );
201+ regions .add (percy .createRegion (params ));
202+ }
203+
204+ @ Given ("I create a Percy consider region with XPath {string}" )
205+ public void iCreateConsiderRegionXPath (String xpath ) {
206+ Map <String , Object > params = new HashMap <>();
207+ params .put ("algorithm" , "standard" );
208+ params .put ("elementXpath" , xpath );
209+ regions .add (percy .createRegion (params ));
210+ }
211+
212+ @ Given ("I create a Percy consider region with XPath {string} and diff sensitivity {int}" )
213+ public void iCreateConsiderRegionXPathWithSensitivity (String xpath , int sensitivity ) {
214+ Map <String , Object > params = new HashMap <>();
215+ params .put ("algorithm" , "standard" );
216+ params .put ("elementXpath" , xpath );
217+ params .put ("diffSensitivity" , sensitivity );
218+ regions .add (percy .createRegion (params ));
219+ }
220+
221+ @ Given ("I create a Percy intelliignore region with XPath {string}" )
222+ public void iCreateIntelliIgnoreRegionXPath (String xpath ) {
223+ Map <String , Object > params = new HashMap <>();
224+ params .put ("algorithm" , "intelliignore" );
225+ params .put ("elementXpath" , xpath );
226+ regions .add (percy .createRegion (params ));
227+ }
228+
186229 @ Given ("I clear Percy regions" )
187230 public void iClearPercyRegions () {
188231 regions .clear ();
@@ -253,6 +296,27 @@ public void iTakeSnapshotWithTestCase(String name, String testCase) {
253296 percy .snapshot (name , options );
254297 }
255298
299+ @ When ("I take a Percy snapshot named {string} with Shadow DOM disabled" )
300+ public void iTakeSnapshotWithShadowDomDisabled (String name ) {
301+ Map <String , Object > options = new HashMap <>();
302+ options .put ("disableShadowDom" , true );
303+ percy .snapshot (name , options );
304+ }
305+
306+ @ When ("I take a Percy snapshot named {string} with responsive capture" )
307+ public void iTakeSnapshotWithResponsiveCapture (String name ) {
308+ Map <String , Object > options = new HashMap <>();
309+ options .put ("responsiveSnapshotCapture" , true );
310+ percy .snapshot (name , options );
311+ }
312+
313+ @ When ("I take a Percy snapshot named {string} with sync" )
314+ public void iTakeSnapshotWithSync (String name ) {
315+ Map <String , Object > options = new HashMap <>();
316+ options .put ("sync" , true );
317+ percy .snapshot (name , options );
318+ }
319+
256320 @ When ("I take a Percy snapshot named {string} with regions" )
257321 public void iTakeSnapshotWithRegions (String name ) {
258322 Map <String , Object > options = new HashMap <>();
@@ -354,8 +418,12 @@ private static Map<String, Object> buildOptions(Map<String, String> table) {
354418 case "enableLayout" :
355419 case "disableShadowDom" :
356420 case "responsiveSnapshotCapture" :
421+ case "sync" :
357422 options .put (key , Boolean .parseBoolean (value ));
358423 break ;
424+ case "scopeOptions" :
425+ options .put (key , new org .json .JSONObject (value ).toMap ());
426+ break ;
359427 default :
360428 options .put (key , value );
361429 break ;
0 commit comments