import { FtrProviderContext } from '../../ftr_provider_context' ; import { MlSecurityCommon , USER } from './security_common' ; export function MachineLearningSecurityUIProvider ( { getPageObjects } , mlSecurityCommon ) { const PageObjects = getPageObjects ( [ 'security' ] ) ; return { async loginAs ( user ) { const password = mlSecurityCommon . getPasswordForUser ( user ) ; await PageObjects . security . forceLogout ( ) ; await PageObjects . security . login ( user , password , { expectSuccess : true , } ) ; } , async loginAsMlPowerUser ( ) { await this . loginAs ( USER . ML_POWERUSER ) ; } , async loginAsMlViewer ( ) { await this . loginAs ( USER . ML_VIEWER ) ; } , async logout ( ) { await PageObjects . security . forceLogout ( ) ; } , } ; }