EnsureEventually <Actual>
experimental
Hierarchy
- Interaction
- EnsureEventually
Index
Constructors
constructor
Type parameters
- Actual
Parameters
actual: Answerable<Actual>
expectation: Expectation<Actual>
location: FileSystemLocation
optionaltimeout: Duration
Returns EnsureEventually<Actual>
Methods
timeoutAfter
Override the default timeout set via SerenityConfig.interactionTimeout.
Parameters
timeout: Duration
Returns EnsureEventually<Actual>
performAs
Parameters
actor: UsesAbilities & AnswersQuestions & CollectsArtifacts
Returns Promise<void>
otherwiseFailWith
Overrides the default AssertionError thrown when the actual value does not meet the expectation.
Parameters
typeOfRuntimeError: new (message: string, cause?: Error) => RuntimeError
A constructor function producing a subtype of RuntimeError to throw, e.g. TestCompromisedError
optionalmessage: string
The message explaining the failure
Returns Interaction
instantiationLocation
Returns the location where this Activity was instantiated.
Returns FileSystemLocation
toString
Generates a human-friendly description to be used when reporting this Activity.
Note: When this activity is reported, token
#actor
in the description will be replaced with the name of the actor performing this Activity.For example,
#actor clicks on a button
becomesWendy clicks on a button
.Returns string
The interaction to
EnsureEventually
verifies if the resolved value of the provided Answerable meets the specified Expectation within the expected timeframe.If the expectation is not met by the time the timeout expires, the interaction throws an AssertionError.
EnsureEventually
retries the evaluation if resolving theactual
results in an ListItemNotFoundError, but rethrows any other errors.Use the factory method Ensure.eventually to instantiate this interaction.
Basic usage with dynamic values
Composing expectations with
and
Overriding the type of Error thrown upon assertion failure