Skip to main content

externalScenarioDetailView <NET>

Interaction object representing the Scenario Detail view in the HTML report.

Shows the full details of a single test scenario: its activity tree, error block, screenshots (photo strip), execution history dots, retry attempt tabs, and video evidence when available. Composes ErrorBlock and ActivityItem interaction objects for specific sections.

Instantiation

import { ScenarioDetailView, Navigation } from '@serenity-js/html-reporter/serenity';
import { By, PageElement } from '@serenity-js/web';

const scenarioDetailView = new ScenarioDetailView(
PageElement.located(By.css('[data-testid="scenario-detail"]')).describedAs('scenario detail view'),
new Navigation(),
);

Usage in an integration test

await actor.attemptsTo(
scenariosView.scenarioCalled(failingTest).viewDetails(),
Ensure.that(scenarioDetailView.scenarioName(), includes('Payment should reject')),
Ensure.that(scenarioDetailView.hasError(), equals(true)),
Ensure.that(scenarioDetailView.errorBlock().name(), equals('AssertionError')),
Ensure.that(scenarioDetailView.activityCalled('clicks submit').outcome(), equals('FAILURE')),
Ensure.that(scenarioDetailView.photoStripCount(), isGreaterThan(0)),
);

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>

externalscenarioName

  • The scenario's display name in the detail view header.

    Example

    Ensure.that(scenarioDetailView.scenarioName(), includes('Payment should reject'))

    Returns QuestionAdapter<string>

externalsourcePath

  • The scenario's source file path and line number (e.g. 'checkout.spec.ts:42').

    Example

    Ensure.that(scenarioDetailView.sourcePath(), includes('checkout.spec.ts'))

    Returns QuestionAdapter<string>

externalerrorBlock

  • Returns an ErrorBlock interaction object for inspecting the error details.

    Example

    const errorBlock = scenarioDetailView.errorBlock();

    await actor.attemptsTo(
    Ensure.that(errorBlock.name(), equals('TimeoutError')),
    Ensure.that(errorBlock.message(), includes('waiting for selector')),
    );

    Returns ErrorBlock<NET>

externalhasError

  • Whether the error block element is present in the detail view.

    Example

    Ensure.that(scenarioDetailView.hasError(), equals(true))

    Returns Question<Promise<boolean>>

externalhasCopySourceButton

  • hasCopySourceButton(): Question<Promise<boolean>>
  • Whether the copy source location button is present.

    Example

    Ensure.that(scenarioDetailView.hasCopySourceButton(), equals(true))

    Returns Question<Promise<boolean>>

externalbreadcrumbText

  • The breadcrumb navigation text in the detail view header.

    Example

    Ensure.that(scenarioDetailView.breadcrumbText(), includes('Test Scenarios'))

    Returns QuestionAdapter<string>

externalactivityCalled

  • Locates an ActivityItem by name within the activity tree.

    Uses PEQL substring matching — the name doesn't need to be an exact match.

    Example

    const activity = scenarioDetailView.activityCalled('clicks submit');

    await actor.attemptsTo(
    Ensure.that(activity.outcome(), equals('FAILURE')),
    );

    Parameters

    • externalname: string

      Substring to match against activity names in the tree

    Returns ActivityItem<NET>

externalexecutionHistoryDotCount

  • executionHistoryDotCount(): Question<Promise<number>>
  • The number of execution history dots displayed.

    Each dot represents one historical run of this scenario.

    Example

    Ensure.that(scenarioDetailView.executionHistoryDotCount(), isGreaterThan(0))

    Returns Question<Promise<number>>

externalphotoStripCount

  • The number of photo strip thumbnails displayed.

    Example

    Ensure.that(scenarioDetailView.photoStripCount(), equals(3))

    Returns QuestionAdapter<number>

externalretryTabCount

  • retryTabCount(): Question<Promise<number>>
  • The number of retry attempt tabs displayed.

    Only present when the scenario was retried.

    Example

    Ensure.that(scenarioDetailView.retryTabCount(), equals(2))

    Returns Question<Promise<number>>

externalactiveAttemptLabel

  • The label text of the currently active retry attempt tab (e.g. 'Attempt 2').

    Example

    Ensure.that(scenarioDetailView.activeAttemptLabel(), equals('Attempt 2'))

    Returns QuestionAdapter<string>

externalvideoSource

  • The src attribute of the embedded video's <source> element.

    Example

    Ensure.that(scenarioDetailView.videoSource(), includes('.webm'))

    Returns QuestionAdapter<string>

externalhasVideo

  • Whether a video element is present in the detail view.

    Example

    Ensure.that(scenarioDetailView.hasVideo(), equals(true))

    Returns Question<Promise<boolean>>

externalmetaText

  • The metadata text below the scenario title (duration, tags, etc.).

    Example

    Ensure.that(scenarioDetailView.metaText(), includes('2.4s'))

    Returns QuestionAdapter<string>

externalactivityTreeText

  • The full text content of the activity tree section.

    Example

    Ensure.that(scenarioDetailView.activityTreeText(), includes('clicks on'))

    Returns QuestionAdapter<string>

externalfirstRetryTabLabel

  • The label text of the first retry tab.

    Example

    Ensure.that(scenarioDetailView.firstRetryTabLabel(), equals('Attempt 1'))

    Returns QuestionAdapter<string>

externallastRetryTabLabel

  • The label text of the last retry tab.

    Example

    Ensure.that(scenarioDetailView.lastRetryTabLabel(), equals('Attempt 3'))

    Returns QuestionAdapter<string>

externalcopySourceLocation

  • copySourceLocation(): Task
  • Clicks the copy source location button.

    Example

    await actor.attemptsTo(
    scenarioDetailView.copySourceLocation(),
    );

    Returns Task

externalopenPhotoAt

  • openPhotoAt(index: number): Task
  • Opens the photo lightbox by clicking a thumbnail at the given index.

    Example

    await actor.attemptsTo(
    scenarioDetailView.openPhotoAt(0),
    );

    Parameters

    • externalindex: number

      Zero-based index of the photo thumbnail to click

    Returns Task

externalswitchToAttempt

  • switchToAttempt(attemptNumber: number): Task
  • Switches to a retry attempt tab by its number.

    Example

    await actor.attemptsTo(
    scenarioDetailView.switchToAttempt(2),
    Ensure.that(scenarioDetailView.activeAttemptLabel(), equals('Attempt 2')),
    );

    Parameters

    • externalattemptNumber: number

      The attempt number (1-based) to switch to

    Returns Task

externalopen

  • Navigates to the Scenario Detail view via the sidebar navigation.

    Note: in most tests you navigate to the detail view via ScenarioItem.viewDetails rather than calling open() directly.

    Example

    await actor.attemptsTo(
    scenarioDetailView.open(),
    );

    Returns Task