@@ -244,28 +244,23 @@ public class Example {
244244 - `diffIgnoreThreshold` (number): The threshold for ignoring minor differences.
245245### Example Usage for regions
246246```
247- Map<String, Object> elementSelector = new HashMap<>();
248- elementSelector.put("elementCSS", ".ad-banner");
249-
250- Map<String, Object> configuration = new HashMap<>();
251- configuration.put("diffSensitivity", 2);
252- configuration.put("imageIgnoreThreshold", 0.2);
253- configuration.put("carouselsEnabled", true);
254- configuration.put("bannersEnabled", true);
255- configuration.put("adsEnabled", true);
256-
257- Map<String, Object> assertion = new HashMap<>();
258- assertion.put("diffIgnoreThreshold", 0.4);
259-
260- Map<String, Object> obj1 = new HashMap<>();
261- obj1.put("elementSelector", elementSelector);
262- obj1.put("algorithm", "intelliignore");
263- obj1.put("configuration", configuration);
264- obj1.put("assertion", assertion);
265-
247+ Map<String, Object> params = new HashMap<>();
248+ params.put("elementXpath", "//div[ @id ='test'] ");
249+ params.put("algorithm", "standard");
250+ params.put("diffSensitivity", 3);
251+ params.put("imageIgnoreThreshold", 0.2);
252+ params.put("carouselsEnabled", true);
253+ params.put("bannersEnabled", false);
254+ params.put("adsEnabled", true);
255+ params.put("diffIgnoreThreshold", 0.1);
256+
257+ // Call the method to create the region
258+ Map<String, Object> regions2 = percy.createRegion(params);
266259 List<Map<String, Object>> regions = Collections.singletonList(obj1);
260+ Map<String, Object> options = new HashMap<>();
261+ options.put("regions", regions);
267262
268- percy.snapshot("Homepage", regions );
263+ percy.snapshot("Homepage", options );
269264
270265```
271266
0 commit comments