Skip to content

Commit

Permalink
🔖 release-v2.0.2 (#257)
Browse files Browse the repository at this point in the history
* 🔖 release-v2.0.2

* Updating java syntax

* Update Variables
  • Loading branch information
Amit3200 authored Oct 26, 2023
1 parent bd30990 commit 9db235c
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 18 deletions.
56 changes: 40 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,26 +172,50 @@ public class Example {
- `driver` (**required**) - A selenium driver instance
- `name` (**required**) - The screenshot name; must be unique to each screenshot
- `options` (**optional**) - There are various options supported by percy.screenshot to server further functionality.
- `freezeAnimation` - Boolean value by default it falls back to `false`, you can pass `true` and percy will freeze image based animations.
- `freezeAnimatedImage` - Boolean value by default it falls back to `false`, you can pass `true` and percy will freeze image based animations.
- `freezeImageBySelectors` - List of selectors. Images will be freezed which are passed using selectors. For this to work `freezeAnimatedImage` must be set to true.
- `freezeImageByXpaths` - List of xpaths. Images will be freezed which are passed using xpaths. For this to work `freezeAnimatedImage` must be set to true.
- `percyCSS` - Custom CSS to be added to DOM before the screenshot being taken. Note: This gets removed once the screenshot is taken.
- `ignoreRegionXpaths` - elements in the DOM can be ignored using xpath
- `ignoreRegionSelectors` - elements in the DOM can be ignored using selectors.
- `ignoreRegionSeleniumElements` - elements can be ignored using selenium_elements.
- `customIgnoreRegions` - elements can be ignored using custom boundaries
- IgnoreRegion:-
- Description: This class represents a rectangular area on a screen that needs to be ignored for visual diff.

- Constructor:
- `ignoreRegionXpaths` - List of xpaths. elements in the DOM can be ignored using xpath
- `ignoreRegionSelectors` - List of selectors. elements in the DOM can be ignored using selectors.
- `ignoreRegionSeleniumElements` - List of selenium web-element. elements can be ignored using selenium_elements.
- `customIgnoreRegions` - List of custom objects. elements can be ignored using custom boundaries
- Refer to example -
- ```
List<HashMap> customRegion = new ArrayList<>();
HashMap<String, Integer> region1 = new HashMap<>();
region1.put("top", 10);
region1.put("bottom", 110);
region1.put("right", 10);
region1.put("left", 120);
customRegion.add(region1);
options.put("custom_ignore_regions", customRegion);
```
init(self, top, bottom, left, right)
- Parameters:
- `top` (int): Top coordinate of the ignore region.
- `bottom` (int): Bottom coordinate of the ignore region.
- `left` (int): Left coordinate of the ignore region.
- `right` (int): Right coordinate of the ignore region.
- `considerRegionXpaths` - List of xpaths. elements in the DOM can be considered for diffing and will be ignored by Intelli Ignore using xpaths.
- `considerRegionSelectors` - List of selectors. elements in the DOM can be considered for diffing and will be ignored by Intelli Ignore using selectors.
- `considerRegionSeleniumElements` - List of selenium web-element. elements can be considered for diffing and will be ignored by Intelli Ignore using selenium_elements.
- `customConsiderRegions` - List of custom objects. elements can be considered for diffing and will be ignored by Intelli Ignore using custom boundaries
- Refer to example -
- ```
List<HashMap> customRegion = new ArrayList<>();
HashMap<String, Integer> region2 = new HashMap<>();
region2.put("top", 10);
region2.put("bottom", 110);
region2.put("right", 10);
region2.put("left", 120);
customRegion.add(region2);
options.put("custom_consider_regions", customRegion);
```
- Parameters:
`top` (int): Top coordinate of the ignore region.
`bottom` (int): Bottom coordinate of the ignore region.
`left` (int): Left coordinate of the ignore region.
`right` (int): Right coordinate of the ignore region.
- Raises:ValueError: If top, bottom, left, or right is less than 0 or top is greater than or equal to bottom or left is greater than or equal to right.
- valid: Ignore region should be within the boundaries of the screen.
- `top` (int): Top coordinate of the consider region.
- `bottom` (int): Bottom coordinate of the consider region.
- `left` (int): Left coordinate of the consider region.
- `right` (int): Right coordinate of the consider region.
### Creating Percy on automate build
Note: Automate Percy Token starts with `auto` keyword. The command can be triggered using `exec` keyword.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>io.percy</groupId>
<artifactId>percy-java-selenium</artifactId>
<version>2.0.2-beta.1</version>
<version>2.0.2</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/percy/selenium/Environment.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
class Environment {
private WebDriver driver;
private final static String SDK_VERSION = "2.0.2-beta.1";
private final static String SDK_VERSION = "2.0.2";
private final static String SDK_NAME = "percy-java-selenium";

Environment(WebDriver driver) {
Expand Down

0 comments on commit 9db235c

Please sign in to comment.