import { FtrProviderContext } from '../../ftr_provider_context' ; import { TransformSecurityCommon , USER } from './security_common' ; export function TransformSecurityUIProvider ( { getPageObjects } , transformSecurityCommon ) { const PageObjects = getPageObjects ( [ 'security' ] ) ; return { async loginAs ( user ) { const password = transformSecurityCommon . getPasswordForUser ( user ) ; await PageObjects . security . forceLogout ( ) ; await PageObjects . security . login ( user , password , { expectSuccess : true , } ) ; } , async loginAsTransformPowerUser ( ) { await this . loginAs ( USER . TRANSFORM_POWERUSER ) ; } , async loginAsTransformViewer ( ) { await this . loginAs ( USER . TRANSFORM_VIEWER ) ; } , async logout ( ) { await PageObjects . security . forceLogout ( ) ; } , } ; }