Skip to content

Commit

Permalink
Added a missing test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ninadbstack committed Mar 31, 2023
1 parent cc62b1f commit 53aa109
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/io/percy/appium/providers/AppAutomate.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public AppAutomate(AppiumDriver driver) {
}

public String getDebugUrl(JSONObject result) {
if (result == null) return null;

String buildHash = result.getString("buildHash");
String sessionHash = result.getString("sessionHash");
return "https://app-automate.browserstack.com/dashboard/v2/builds/" + buildHash + "/sessions/" + sessionHash;
Expand Down
5 changes: 5 additions & 0 deletions src/test/java/io/percy/appium/providers/AppAutomateTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ public void testGetDebugUrl() {
Assert.assertEquals(appAutomate.getDebugUrl(result), "https://app-automate.browserstack.com/dashboard/v2/builds/abc/sessions/def");
}

@Test
public void testGetDebugUrlWhenResultIsNull() {
Assert.assertEquals(appAutomate.getDebugUrl(null), null);
}

@Test
public void testSupports() {
try {
Expand Down

0 comments on commit 53aa109

Please sign in to comment.