import { Browser , WebComponent , NewablePage , Page } from './' ; export type WaitCondition = ( browser : Browser ) => Promise < boolean > ; export function elementIsVisible ( locator ) { return async ( ) => await locator ( ) . isDisplayed ( ) ; } export function elementIsPresent ( locator ) { return async ( ) => await locator ( ) !== undefined ; } export function pageHasLoaded < T extends Page > ( page ) { return ( browser ) => { const condition = new page ( browser ) . loadCondition ( ) ; return condition ( browser ) ; } ; }