@@ -47,6 +47,7 @@ import {
4747 isVersionNewer ,
4848 DEBUG_ITEM_OPERATOR
4949} from '../utils' ;
50+ import waitUntil from 'async-wait-until' ;
5051
5152describe ( 'Camel Debugger tests' , function ( ) {
5253 this . timeout ( 300000 ) ;
@@ -65,19 +66,34 @@ describe('Camel Debugger tests', function () {
6566 driver = VSBrowser . instance . driver ;
6667
6768 await VSBrowser . instance . openResources ( path . resolve ( 'src' , 'ui-test' , 'resources' ) ) ;
69+ console . log ( 'src/ui-test/resources opened' ) ;
6870
69- await ( await new ActivityBar ( ) . getViewControl ( 'Explorer' ) ) ?. openView ( ) ;
71+ // workaround: using waitUntil as sometimes the ActivityBar is not ready and then the View is redrawn causing staleElement error
72+ await waitUntil ( async ( ) => {
73+ try {
74+ return await ( await new ActivityBar ( ) . getViewControl ( 'Explorer' ) ) ?. openView ( ) !== undefined ;
75+ } catch {
76+ return false ;
77+ }
78+ } , 10000 , 1000 ) ;
79+
80+ console . log ( 'Explorer view opened' ) ;
7081
7182 const section = await new SideBarView ( ) . getContent ( ) . getSection ( 'resources' ) ;
7283 await section . openItem ( CAMEL_ROUTE_YAML_WITH_SPACE ) ;
7384
85+ console . log ( 'Clicked to open the Camel route' ) ;
86+
7487 const editorView = new EditorView ( ) ;
7588 await driver . wait ( async function ( ) {
7689 return ( await editorView . getOpenEditorTitles ( ) ) . find ( title => title === CAMEL_ROUTE_YAML_WITH_SPACE ) ;
7790 } , 5000 ) ;
91+ console . log ( 'Camel route editor opened' ) ;
7892
7993 await executeCommand ( CAMEL_RUN_DEBUG_ACTION_QUICKPICKS_LABEL ) ;
94+ console . log ( 'Run and debug command launched' ) ;
8095 await ( await new ActivityBar ( ) . getViewControl ( 'Run' ) ) ?. openView ( ) ;
96+ console . log ( 'run view opened' ) ;
8197 await waitUntilTerminalHasText ( driver , TEST_ARRAY_RUN_DEBUG , 4000 , 120000 ) ;
8298 textEditor = new TextEditor ( ) ;
8399 } ) ;
0 commit comments