import { FtrProviderContext } from '../../ftr_provider_context' ; import { WebElementWrapper } from '../../../../../test/functional/services/lib/web_element_wrapper' ; import { TabsParams } from '../../page_objects/infra_logs_page' ; export function LogStreamPageProvider ( { getPageObjects , getService } ) { const pageObjects = getPageObjects ( [ 'infraLogs' ] ) ; const retry = getService ( 'retry' ) ; const testSubjects = getService ( 'testSubjects' ) ; return { async navigateTo ( params ? ) { await pageObjects . infraLogs . navigateToTab ( 'stream' , params ) ; } , async getColumnHeaderLabels ( ) { const columnHeaderElements = await testSubjects . findAll ( '~logColumnHeader' ) ; return await Promise . all ( columnHeaderElements . map ( ( element ) => element . getVisibleText ( ) ) ) ; } , async getStreamEntries ( minimumItems = 1 ) { await retry . try ( async ( ) => { const elements = await testSubjects . findAll ( '~streamEntry' ) ; if ( ! elements || elements . length < minimumItems ) { throw new Error ( ) ; } } ) ; return await testSubjects . findAll ( '~streamEntry' ) ; } , async getLogColumnsOfStreamEntry ( entryElement ) { return await testSubjects . findAllDescendant ( '~logColumn' , entryElement ) ; } , async getNoLogsIndicesPrompt ( ) { return await testSubjects . find ( 'noLogsIndicesPrompt' ) ; } , async getNoDataPage ( ) { return await testSubjects . find ( 'noDataPage' ) ; } , } ; }