Skip to content

Commit d0f172e

Browse files
Resolved UI test cases issue
1 parent ac1779c commit d0f172e

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

  • checkmarx-ast-eclipse-plugin-tests/src/test/java/checkmarx/ast/eclipse/plugin/tests/ui

checkmarx-ast-eclipse-plugin-tests/src/test/java/checkmarx/ast/eclipse/plugin/tests/ui/BaseUITest.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -302,17 +302,18 @@ protected static void waitUntilBranchComboIsEnabled() throws TimeoutException {
302302
* Wait for connection response
303303
*/
304304
protected static void waitForConnectionResponse() throws TimeoutException {
305+
boolean found = false;
305306
int retryIdx = 0;
306-
while (!_bot.text(3).getText().equals(INFO_SUCCESSFUL_CONNECTION)) {
307-
if (retryIdx == 10) {
308-
break;
309-
}
310-
_bot.sleep(1000);
311-
retryIdx++;
307+
while (!found) {
308+
found = _bot.texts().stream()
309+
.anyMatch(t -> t.getText().equals(INFO_SUCCESSFUL_CONNECTION));
310+
if (found) break;
311+
if (retryIdx == 10) break;
312+
_bot.sleep(1000);
313+
retryIdx++;
312314
}
313-
314-
if (retryIdx == 10) {
315-
throw new TimeoutException("Connection validation timeout after 10000ms.");
315+
if (!found) {
316+
throw new TimeoutException("Connection validation timeout after 10000ms.");
316317
}
317318
}
318319

0 commit comments

Comments
 (0)