Skip to content

Commit

Permalink
fixing isValid function call bug (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
prklm10 authored Apr 16, 2024
1 parent 2592ede commit bc2d9ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public void getRegionsByLocation(JSONArray elementsArray, List<Region> customLoc
for (int index = 0; index < customLocations.size(); index++) {
try {
Region customLocation = customLocations.get(index);
if (customLocation.isValid(width, height)) {
if (customLocation.isValid(height, width)) {
String selector = "custom region " + index;
JSONObject region = new JSONObject();
JSONObject coordinates = new JSONObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,12 @@ public void testGetRegionsByLocation() {
customRegion.setBottom(100);
customRegion.setLeft(200);
customRegion.setRight(250);
// Dimensions are 1080x2160
Region invaliCustomRegion1 = new Region(2299, 2230, 200, 250);
Region invaliCustomRegion2 = new Region(50, 100, 1070, 1100);
customLocations.add(customRegion);
customLocations.add(invaliCustomRegion1);
customLocations.add(invaliCustomRegion2);

AndroidMetadata metadata = new AndroidMetadata(androidDriver, "dummy", null, null, null, null);
GenericProvider genericProvider = new GenericProvider(androidDriver);
Expand Down

0 comments on commit bc2d9ea

Please sign in to comment.