Skip to main content

externalHistoryDots <NET>

Interaction object representing a strip of history dots showing the pass/fail pattern across recent test runs.

Each dot carries an outcome type (data-outcome attribute) and a tooltip title describing the run result. The strip provides a visual timeline of scenario stability, making it easy to spot flaky tests or recent regressions at a glance.

History dots appear on scenario rows in the Test Scenarios view and in the Scenario Detail view's execution history section.

Instantiation (within a parent interaction object)

import { HistoryDots } from '@serenity-js/html-reporter/serenity';
import { By } from '@serenity-js/web';

export class ScenarioItem<NET> extends InteractionObject<NET> {
readonly historyDots = new HistoryDots(this.child(By.css('[data-testid="history-dots"]')));
}

Usage in a test

await actor.attemptsTo(
Ensure.that(historyDots.count(), equals(5)),
Ensure.that(historyDots.outcomes().as(entries => entries[0].type), equals('SUCCESS')),
Ensure.that(historyDots.outcomes().as(entries => entries[4].type), equals('FAILURE')),
);

Hierarchy

Index

Constructors

externalconstructor

Methods

externalcount

  • The number of history dots in the strip.

    Corresponds to the number of historical runs available for this scenario.

    Example

    await actor.attemptsTo(
    Ensure.that(historyDots.count(), equals(5)),
    );

    Returns QuestionAdapter<number>

externaloutcomes

  • outcomes(): Question<Promise<HistoryDotEntry[]>>
  • A structured array of {type, title} entries for each dot, ordered from oldest to newest.

    Each entry's type is the data-outcome attribute value (e.g. 'SUCCESS', 'FAILURE', 'RETRIED_SUCCESS') and title is the tooltip text describing the run result.

    Example

    await actor.attemptsTo(
    Ensure.that(historyDots.outcomes().as(entries => entries[0].type), equals('SUCCESS')),
    Ensure.that(historyDots.outcomes().as(entries => entries[1].title), includes('Passed on retry')),
    );

    Returns Question<Promise<HistoryDotEntry[]>>

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>

Page Options