import { AnswersQuestions , Expectation , ExpectationMet , ExpectationNotMet , ExpectationOutcome } from '@serenity-js/core' ; import { ElementFinder } from 'protractor' ; import { promiseOf } from '../promiseOf' ; access export class ElementFinderExpectation extends Expectation < any , ElementFinder > { static forElementTo ( message , fn ) { return new ElementFinderExpectation ( message , fn ) ; } constructor ( subject , private readonly fn ) { super ( subject ) ; } answeredBy ( actor ) { return ( actual ) => promiseOf ( this . fn ( actual ) ) . then ( _ => _ ? new ExpectationMet ( this . toString ( ) , undefined , actual ) : new ExpectationNotMet ( this . toString ( ) , undefined , actual ) ) ; } }