Skip to main content

externalDashboardKpiCard <NET>

Interaction object representing a single clickable KPI card on the DashboardView.

Each card displays a metric label, a primary value, and an optional subtitle. Clicking a card navigates to the relevant filtered view (e.g., clicking "Pass Rate" opens the Test Scenarios view filtered to passing tests).

A DashboardKpiCard is not instantiated directly — it is obtained via DashboardView.kpiCardCalled or DashboardView.kpiCardAt:

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

Usage in a test

await actor.attemptsTo(
dashboardView.open(),
Ensure.that(dashboardView.kpiCardCalled('Pass Rate').value(), equals('93%')),
Ensure.that(dashboardView.kpiCardCalled('Pass Rate').subtitle(), includes('of 42 scenarios')),
dashboardView.kpiCardCalled('Pass Rate').viewDetails(),
);

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>

externallabel

  • The KPI card's label text (e.g. 'PASS RATE', 'TOTAL TESTS').

    Note: labels render in uppercase via CSS text-transform — comparison values must match the rendered case.

    Example

    Ensure.that(kpiCard.label(), equals('PASS RATE'))

    Returns QuestionAdapter<string>

externalvalue

  • The KPI card's primary value (e.g. '93%', '42').

    Example

    Ensure.that(dashboardView.kpiCardCalled('Pass Rate').value(), equals('93%'))

    Returns QuestionAdapter<string>

externalsubtitle

  • The KPI card's subtitle text (e.g. '39 of 42 scenarios passed').

    Example

    Ensure.that(dashboardView.kpiCardCalled('Pass Rate').subtitle(), includes('of 42 scenarios'))

    Returns QuestionAdapter<string>

externalaccessibleLabel

  • The KPI card's aria-label attribute, providing full context for screen readers.

    Example

    Ensure.that(kpiCard.accessibleLabel(), includes('Pass Rate: 93%'))

    Returns QuestionAdapter<string>

externalviewDetails

  • Clicks the KPI card to navigate to its associated detail view.

    Example

    await actor.attemptsTo(
    dashboardView.kpiCardCalled('Failed').viewDetails(),
    Ensure.that(scenariosView.scenarioCount(), isGreaterThan(0)),
    );

    Returns Task