File tree Expand file tree Collapse file tree
checkmarx-ast-eclipse-plugin-tests/src/test/java/checkmarx/ast/eclipse/plugin/tests/ui Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments