@@ -34,10 +34,11 @@ import {
3434 isCamelVersionProductized ,
3535} from '../utils' ;
3636import { CAMEL_RUN_DEBUG_FOLDER_ACTION_LABEL , CAMEL_RUN_DEBUG_WORKSPACE_ACTION_LABEL , CAMEL_RUN_FOLDER_ACTION_LABEL , CAMEL_RUN_WORKSPACE_ACTION_LABEL , TOP_ROUTE_1 } from '../variables' ;
37+ import waitUntil from 'async-wait-until' ;
3738
3839describe ( 'Camel file editor test' , function ( ) {
3940
40- describe ( 'Camel Actions' , function ( ) {
41+ describe . only ( 'Camel Actions' , function ( ) {
4142 this . timeout ( 300000 ) ;
4243
4344 let driver : WebDriver ;
@@ -67,7 +68,7 @@ describe('Camel file editor test', function () {
6768 if ( process . platform === "darwin" ) {
6869 this . skip ( ) ;
6970 }
70- await driver . sleep ( 500 ) ;
71+ await actionAvailable ( editorView , "Run or Debug..." ) ;
7172 const action = ( await editorView . getAction ( "Run or Debug..." ) ) as EditorActionDropdown ;
7273 const menu = await action . open ( ) ;
7374 expect ( await menu . hasItem ( CAMEL_RUN_ACTION_LABEL ) ) . true ;
@@ -80,7 +81,7 @@ describe('Camel file editor test', function () {
8081 if ( process . platform === "darwin" ) {
8182 this . skip ( ) ;
8283 }
83- await driver . sleep ( 500 ) ;
84+ await actionAvailable ( editorView , "Run or Debug..." ) ;
8485 const action = ( await editorView . getAction ( "Run or Debug..." ) ) as EditorActionDropdown ;
8586 const menu = await action . open ( ) ;
8687 expect ( await menu . hasItem ( CAMEL_RUN_DEBUG_ACTION_LABEL ) ) . true ;
@@ -100,6 +101,7 @@ describe('Camel file editor test', function () {
100101 if ( process . platform === "darwin" ) {
101102 this . skip ( ) ;
102103 }
104+ await actionAvailable ( editorView , "Run or Debug..." ) ;
103105 const action = ( await editorView . getAction ( "Run or Debug..." ) ) as EditorActionDropdown ;
104106 const menu = await action . open ( ) ;
105107 await menu . select ( runActionLabels . label ) ;
@@ -122,6 +124,7 @@ describe('Camel file editor test', function () {
122124 if ( process . platform === "darwin" ) {
123125 this . skip ( ) ;
124126 }
127+ await actionAvailable ( editorView , "Run or Debug..." ) ;
125128 const action = ( await editorView . getAction ( "Run or Debug..." ) ) as EditorActionDropdown ;
126129 const menu = await action . open ( ) ;
127130 await menu . select ( debugActionLabels . label ) ;
@@ -135,3 +138,14 @@ describe('Camel file editor test', function () {
135138 } ) ;
136139 } ) ;
137140} ) ;
141+
142+ async function actionAvailable ( editorView : EditorView , actionLabel : string ) {
143+ await waitUntil ( async ( ) => {
144+ try {
145+ return await editorView . getAction ( actionLabel ) !== undefined ;
146+ } catch {
147+ return false ;
148+ }
149+ } ) ;
150+ }
151+
0 commit comments