@@ -34,7 +34,7 @@ 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 { actionAvailable } from './helper/Awaiters' ;
37+ import { openDropDownMenuEditorAction , selectDropDownMenuEditorAction } from './helper/Awaiters' ;
3838
3939describe ( 'Camel file editor test' , function ( ) {
4040
@@ -68,26 +68,22 @@ describe('Camel file editor test', function () {
6868 if ( process . platform === "darwin" ) {
6969 this . skip ( ) ;
7070 }
71- await actionAvailable ( editorView , "Run or Debug..." ) ;
72- const action = ( await editorView . getAction ( "Run or Debug..." ) ) as EditorActionDropdown ;
73- const menu = await action . open ( ) ;
74- expect ( await menu . hasItem ( CAMEL_RUN_ACTION_LABEL ) ) . true ;
75- expect ( await menu . hasItem ( CAMEL_RUN_WORKSPACE_ACTION_LABEL ) ) . true ;
76- expect ( await menu . hasItem ( CAMEL_RUN_FOLDER_ACTION_LABEL ) ) . true ;
77- await menu . close ( ) ;
71+ const menu = await openDropDownMenuEditorAction ( editorView , "Run or Debug..." ) ;
72+ expect ( await menu ?. hasItem ( CAMEL_RUN_ACTION_LABEL ) ) . true ;
73+ expect ( await menu ?. hasItem ( CAMEL_RUN_WORKSPACE_ACTION_LABEL ) ) . true ;
74+ expect ( await menu ?. hasItem ( CAMEL_RUN_FOLDER_ACTION_LABEL ) ) . true ;
75+ await menu ?. close ( ) ;
7876 } ) ;
7977
8078 it ( 'Debug and Run actions are available' , async function ( ) {
8179 if ( process . platform === "darwin" ) {
8280 this . skip ( ) ;
8381 }
84- await actionAvailable ( editorView , "Run or Debug..." ) ;
85- const action = ( await editorView . getAction ( "Run or Debug..." ) ) as EditorActionDropdown ;
86- const menu = await action . open ( ) ;
87- expect ( await menu . hasItem ( CAMEL_RUN_DEBUG_ACTION_LABEL ) ) . true ;
88- expect ( await menu . hasItem ( CAMEL_RUN_DEBUG_WORKSPACE_ACTION_LABEL ) ) . true ;
89- expect ( await menu . hasItem ( CAMEL_RUN_DEBUG_FOLDER_ACTION_LABEL ) ) . true ;
90- await menu . close ( ) ;
82+ const menu = await openDropDownMenuEditorAction ( editorView , "Run or Debug..." ) ;
83+ expect ( await menu ?. hasItem ( CAMEL_RUN_DEBUG_ACTION_LABEL ) ) . true ;
84+ expect ( await menu ?. hasItem ( CAMEL_RUN_DEBUG_WORKSPACE_ACTION_LABEL ) ) . true ;
85+ expect ( await menu ?. hasItem ( CAMEL_RUN_DEBUG_FOLDER_ACTION_LABEL ) ) . true ;
86+ await menu ?. close ( ) ;
9187 } ) ;
9288
9389 const runActionLabels = [
@@ -101,10 +97,7 @@ describe('Camel file editor test', function () {
10197 if ( process . platform === "darwin" ) {
10298 this . skip ( ) ;
10399 }
104- await actionAvailable ( editorView , "Run or Debug..." ) ;
105- const action = ( await editorView . getAction ( "Run or Debug..." ) ) as EditorActionDropdown ;
106- const menu = await action . open ( ) ;
107- await menu . select ( runActionLabels . label ) ;
100+ await selectDropDownMenuEditorAction ( editorView , "Run or Debug..." , runActionLabels . label ) ;
108101 await waitUntilTerminalHasText ( driver , runActionLabels . terminalText , 2000 , 120000 ) ;
109102 await killTerminal ( ) ;
110103 } ) ;
@@ -124,10 +117,7 @@ describe('Camel file editor test', function () {
124117 if ( process . platform === "darwin" ) {
125118 this . skip ( ) ;
126119 }
127- await actionAvailable ( editorView , "Run or Debug..." ) ;
128- const action = ( await editorView . getAction ( "Run or Debug..." ) ) as EditorActionDropdown ;
129- const menu = await action . open ( ) ;
130- await menu . select ( debugActionLabels . label ) ;
120+ await selectDropDownMenuEditorAction ( editorView , "Run or Debug..." , debugActionLabels . label ) ;
131121
132122 await waitUntilTerminalHasText ( driver , debugActionLabels . terminalText , 2000 , 120000 ) ;
133123
0 commit comments