externalMetaList <Supported_Context_Type, Item_Type>
Hierarchy
- List<Item_Type>
- MetaList
Implements
- ChainableMetaQuestion<Supported_Context_Type, MetaList<Supported_Context_Type, Item_Type>>
Index
Constructors
externalconstructor
Type parameters
- Supported_Context_Type
- Item_Type
Parameters
externalcollection: Answerable<Item_Type[]> & ChainableMetaQuestion<Supported_Context_Type, Question<Promise<Item_Type[]>> | Question<Item_Type[]>>
Returns MetaList<Supported_Context_Type, Item_Type>
Methods
externaldescribedAs
Changes the description of this object, as returned by
Describable.describedBy
andDescribable.toString
.Parameters
externaldescription: Answerable<string> | MetaQuestion<Item_Type[], Question<Promise<string>>>
Replaces the current description according to the following rules:
- If
description
is anAnswerable
, it replaces the current description - If
description
is aMetaQuestion
, the current description is passed ascontext
todescription.of(context)
, and the result replaces the current description
- If
Returns this
publicexternalas
Maps this question to one of a different type.
Question.about('number returned as string', actor => '42') // returns: QuestionAdapter<string>
.as(Number) // returns: QuestionAdapter<number>Type parameters
- O
Parameters
externalmapping: (answer: Item_Type[]) => O | Promise<O>
Returns QuestionAdapter<O>
externaldescribedBy
Resolves the description of this object in the context of the provided
actor
.Parameters
externalactor: AnswersQuestions & UsesAbilities & { name: string }
Returns Promise<string>
externaltoString
Returns a human-readable description of this object.
Returns string
externalforEach
Parameters
externalcallback: (current: CurrentItem<Item_Type>, index: number, items: Item_Type[]) => void | Promise<void>
Returns Task
externalansweredBy
Parameters
externalactor: AnswersQuestions & UsesAbilities
Returns Promise<Item_Type[]>
externalof
Answers the given
ChainableMetaQuestion
in the context of anotherAnswerable
and returns anotherChainableMetaQuestion
ready for further chaining.Learn more
Parameters
externalcontext: Answerable<Supported_Context_Type>
Returns MetaList<Supported_Context_Type, Item_Type>
externaleachMappedTo
Type parameters
- Mapped_Item_Type
Parameters
externalquestion: MetaQuestion<Item_Type, Question<Mapped_Item_Type | Promise<Mapped_Item_Type>>>
Returns MetaList<Supported_Context_Type, Mapped_Item_Type>
externalwhere
Type parameters
- Answer_Type
Parameters
externalquestion: MetaQuestion<Item_Type, Question<Answer_Type | Promise<Answer_Type>>>
externalexpectation: Expectation<Answer_Type>
Returns MetaList<Supported_Context_Type, Item_Type>
externalcount
Returns MetaQuestionAdapter<Supported_Context_Type, number>
externalfirst
Returns MetaQuestionAdapter<Supported_Context_Type, Item_Type>
externallast
Returns MetaQuestionAdapter<Supported_Context_Type, Item_Type>
externalnth
Parameters
externalindex: number
Returns MetaQuestionAdapter<Supported_Context_Type, Item_Type>
Serenity/JS Screenplay Pattern-style wrapper around a
ChainableMetaQuestion
representing a collection that can be resolved inSupported_Context_Type
of anotherQuestion
.For example,
PageElements.located
returnsMetaList<PageElement>
, which allows for the collection of page elements to be resolved in the context of dynamically-provided root element.