externalNotepad <Notes>
Hierarchy
- TinyType
- Notepad
Index
Methods
staticexternalempty
Instantiates a new empty Notepad.
Type parameters
- N: Record<any, any>
Returns Notepad<N>
staticexternalwith
Instantiates a new Notepad with an initial state.
import { actorCalled, Notepad, notes, TakeNotes } from '@serenity-js/core'
import { Ensure, equals } from '@serenity-js/assertions'
interface MyNotes {
personalDetails: {
firstName: string;
lastName: string;
}
}
actorCalled('Leonard')
.whoCan(
TakeNotes.using(
Notepad.with<MyNotes>({
personalDetails: {
firstName: 'Leonard',
lastName: 'McLaud',
}
})
)
)
.attemptsTo(
Ensure.that(
notes<MyNotes>().get('personalDetails').firstName,
equals('Leonard')
),
)Type parameters
- N: Record<any, any>
Parameters
externalnotes: N
Returns Notepad<N>
staticexternalnotes
Creates a
QuestionAdapter
that simplifies access to the notes stored in this notepad. Allows theActor
to record, read, and remove notes.Learn more
Type parameters
- N: Record<any, any>
Returns NotepadAdapter<N>
externalhas
Checks if a note identified by
subject
exists in the notepad.Type parameters
- Subject: string | number | symbol
Parameters
externalsubject: Subject
A subject (name) that uniquely identifies a given note
Returns boolean
true
if the note exists,false
otherwise
externalget
Retrieves a note, identified by
subject
, from the notepad.Type parameters
- Subject: string | number | symbol
Parameters
externalsubject: Subject
A subject (name) that uniquely identifies a given note
Returns Notes[Subject]
The value of the previously recorded note.
externalset
Stores a given
value
uniquely identified bysubject
in the notepad.Type parameters
- Subject: string | number | symbol
Parameters
externalsubject: Subject
A subject (name) that uniquely identifies a given note
externalvalue: Notes[Subject]
The value to record.
Returns Notepad<Notes>
externaldelete
Removes the note identified by
subject
from the notepad.Type parameters
- Subject: string | number | symbol
Parameters
externalsubject: Subject
Returns boolean
true
if the item in the Notepad object existed and has been removed,false
otherwise.
externalclear
Deletes all the notes stored in this notepad.
Returns void
externalsize
Returns the number of notes stored in the notepad.
Returns number
externalequals
Parameters
externalanother: TinyType
Returns boolean
externaltoString
Returns string
externaltoJSON
Returns JSONValue
Stores notes recorded by an
Actor
.See
TakeNotes
and notes for more usage examples.Sharing a notepad between actors
Learn more
TakeNotes
Cast