Skip to main content

externalConsistencyView <NET>

Interaction object representing the Consistency view in the HTML report.

Identifies tests with inconsistent execution patterns: flaky tests (pass only via retry), degraded tests (newly broken), inconsistent tests (retry masking deeper problems), and recovered tests (previously broken, now passing cleanly). Each scenario row shows a history dot strip visualising its outcome across recent runs.

Composes child interaction objects (SearchInput, FilterBar, ResultCount, HistoryDots) for individual UI widgets.

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

Instantiation

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

const consistencyView = new ConsistencyView(
PageElement.located(By.css('[data-testid="consistency"]')).describedAs('consistency view'),
new Navigation(),
);

Usage in an integration test

await actor.attemptsTo(
consistencyView.open(),
consistencyView.selectFilter('Flaky'),
Ensure.that(consistencyView.scenarioCount(), isGreaterThan(0)),
Ensure.that(consistencyView.scenarioNames(), contain('Flaky Test A')),
);

Hierarchy

Index

Constructors

externalconstructor

Properties

externalreadonlysearchInput

searchInput: SearchInput<NET> = ...

externalreadonlyfilterBar

filterBar: FilterBar<NET> = ...

externalreadonlyresultCount

resultCount: ResultCount<NET> = ...

externalreadonlyhistoryDots

historyDots: HistoryDots<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>

externaloutcomeBadgeFor

  • Returns an OutcomeBadge interaction object for the given scenario item element.

    Example

    const badge = consistencyView.outcomeBadgeFor(scenarioElement);

    Parameters

    Returns OutcomeBadge<NET>

externalscenarioCount

  • scenarioCount(): Question<Promise<number>>
  • The number of scenario rows currently visible in the consistency list.

    Reflects the current filter and search state.

    Example

    await actor.attemptsTo(
    consistencyView.selectFilter('Flaky'),
    Ensure.that(consistencyView.scenarioCount(), equals(3)),
    );

    Returns Question<Promise<number>>

externalscenarioCalled

  • Locates a scenario by name and returns a ScenarioItem interaction object for inspecting its state.

    Example

    Ensure.that(consistencyView.scenarioCalled('Flaky Test').outcome(), equals('RETRIED_SUCCESS'))

    Parameters

    • externalname: string

      Substring to match against scenario names

    Returns ScenarioItem<NET>

externalscenarioNames

  • scenarioNames(): Question<Promise<string[]>>
  • The display names of all currently visible scenarios in the consistency list.

    Example

    Ensure.that(consistencyView.scenarioNames(), contain('Flaky Test A'))

    Returns Question<Promise<string[]>>

externalbodyText

  • The full body text of the consistency view.

    Useful for checking empty states or overall content.

    Example

    Ensure.that(consistencyView.bodyText(), includes('No inconsistent tests'))

    Returns QuestionAdapter<string>

externalfind

  • Searches for scenarios by entering text into the search input.

    On mobile viewports, opens the bottom sheet to access the search input.

    Example

    await actor.attemptsTo(
    consistencyView.find('checkout'),
    Ensure.that(consistencyView.scenarioCount(), equals(1)),
    );

    Parameters

    • externalsearchTerm: Answerable<string>

      Text to search for (matches scenario names)

    Returns Task

externalselectFilter

  • Activates a filter chip by label (e.g. 'Flaky', 'Degraded', 'Recovered').

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

    Example

    await actor.attemptsTo(
    consistencyView.selectFilter('Flaky'),
    Ensure.that(consistencyView.scenarioCount(), equals(3)),
    );

    Parameters

    • externallabel: Answerable<string>

      The filter chip label to activate

    Returns Task

externalopen

  • Navigates to the Consistency view via the sidebar navigation.

    Example

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

    Returns Task