Skip to main content

externalDashboardView <NET>

Interaction object representing the Dashboard view in the HTML report.

The Dashboard is the landing page that provides a high-level overview of test health. It shows KPI cards (pass rate, total tests, confidence score), a trend chart of historical results, a consistency summary highlighting flaky/degraded tests, and the slowest test scenarios.

Composes child interaction objects (DashboardKpiCard, ConsistencyItem) for individual widgets within the view.

Instantiation

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

const dashboardView = new DashboardView(
PageElement.located(By.css('[data-testid="dashboard"]')).describedAs('dashboard view'),
new Navigation(),
);

Usage in an integration test

await actor.attemptsTo(
dashboardView.open(),
Ensure.that(dashboardView.kpiCardCalled('Pass Rate').value(), includes('75')),
Ensure.that(dashboardView.consistencyCardScenarioNames(), contain('Flaky Test')),
Ensure.that(dashboardView.hasTrendChart(), equals(true)),
);

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>

externalkpiCardAt

  • Returns the DashboardKpiCard at the given zero-based index.

    Example

    Ensure.that(dashboardView.kpiCardAt(0).label(), equals('PASS RATE'))

    Parameters

    • externalindex: number

      Zero-based position of the KPI card

    Returns DashboardKpiCard<NET>

externalkpiCardCalled

  • Locates a DashboardKpiCard by its label text and returns an interaction object for inspecting its value, subtitle, or navigating to its detail view.

    Uses case-insensitive substring matching against the card's .kpi-label text.

    Example

    const passRateCard = dashboardView.kpiCardCalled('Pass Rate');

    await actor.attemptsTo(
    Ensure.that(passRateCard.value(), equals('93%')),
    Ensure.that(passRateCard.subtitle(), includes('of 42 scenarios')),
    passRateCard.viewDetails(),
    );

    Parameters

    • externallabel: string

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

    Returns DashboardKpiCard<NET>

externalconsistencyCardScenarioNames

  • consistencyCardScenarioNames(): Question<Promise<string[]>>
  • The display names of all scenarios listed in the consistency summary card.

    Example

    Ensure.that(dashboardView.consistencyCardScenarioNames(), contain('Flaky Test A'))

    Returns Question<Promise<string[]>>

externalconsistencyItemHistoryOutcomes

  • consistencyItemHistoryOutcomes(scenarioName: string): Question<Promise<string[]>>
  • The history dot outcomes for a specific scenario in the consistency card.

    Returns an array of data-outcome attribute values (e.g. 'SUCCESS', 'FAILURE', 'RETRIED_SUCCESS') representing the scenario's execution history across recent runs.

    Example

    Ensure.that(
    dashboardView.consistencyItemHistoryOutcomes('Flaky Test'),
    equals(['SUCCESS', 'FAILURE', 'RETRIED_SUCCESS']),
    )

    Parameters

    • externalscenarioName: string

      Substring to match against consistency item scenario names

    Returns Question<Promise<string[]>>

externalconsistencyItemCalled

  • consistencyItemCalled(scenarioName: string): ConsistencyItem<NET>
  • Locates a ConsistencyItem by scenario name within the consistency summary card.

    Example

    await actor.attemptsTo(
    dashboardView.consistencyItemCalled('Flaky Test').viewDetails(),
    );

    Parameters

    • externalscenarioName: string

      Substring to match against consistency item scenario names

    Returns ConsistencyItem<NET>

externalslowestTestNames

  • slowestTestNames(): Question<Promise<string[]>>
  • The display names of all scenarios listed in the "slowest tests" card.

    Example

    Ensure.that(dashboardView.slowestTestNames(), contain('Login should handle timeout'))

    Returns Question<Promise<string[]>>

externalhasTrendChart

  • hasTrendChart(): Question<Promise<boolean>>
  • Whether the trend chart canvas element is present in the dashboard.

    The trend chart only renders when historical run data is available.

    Example

    Ensure.that(dashboardView.hasTrendChart(), equals(true))

    Returns Question<Promise<boolean>>

externalhasDetailsPanel

  • hasDetailsPanel(): Question<Promise<boolean>>
  • Whether the chart details panel (run details overlay) is visible.

    Example

    Ensure.that(dashboardView.hasDetailsPanel(), equals(false))

    Returns Question<Promise<boolean>>

externalopen

  • Navigates to the Dashboard view via the sidebar navigation.

    Example

    await actor.attemptsTo(
    dashboardView.open(),
    Ensure.that(dashboardView.kpiCardCalled('Pass Rate').value(), includes('93')),
    );

    Returns Task