import { AnswersQuestions , MetaQuestion , Question , UsesAbilities } from '@serenity-js/core' ; import { ElementFinder } from 'protractor' ; import { withAnswerOf } from '../../withAnswerOf' ; import { override } from './override' ; desc Locates a single  WebElement located within another  WebElement .
 *
 *  Instead of using this class directly, please use  Target . the and  TargetElement instead.
 *
 *  public see Target extends serenity-js implements serenity-js export class TargetNestedElement extends Question < ElementFinder > implements MetaQuestion < Question < ElementFinder > | ElementFinder , ElementFinder > { desc param { Question < ElementFinder > | ElementFinder } parent param { Question < ElementFinder > | ElementFinder } child constructor ( private readonly parent , private readonly child ) { super ( `${ child . toString ( ) } of ${ parent }` ) ; } desc Retrieves a  WebElement located by `locator`,
     *  resolved in the context of a `parent`  WebElement .
     *
     *  param { Question < ElementFinder > | ElementFinder } parent returns { TargetNestedElement } see Target of ( parent ) { return new TargetNestedElement ( parent , this ) ; } desc Makes the provided  {@link @serenity-js/core/lib/screenplay/actor~Actor} *  answer this  {@link @serenity-js/core/lib/screenplay~Question} .
     *
     *  param { AnswersQuestions & UsesAbilities } actor returns { Promise < void > } see {@link @serenity-js/core/lib/screenplay/actor~Actor} see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions} see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities} answeredBy ( actor ) { return withAnswerOf < ElementFinder , ElementFinder > ( actor , this . parent , parent => withAnswerOf < ElementFinder , ElementFinder > ( actor , this . child , child => override ( parent . element ( child . locator ( ) ) , 'toString' , TargetNestedElement . prototype . toString . bind ( this ) ) ) ) ; } }