import expect from '@kbn/expect' ; import { FtrProviderContext } from '../../functional/ftr_provider_context' ; export default function ( { getService , getPageObjects } ) { const testSubjects = getService ( 'testSubjects' ) ; const PageObjects = getPageObjects ( [ 'common' ] ) ; const retry = getService ( 'retry' ) ; describe ( 'Partial results example' , ( ) => { before ( async ( ) => { await PageObjects . common . navigateToApp ( 'searchExamples' ) ; await testSubjects . click ( '/search' ) ; } ) ; it ( 'should update a progress bar' , async ( ) => { await testSubjects . click ( 'responseTab' ) ; const progressBar = await testSubjects . find ( 'progressBar' ) ; const value = await progressBar . getAttribute ( 'value' ) ; expect ( value ) . to . be ( '0' ) ; await testSubjects . click ( 'requestFibonacci' ) ; await retry . waitFor ( 'update progress bar' , async ( ) => { const newValue = await progressBar . getAttribute ( 'value' ) ; return parseFloat ( newValue ) > 0 ; } ) ; } ) ; } ) ; }