Skip to main content

externalErrorBlock <NET>

Interaction object representing an error display block in the scenario detail view.

Shows the error name (type), message, and stack trace for a failed scenario. Obtained via ScenarioDetailView.errorBlock — not instantiated directly in tests.

const errorBlock = scenarioDetailView.errorBlock();

Usage in a test

await actor.attemptsTo(
Ensure.that(scenarioDetailView.hasError(), equals(true)),
Ensure.that(scenarioDetailView.errorBlock().name(), equals('AssertionError')),
Ensure.that(scenarioDetailView.errorBlock().message(), includes('expected true to equal false')),
Ensure.that(scenarioDetailView.errorBlock().stackTrace(), includes('checkout.spec.ts')),
);

Hierarchy

Index

Constructors

externalconstructor

Methods

externalisPresent

  • Checks whether the interaction object's root element is present in the DOM.

    Since InteractionObject implements Optional, you can assert on presence directly:

    Ensure.that(view, isPresent())

    Returns Answerable<boolean>

externalname

  • The error type/class name (e.g. 'AssertionError', 'TimeoutError').

    Example

    Ensure.that(errorBlock.name(), equals('AssertionError'))

    Returns QuestionAdapter<string>

externalmessage

  • The error message text.

    Example

    Ensure.that(errorBlock.message(), includes('expected true to equal false'))

    Returns QuestionAdapter<string>

externalstackTrace

  • The full stack trace text rendered in the error block.

    Example

    Ensure.that(errorBlock.stackTrace(), includes('checkout.spec.ts:42'))

    Returns QuestionAdapter<string>

externalhasLocation

  • hasLocation(): Question<Promise<boolean>>
  • Whether the error block displays a source location with a copy affordance.

    Example

    Ensure.that(errorBlock.hasLocation(), equals(true))

    Returns Question<Promise<boolean>>