Skip to content

Commit 4384fc6

Browse files
authored
Automation-test fix - added new domain of ngrok free tunnel - .ngrok-free.app (#66)
1 parent 84424d8 commit 4384fc6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/test-app/src/test/java/io/github/kilmajster/AppTests.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,20 @@ void should_start_ngrok_and_log_tunnel_details(CapturedOutput output) throws IOE
5252

5353
private String extractNgrokHttpsTunnelUrlFromLogs(CapturedOutput output) {
5454
return Arrays.stream(StringUtils.split(output.toString(), " "))
55-
.filter(s -> s.startsWith("https://") && s.contains(".ngrok.io")).findFirst().get();
55+
.filter(this::isNgrokAppLink).findFirst().get();
56+
}
57+
58+
private boolean isNgrokAppLink(String s) {
59+
return s != null
60+
&& s.startsWith("https://")
61+
&& StringUtils.containsAny(s, "ngrok.io", "ngrok-free.app", "ngrok.app");
5662
}
5763

5864
private void waitForNgrokStartConfirmationInLogs(CapturedOutput output) throws InterruptedException {
5965
for (int i = WAIT_FOR_STARTUP_SECONDS; i > 0; i--) {
6066
Thread.sleep(1000);
6167
if (output.toString().contains("Ngrok started successfully!") || output.toString().contains("Ngrok was already running!")) {
68+
Thread.sleep(2000);
6269
return;
6370
}
6471
}

0 commit comments

Comments
 (0)