import { FtrProviderContext } from '../ftr_provider_context' ; export default function ( { getService , getPageObjects } ) { const a11y = getService ( 'a11y' ) ; const esArchiver = getService ( 'esArchiver' ) ; const retry = getService ( 'retry' ) ; const testSubjects = getService ( 'testSubjects' ) ; const { common } = getPageObjects ( [ 'common' ] ) ; describe ( 'Enterprise Search' , ( ) => { before ( async ( ) => { await esArchiver . load ( 'x-pack/test/functional/es_archives/empty_kibana' ) ; } ) ; describe ( 'Overview' , ( ) => { before ( async ( ) => { await common . navigateToApp ( 'enterprise_search/overview' ) ; } ) ; it ( 'loads a landing page with product cards' , async function ( ) { await retry . waitFor ( 'AS product card visible' , async ( ) => await testSubjects . exists ( 'appSearchProductCard' ) ) ; await retry . waitFor ( 'WS product card visible' , async ( ) => await testSubjects . exists ( 'workplaceSearchProductCard' ) ) ; await a11y . testAppSnapshot ( ) ; } ) ; it ( 'loads a setup guide' , async function ( ) { await testSubjects . click ( 'setupGuideLink' ) ; await retry . waitFor ( 'setup guide visible' , async ( ) => await testSubjects . exists ( 'setupGuide' ) ) ; await a11y . testAppSnapshot ( ) ; } ) ; } ) ; describe ( 'App Search' , ( ) => { before ( async ( ) => { await common . navigateToApp ( 'enterprise_search/app_search' ) ; } ) ; it ( 'loads a setup guide' , async function ( ) { await retry . waitFor ( 'setup guide visible' , async ( ) => await testSubjects . exists ( 'setupGuide' ) ) ; await a11y . testAppSnapshot ( ) ; } ) ; } ) ; describe ( 'Workplace Search' , ( ) => { before ( async ( ) => { await common . navigateToApp ( 'enterprise_search/workplace_search' ) ; } ) ; it ( 'loads a setup guide' , async function ( ) { await retry . waitFor ( 'setup guide visible' , async ( ) => await testSubjects . exists ( 'setupGuide' ) ) ; await a11y . testAppSnapshot ( ) ; } ) ; } ) ; } ) ; }