import { AnswersQuestions , MetaQuestion , Question , UsesAbilities } from '@serenity-js/core' ; import { ElementFinder , Locator } from 'protractor' ; import { BrowseTheWeb } from '../../abilities' ; import { override } from './override' ; import { TargetNestedElement } from './TargetNestedElement' ; desc Locates a single  WebElement .
 *
 *  Instead of using this class directly, please use  Target . the instead.
 *
 *  public see Target extends serenity-js implements serenity-js export class TargetElement extends Question < ElementFinder > implements MetaQuestion < Question < ElementFinder > | ElementFinder , ElementFinder > { desc param { string } description param { protractor constructor ( protected readonly description , protected readonly locator ) { super ( `the ${ description }` ) ; } 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 override ( BrowseTheWeb . as ( actor ) . locate ( this . locator ) , 'toString' , TargetElement . prototype . toString . bind ( this ) ) ; } }