import {TakeNotes} from '@serenity-js/core/lib/screenplay/abilities'
public class | source

TakeNotes

Enables the Actor to remember an answer to a given Question, and recall it later.

Implements:

Examples:

 import { Note, TakeNote, TakeNotes } from '@serenity-js/core'
 import { BrowseTheWeb, Target, Text } from '@serenity-js/protractor'
 import { by, protractor } from 'protractor';

 class Vouchers {
     static code             = Target.the('voucher code').located(by.id('voucher'));
     static appliedVoucher   = Target.the('voucher code').located(by.id('applied-voucher'));
 }

 const actor = Actor.named('Noah').whoCan(
     TakeNotes.usingAnEmptyNotepad(),
     BrowseTheWeb.using(protractor.browser),
 );

 actor.attemptsTo(
     TakeNote.of(Text.of(Vouchers.code)),
     // ... add the product to a basket, go to checkout, etc.
     Ensure.that(Text.of(Vouchers.appliedVoucher), equals(Note.of(Text.of(Vouchers.code)))),
 );

See also:

Static Method Summary

Static Public Methods
public static

as(actor: UsesAbilities & AnswersQuestions): TakeNotes

public static

Constructor Summary

Public Constructor
public

constructor(notepad: object)

Method Summary

Public Methods
public

answerTo(question: Question | Question): Promise

Recalls the answer to a given Question

public

record(question: Question | Question, value: Promise | Answer): void

Records the answer to a given Question

Static Public Methods

public static as(actor: UsesAbilities & AnswersQuestions): TakeNotes source

Params:

NameTypeAttributeDescription
actor UsesAbilities & AnswersQuestions

Returns:

TakeNotes

public static usingAnEmptyNotepad(): TakeNotes source

Returns:

TakeNotes

Public Constructors

public constructor(notepad: object) source

Params:

NameTypeAttributeDescription
notepad object

Public Methods

public answerTo(question: Question | Question): Promise source

Recalls the answer to a given Question

Params:

NameTypeAttributeDescription
question Question | Question

Returns:

Promise

public record(question: Question | Question, value: Promise | Answer): void source

Records the answer to a given Question

Params:

NameTypeAttributeDescription
question Question | Question
value Promise | Answer

Returns:

void