File tree Expand file tree Collapse file tree 7 files changed +9138
-0
lines changed
legacy/plugins/siem/cypress
test/siem_cypress/es_archives/timeline_signals Expand file tree Collapse file tree 7 files changed +9138
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+ * or more contributor license agreements. Licensed under the Elastic License;
4+ * you may not use this file except in compliance with the Elastic License.
5+ */
6+
7+ import { SIGNAL_ID } from '../screens/detections' ;
8+ import { PROVIDER_BADGE } from '../screens/timeline' ;
9+
10+ import {
11+ expandFirstSignal ,
12+ investigateFirstSignalInTimeline ,
13+ waitForSignalsPanelToBeLoaded ,
14+ } from '../tasks/detections' ;
15+ import { esArchiverLoad , esArchiverUnload } from '../tasks/es_archiver' ;
16+ import { loginAndWaitForPage } from '../tasks/login' ;
17+
18+ import { DETECTIONS } from '../urls/navigation' ;
19+
20+ describe ( 'Detections timeline' , ( ) => {
21+ beforeEach ( ( ) => {
22+ esArchiverLoad ( 'timeline_signals' ) ;
23+ loginAndWaitForPage ( DETECTIONS ) ;
24+ } ) ;
25+
26+ afterEach ( ( ) => {
27+ esArchiverUnload ( 'timeline_signals' ) ;
28+ } ) ;
29+
30+ it ( 'Investigate signal in default timeline' , ( ) => {
31+ waitForSignalsPanelToBeLoaded ( ) ;
32+ expandFirstSignal ( ) ;
33+ cy . get ( SIGNAL_ID )
34+ . first ( )
35+ . invoke ( 'text' )
36+ . then ( eventId => {
37+ investigateFirstSignalInTimeline ( ) ;
38+ cy . get ( PROVIDER_BADGE )
39+ . invoke ( 'text' )
40+ . should ( 'eql' , `_id: "${ eventId } "` ) ;
41+ } ) ;
42+ } ) ;
43+ } ) ;
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+ * or more contributor license agreements. Licensed under the Elastic License;
4+ * you may not use this file except in compliance with the Elastic License.
5+ */
6+
7+ interface Timeline {
8+ title : string ;
9+ query : string ;
10+ }
Original file line number Diff line number Diff line change 66
77export const CLOSED_SIGNALS_BTN = '[data-test-subj="closedSignals"]' ;
88
9+ export const EXPAND_SIGNAL_BTN = '[data-test-subj="expand-event"]' ;
10+
911export const LOADING_SIGNALS_PANEL = '[data-test-subj="loading-signals-panel"]' ;
1012
1113export const MANAGE_SIGNAL_DETECTION_RULES_BTN = '[data-test-subj="manage-signal-detection-rules"]' ;
@@ -20,8 +22,12 @@ export const OPENED_SIGNALS_BTN = '[data-test-subj="openSignals"]';
2022
2123export const SELECTED_SIGNALS = '[data-test-subj="selectedSignals"]' ;
2224
25+ export const SEND_SIGNAL_TO_TIMELINE_BTN = '[data-test-subj="send-signal-to-timeline-button"]' ;
26+
2327export const SHOWING_SIGNALS = '[data-test-subj="showingSignals"]' ;
2428
2529export const SIGNALS = '[data-test-subj="event"]' ;
2630
31+ export const SIGNAL_ID = '[data-test-subj="draggable-content-_id"]' ;
32+
2733export const SIGNAL_CHECKBOX = '[data-test-subj="select-event-container"] .euiCheckbox__input' ;
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ export const ID_FIELD = '[data-test-subj="timeline"] [data-test-subj="field-name
1414
1515export const ID_TOGGLE_FIELD = '[data-test-subj="toggle-field-_id"]' ;
1616
17+ export const PROVIDER_BADGE = '[data-test-subj="providerBadge"]' ;
18+
1719export const SEARCH_OR_FILTER_CONTAINER =
1820 '[data-test-subj="timeline-search-or-filter-search-container"]' ;
1921
Original file line number Diff line number Diff line change 66
77import {
88 CLOSED_SIGNALS_BTN ,
9+ EXPAND_SIGNAL_BTN ,
910 LOADING_SIGNALS_PANEL ,
1011 MANAGE_SIGNAL_DETECTION_RULES_BTN ,
1112 OPEN_CLOSE_SIGNAL_BTN ,
1213 OPEN_CLOSE_SIGNALS_BTN ,
1314 OPENED_SIGNALS_BTN ,
15+ SEND_SIGNAL_TO_TIMELINE_BTN ,
1416 SIGNALS ,
1517 SIGNAL_CHECKBOX ,
1618} from '../screens/detections' ;
@@ -26,6 +28,12 @@ export const closeSignals = () => {
2628 cy . get ( OPEN_CLOSE_SIGNALS_BTN ) . click ( { force : true } ) ;
2729} ;
2830
31+ export const expandFirstSignal = ( ) => {
32+ cy . get ( EXPAND_SIGNAL_BTN )
33+ . first ( )
34+ . click ( { force : true } ) ;
35+ } ;
36+
2937export const goToClosedSignals = ( ) => {
3038 cy . get ( CLOSED_SIGNALS_BTN ) . click ( { force : true } ) ;
3139} ;
@@ -58,6 +66,12 @@ export const selectNumberOfSignals = (numberOfSignals: number) => {
5866 }
5967} ;
6068
69+ export const investigateFirstSignalInTimeline = ( ) => {
70+ cy . get ( SEND_SIGNAL_TO_TIMELINE_BTN )
71+ . first ( )
72+ . click ( { force : true } ) ;
73+ } ;
74+
6175export const waitForSignals = ( ) => {
6276 cy . get ( REFRESH_BUTTON )
6377 . invoke ( 'text' )
You can’t perform that action at this time.
0 commit comments