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
QuestionAdapterthat simplifies access to the notes stored in this notepad. Allows theActorto record, read, and remove notes.Learn more
Type parameters
- N: Record<any, any>
Returns NotepadAdapter<N>
externalhas
Checks if a note identified by
subjectexists in the notepad.Type parameters
- Subject: string | number | symbol
Parameters
externalsubject: Subject
A subject (name) that uniquely identifies a given note
Returns boolean
trueif the note exists,falseotherwise
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
valueuniquely identified bysubjectin 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
subjectfrom the notepad.Type parameters
- Subject: string | number | symbol
Parameters
externalsubject: Subject
Returns boolean
trueif the item in the Notepad object existed and has been removed,falseotherwise.
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
TakeNotesand notes for more usage examples.Sharing a notepad between actors
Learn more
TakeNotesCast