@@ -32,16 +32,18 @@ import { waitForIpsTableToBeLoaded } from '../tasks/network/flows';
3232import { clearSearchBar , kqlSearch , navigateFromHeaderTo } from '../tasks/security_header' ;
3333import { openTimelineUsingToggle } from '../tasks/security_main' ;
3434import {
35- addDescriptionToTimeline ,
3635 addNameToTimeline ,
3736 closeTimeline ,
38- executeTimelineKQL ,
37+ populateTimeline ,
3938 waitForTimelineChanges ,
4039} from '../tasks/timeline' ;
4140
4241import { HOSTS_URL } from '../urls/navigation' ;
4342import { ABSOLUTE_DATE_RANGE } from '../urls/state' ;
4443
44+ import { timeline } from '../objects/timeline' ;
45+ import { TIMELINE } from '../screens/create_new_case' ;
46+
4547const ABSOLUTE_DATE = {
4648 endTime : '2019-08-01T20:33:29.186Z' ,
4749 endTimeTimeline : '2019-08-02T21:03:29.186Z' ,
@@ -51,8 +53,7 @@ const ABSOLUTE_DATE = {
5153 startTimeTimeline : '2019-08-02T20:03:29.186Z' ,
5254} ;
5355
54- // FLAKY: https://github.com/elastic/kibana/issues/61612
55- describe . skip ( 'url state' , ( ) => {
56+ describe ( 'url state' , ( ) => {
5657 it ( 'sets the global start and end dates from the url' , ( ) => {
5758 loginAndWaitForPageWithoutDateRange ( ABSOLUTE_DATE_RANGE . url ) ;
5859 cy . get ( DATE_PICKER_START_DATE_POPOVER_BUTTON ) . should (
@@ -222,23 +223,12 @@ describe.skip('url state', () => {
222223 it ( 'sets and reads the url state for timeline by id' , ( ) => {
223224 loginAndWaitForPage ( HOSTS_URL ) ;
224225 openTimelineUsingToggle ( ) ;
225- executeTimelineKQL ( 'host.name: *' ) ;
226-
227- cy . get ( SERVER_SIDE_EVENT_COUNT )
228- . invoke ( 'text' )
229- . then ( ( strCount ) => {
230- const intCount = + strCount ;
231- cy . wrap ( intCount ) . should ( 'be.above' , 0 ) ;
232- } ) ;
226+ populateTimeline ( ) ;
233227
234228 cy . server ( ) ;
235229 cy . route ( 'PATCH' , '**/api/timeline' ) . as ( 'timeline' ) ;
236230
237- const timelineName = 'Security' ;
238- const timelineDescription = 'This is the best timeline of the world' ;
239- addNameToTimeline ( timelineName ) ;
240- waitForTimelineChanges ( ) ;
241- addDescriptionToTimeline ( timelineDescription ) ;
231+ addNameToTimeline ( timeline . title ) ;
242232 waitForTimelineChanges ( ) ;
243233
244234 cy . wait ( '@timeline' ) . then ( ( response ) => {
@@ -249,9 +239,10 @@ describe.skip('url state', () => {
249239 cy . visit ( '/app/home' ) ;
250240 cy . visit ( `/app/security/timelines?timeline=(id:'${ timelineId } ',isOpen:!t)` ) ;
251241 cy . get ( DATE_PICKER_APPLY_BUTTON_TIMELINE ) . should ( 'exist' ) ;
252- cy . get ( DATE_PICKER_APPLY_BUTTON_TIMELINE ) . invoke ( 'text' ) . should ( 'not.equal' , 'Updating' ) ;
242+ cy . get ( DATE_PICKER_APPLY_BUTTON_TIMELINE ) . should ( 'not.have.text' , 'Updating' ) ;
243+ cy . get ( TIMELINE ) . should ( 'be.visible' ) ;
253244 cy . get ( TIMELINE_TITLE ) . should ( 'be.visible' ) ;
254- cy . get ( TIMELINE_TITLE ) . should ( 'have.attr' , 'value' , timelineName ) ;
245+ cy . get ( TIMELINE_TITLE ) . should ( 'have.attr' , 'value' , timeline . title ) ;
255246 } ) ;
256247 } ) ;
257248} ) ;
0 commit comments