@@ -19,7 +19,6 @@ import * as path from 'path';
1919import {
2020 ActivityBar ,
2121 BottomBarPanel ,
22- EditorActionDropdown ,
2322 EditorView ,
2423 SideBarView ,
2524 VSBrowser ,
@@ -34,7 +33,7 @@ import {
3433 isCamelVersionProductized ,
3534} from '../utils' ;
3635import { 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' ;
36+ import { openDropDownMenuEditorAction , selectDropDownMenuEditorAction } from './helper/Awaiters' ;
3837
3938describe ( 'Camel file editor test' , function ( ) {
4039
@@ -68,26 +67,22 @@ describe('Camel file editor test', function () {
6867 if ( process . platform === "darwin" ) {
6968 this . skip ( ) ;
7069 }
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 ( ) ;
70+ const menu = await openDropDownMenuEditorAction ( editorView , "Run or Debug..." ) ;
71+ expect ( await menu ?. hasItem ( CAMEL_RUN_ACTION_LABEL ) ) . true ;
72+ expect ( await menu ?. hasItem ( CAMEL_RUN_WORKSPACE_ACTION_LABEL ) ) . true ;
73+ expect ( await menu ?. hasItem ( CAMEL_RUN_FOLDER_ACTION_LABEL ) ) . true ;
74+ await menu ?. close ( ) ;
7875 } ) ;
7976
8077 it ( 'Debug and Run actions are available' , async function ( ) {
8178 if ( process . platform === "darwin" ) {
8279 this . skip ( ) ;
8380 }
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 ( ) ;
81+ const menu = await openDropDownMenuEditorAction ( editorView , "Run or Debug..." ) ;
82+ expect ( await menu ?. hasItem ( CAMEL_RUN_DEBUG_ACTION_LABEL ) ) . true ;
83+ expect ( await menu ?. hasItem ( CAMEL_RUN_DEBUG_WORKSPACE_ACTION_LABEL ) ) . true ;
84+ expect ( await menu ?. hasItem ( CAMEL_RUN_DEBUG_FOLDER_ACTION_LABEL ) ) . true ;
85+ await menu ?. close ( ) ;
9186 } ) ;
9287
9388 const runActionLabels = [
@@ -101,10 +96,7 @@ describe('Camel file editor test', function () {
10196 if ( process . platform === "darwin" ) {
10297 this . skip ( ) ;
10398 }
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 ) ;
99+ await selectDropDownMenuEditorAction ( editorView , "Run or Debug..." , runActionLabels . label ) ;
108100 await waitUntilTerminalHasText ( driver , runActionLabels . terminalText , 2000 , 120000 ) ;
109101 await killTerminal ( ) ;
110102 } ) ;
@@ -124,10 +116,7 @@ describe('Camel file editor test', function () {
124116 if ( process . platform === "darwin" ) {
125117 this . skip ( ) ;
126118 }
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 ) ;
119+ await selectDropDownMenuEditorAction ( editorView , "Run or Debug..." , debugActionLabels . label ) ;
131120
132121 await waitUntilTerminalHasText ( driver , debugActionLabels . terminalText , 2000 , 120000 ) ;
133122
0 commit comments