import { TIMELINE_DROPPED_DATA_PROVIDERS , TIMELINE_DATA_PROVIDERS_ACTION_MENU , TIMELINE_FLYOUT_HEADER , } from '../../screens/timeline' ; import { waitForAllHostsToBeLoaded } from '../../tasks/hosts/all_hosts' ; import { loginAndWaitForPage } from '../../tasks/login' ; import { openTimelineUsingToggle } from '../../tasks/security_main' ; import { addDataProvider , closeTimeline , createNewTimeline } from '../../tasks/timeline' ; import { HOSTS_URL } from '../../urls/navigation' ; import { cleanKibana , scrollToBottom } from '../../tasks/common' ; describe ( 'timeline data providers' , ( ) => { before ( ( ) => { cleanKibana ( ) ; loginAndWaitForPage ( HOSTS_URL ) ; waitForAllHostsToBeLoaded ( ) ; scrollToBottom ( ) ; } ) ; afterEach ( ( ) => { createNewTimeline ( ) ; closeTimeline ( ) ; } ) ; it ( 'displays the data provider action menu when Enter is pressed' , ( done ) => { openTimelineUsingToggle ( ) ; addDataProvider ( { field : 'host.name' , operator : 'exists' } ) . then ( ( ) => { cy . get ( TIMELINE_DATA_PROVIDERS_ACTION_MENU ) . should ( 'not.exist' ) ; cy . get ( `${ TIMELINE_FLYOUT_HEADER } ${ TIMELINE_DROPPED_DATA_PROVIDERS }` ) . pipe ( ( $el ) => $el . trigger ( 'focus' ) ) . should ( 'exist' ) ; cy . get ( `${ TIMELINE_FLYOUT_HEADER } ${ TIMELINE_DROPPED_DATA_PROVIDERS }` ) . first ( ) . parent ( ) . type ( '{enter}' ) ; cy . get ( TIMELINE_DATA_PROVIDERS_ACTION_MENU ) . should ( 'exist' ) ; done ( ) ; } ) ; } ) ; } ) ;