Skip to main content

externalTimelineView <NET>

Interaction object representing the Timeline view in the HTML report.

Visualises execution timing across scenarios, showing when each test started and how long it took. Includes KPI cards summarising timing metrics and filter chips to focus on specific outcome types.

Composes child interaction objects (FilterBar, KpiCard) for individual UI widgets.

On mobile viewports, filter controls live inside a bottom sheet. The same selectFilter() method works regardless of viewport size when the { mobile: true } option is set.

Instantiation

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

const timelineView = new TimelineView(
PageElement.located(By.css('[data-testid="timeline"]')).describedAs('timeline view'),
new Navigation(),
);

Usage in an integration test

await actor.attemptsTo(
timelineView.open(),
Ensure.that(timelineView.scenarioCount(), isGreaterThan(0)),
timelineView.selectFilter('Failed'),
Ensure.that(timelineView.activeFilters(), equals(['Failed'])),
);

Hierarchy

Index

Constructors

externalconstructor

Properties

externalreadonlyfilterBar

filterBar: FilterBar<NET> = ...

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>

externalkpiCardAt

  • kpiCardAt(index: number): KpiCard<NET>
  • Returns the KpiCard at the given zero-based index.

    Example

    Ensure.that(timelineView.kpiCardAt(0).value(), includes('42'))

    Parameters

    • externalindex: number

      Zero-based position of the KPI card

    Returns KpiCard<NET>

externalkpiCardCalled

  • kpiCardCalled(label: string): KpiCard<NET>
  • Locates a KpiCard by its label text.

    Example

    Ensure.that(timelineView.kpiCardCalled('Total Duration').value(), includes('5m'))

    Parameters

    • externallabel: string

      Substring to match against KPI card labels (case-insensitive)

    Returns KpiCard<NET>

externalactiveFilters

  • activeFilters(): Question<Promise<string[]>>
  • The labels of the currently active (pressed) filter chips.

    Example

    await actor.attemptsTo(
    timelineView.selectFilter('Failed'),
    Ensure.that(timelineView.activeFilters(), equals(['Failed'])),
    );

    Returns Question<Promise<string[]>>

externalscenarioCount

  • scenarioCount(): Question<Promise<number>>
  • The number of timeline rows currently visible.

    Example

    Ensure.that(timelineView.scenarioCount(), equals(42))

    Returns Question<Promise<number>>

externalselectFilter

  • Activates a filter chip by label (e.g. 'Failed', 'Passed').

    On mobile viewports, opens the bottom sheet to access filters.

    Example

    await actor.attemptsTo(
    timelineView.selectFilter('Failed'),
    Ensure.that(timelineView.scenarioCount(), equals(5)),
    );

    Parameters

    • externallabel: Answerable<string>

      The filter chip label to activate

    Returns Task

externalopen

  • Navigates to the Timeline view via the sidebar navigation.

    Example

    await actor.attemptsTo(
    timelineView.open(),
    Ensure.that(timelineView.scenarioCount(), isGreaterThan(0)),
    );

    Returns Task