Skip to main content

externalErrorsView <NET>

Interaction object representing the Errors view in the HTML report.

Groups test failures by root cause (error fingerprint), making it easy to identify the most common failure modes. Shows KPI cards summarising error categories, searchable error groups, and individual affected scenarios within each group.

Composes child interaction objects (SearchInput, ResultCount, KpiCard) that handle individual UI widgets.

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

Instantiation

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

const errorsView = new ErrorsView(
PageElement.located(By.css('[data-testid="errors"]')).describedAs('errors view'),
new Navigation(),
);

Usage in an integration test

await actor.attemptsTo(
errorsView.open(),
Ensure.that(errorsView.errorGroupCount(), isGreaterThan(0)),
errorsView.find('timeout'),
errorsView.clickErrorGroupContaining('TimeoutError'),
Ensure.that(errorsView.scenarioNames(), contain('Login should handle timeout')),
);

Hierarchy

Index

Constructors

externalconstructor

Properties

externalreadonlysearchInput

searchInput: SearchInput<NET> = ...

externalreadonlyresultCount

resultCount: ResultCount<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>

externalopenStatsSheet

  • openStatsSheet(): Task
  • Opens the error statistics bottom sheet (mobile viewport).

    Only triggers if the stats sheet trigger button is visible.

    Example

    await actor.attemptsTo(
    errorsView.openStatsSheet(),
    Ensure.that(errorsView.kpiCardCalled('Unique Errors').value(), equals('3')),
    );

    Returns Task

externalcloseStatsSheet

  • closeStatsSheet(): Task
  • Closes the error statistics bottom sheet (mobile viewport).

    Only triggers if the close button is visible.

    Example

    await actor.attemptsTo(
    errorsView.closeStatsSheet(),
    );

    Returns Task

externalkpiCardAt

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

    Example

    Ensure.that(errorsView.kpiCardAt(0).value(), equals('5'))

    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 in the error statistics panel.

    On mobile viewports, locates the card inside the stats bottom sheet.

    Example

    await actor.attemptsTo(
    Ensure.that(errorsView.kpiCardCalled('Unique Errors').value(), equals('3')),
    );

    Parameters

    • externallabel: string

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

    Returns KpiCard<NET>

externalscenarioCalled

  • Locates a scenario by name within the error group list and returns a ScenarioItem interaction object for inspecting its state.

    Example

    Ensure.that(errorsView.scenarioCalled('Login timeout').outcome(), equals('FAILURE'))

    Parameters

    • externalname: string

      Substring to match against scenario names

    Returns ScenarioItem<NET>

externalerrorGroupTextFor

  • The full rendered text of the error group row containing the given scenario name.

    Example

    Ensure.that(errorsView.errorGroupTextFor('timeout'), includes('TimeoutError'))

    Parameters

    • externalname: string

      Substring to match against scenario names within error groups

    Returns QuestionAdapter<string>

externalscenarioNames

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

    Example

    Ensure.that(errorsView.scenarioNames(), contain('Login should handle timeout'))

    Returns Question<Promise<string[]>>

externalbodyText

  • The full body text of the errors view.

    Example

    Ensure.that(errorsView.bodyText(), includes('No errors'))

    Returns QuestionAdapter<string>

externalerrorGroupCount

  • The number of error groups currently displayed.

    Example

    Ensure.that(errorsView.errorGroupCount(), equals(3))

    Returns QuestionAdapter<number>

externalfind

  • Searches for error groups by entering text into the search input.

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

    Example

    await actor.attemptsTo(
    errorsView.find('timeout'),
    Ensure.that(errorsView.errorGroupCount(), equals(1)),
    );

    Parameters

    • externalsearchTerm: Answerable<string>

      Text to search for (matches error messages and scenario names)

    Returns Task

externalresultCountText

  • The displayed result count text (e.g. '3 of 5 error groups').

    Example

    Ensure.that(errorsView.resultCountText(), includes('3 of 5'))

    Returns QuestionAdapter<string>

externalclickFirstErrorGroup

  • clickFirstErrorGroup(): Task
  • Clicks the first error group in the list to expand it or navigate to its details.

    Example

    await actor.attemptsTo(
    errorsView.clickFirstErrorGroup(),
    );

    Returns Task

externalclickErrorGroupContaining

  • Clicks the error group whose text contains the given substring.

    Example

    await actor.attemptsTo(
    errorsView.clickErrorGroupContaining('TimeoutError'),
    );

    Parameters

    • externaltext: Answerable<string>

      Substring to match within the error group's rendered text

    Returns Task

externalopen

  • Navigates to the Errors view via the sidebar navigation.

    Example

    await actor.attemptsTo(
    errorsView.open(),
    Ensure.that(errorsView.errorGroupCount(), isGreaterThan(0)),
    );

    Returns Task