Skip to content

Commit

Permalink
changed content in layout comparator documentation, removed unused bl…
Browse files Browse the repository at this point in the history
…ank lines, changed error message in layout comparator
  • Loading branch information
plutasnyy committed Aug 1, 2018
1 parent 2312405 commit 329bb24
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public class LayoutComparator implements ComparatorJob {

private final ArtifactsDAO artifactsDAO;

private Integer pixelThreshold = null;
private Integer pixelThreshold;

private Double percentageThreshold = null;
private Double percentageThreshold;

LayoutComparator(ComparatorProperties comparatorProperties, ArtifactsDAO artifactsDAO) {
this.properties = comparatorProperties;
Expand Down Expand Up @@ -185,12 +185,12 @@ public void setParameters(Map<String, String> params) throws ParametersException
setPercentageThreshold(Double.valueOf(params.get(PERCENTAGE_THRESHOLD_PARAM)));
ParametersValidator
.checkRange(percentageThreshold.intValue(), 0, 100,
"Wrong percentage threshold value");
"Percentage threshold should be a decimal value between 0 and 100");
}
if (params.containsKey(PIXEL_THRESHOLD_PARAM)) {
setPixelThreshold(Integer.valueOf(params.get(PIXEL_THRESHOLD_PARAM)));
ParametersValidator.checkParameter(pixelThreshold >= 0,
"Pixel threshold should be greater than 0");
"Pixel threshold should be greater or equal to 0");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@ private void closeInputStreams(InputStream... inputStreams) {
IOUtils.closeQuietly(inputStream);
}
}
}
}
4 changes: 2 additions & 2 deletions documentation/src/main/wiki/LayoutComparator.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Resource name: screen

| Parameter | Value | Description | Mandatory |
| --------- | ----- | ----------- | --------- |
| `pixelThreshold` | int (bigger than 0) | The value to set the error threshold in pixels e.g if difference between photos is smaller or equal to `pixelThreshold`, the test will pass. In case of difference is bigger than `pixelThreshold`, the test will fail. | no |
| `percentageThreshold` | double (0 to 100) | It works as `pixelThreshold` but values are in percentages | no |
| `pixelThreshold` | int (equal or greater than 0) | The value to set the error threshold in pixels e.g if difference between photos is smaller or equal to `pixelThreshold`, the test will pass. In case of difference is bigger than `pixelThreshold`, the test will fail. | no |
| `percentageThreshold` | double (between 0 and 100) | It works as `pixelThreshold` but values are in percentages | no |

When you provide `pixelThreshold` and `percentageThreshold` test will pass only if pixel difference is smaller or equal than `pixelThreshold` and percentage difference is smaller or equal than `percentageThreshold`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<i class="fas {{theme.statusClasses[url.getStatus()]}}"></i>
</div>
<div ng-if="url.getStatus() == 'rebased' || url.getStatus() == 'conditionallyPassed'" class="fontawesome">
<i class="fas {{theme.statusClasses[url.getStatus()]}}"></i>
<i class="fas {{theme.statusClasses[url.getStatus()]}}"></i>
</div>
<div class="tile-stats">
<span class="statistics">Url cases statistics:</span>
Expand All @@ -45,7 +45,6 @@
data-trigger="hover" data-container="body">{{url.conditionallyPassed}}</span> /
<span class="status rebased" data-toggle="popover" data-content="Accepted cases"
data-trigger="hover" data-container="body">{{url.rebased}}</span>

</div>
<span>{{url.name}}</span>
</div>
Expand Down

0 comments on commit 329bb24

Please sign in to comment.