77import expect from '@kbn/expect' ;
88import { FtrProviderContext } from '../../ftr_provider_context' ;
99
10- export default ( { getPageObjects } : FtrProviderContext ) => {
11- // TODO: add UI functional tests
10+ export default ( { getPageObjects, getService } : FtrProviderContext ) => {
1211 const pageObjects = getPageObjects ( [ 'uptime' ] ) ;
12+ const retry = getService ( 'retry' ) ;
1313
1414 describe ( 'overview page' , function ( ) {
1515 const DEFAULT_DATE_START = 'Sep 10, 2019 @ 12:40:08.078' ;
@@ -84,16 +84,18 @@ export default ({ getPageObjects }: FtrProviderContext) => {
8484 ] ) ;
8585 } ) ;
8686
87- // Flakey, see https://github.com/elastic/kibana/issues/54541
88- describe . skip ( 'snapshot counts' , ( ) => {
87+ describe ( 'snapshot counts' , ( ) => {
8988 it ( 'updates the snapshot count when status filter is set to down' , async ( ) => {
9089 await pageObjects . uptime . goToUptimePageAndSetDateRange (
9190 DEFAULT_DATE_START ,
9291 DEFAULT_DATE_END
9392 ) ;
9493 await pageObjects . uptime . setStatusFilter ( 'down' ) ;
95- const counts = await pageObjects . uptime . getSnapshotCount ( ) ;
96- expect ( counts ) . to . eql ( { up : '0' , down : '7' } ) ;
94+
95+ await retry . tryForTime ( 12000 , async ( ) => {
96+ const counts = await pageObjects . uptime . getSnapshotCount ( ) ;
97+ expect ( counts ) . to . eql ( { up : '0' , down : '7' } ) ;
98+ } ) ;
9799 } ) ;
98100
99101 it ( 'updates the snapshot count when status filter is set to up' , async ( ) => {
@@ -102,8 +104,10 @@ export default ({ getPageObjects }: FtrProviderContext) => {
102104 DEFAULT_DATE_END
103105 ) ;
104106 await pageObjects . uptime . setStatusFilter ( 'up' ) ;
105- const counts = await pageObjects . uptime . getSnapshotCount ( ) ;
106- expect ( counts ) . to . eql ( { up : '93' , down : '0' } ) ;
107+ await retry . tryForTime ( 12000 , async ( ) => {
108+ const counts = await pageObjects . uptime . getSnapshotCount ( ) ;
109+ expect ( counts ) . to . eql ( { up : '93' , down : '0' } ) ;
110+ } ) ;
107111 } ) ;
108112 } ) ;
109113 } ) ;
0 commit comments