Skip to main content

externalKpiCard <NET>

Interaction object representing a Key Performance Indicator card displaying a metric with label, value, and subtitle.

KPI cards appear on the Dashboard view, presenting at-a-glance metrics like pass rate, total scenarios, and confidence score. Each card is clickable and navigates to a filtered view of the relevant data.

A KpiCard is not instantiated directly — it is obtained via a parent view's parameterised locator (e.g. dashboardView.kpiCardCalled('Pass Rate')).

Usage in a test

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

await actor.attemptsTo(
Ensure.that(passRateCard.label(), equals('PASS RATE')),
Ensure.that(passRateCard.value(), equals('93%')),
Ensure.that(passRateCard.subtitle(), includes('of 100 scenarios')),
Ensure.that(passRateCard.accessibleLabel(), includes('Pass Rate')),
);

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 metric name displayed on the card (e.g. 'PASS RATE', 'TOTAL SCENARIOS').

    Note: text-transform: uppercase in CSS means the rendered text is uppercase regardless of the source markup.

    Example

    await actor.attemptsTo(
    Ensure.that(kpiCard.label(), equals('PASS RATE')),
    );

    Returns QuestionAdapter<string>

externalvalue

  • The displayed metric value (e.g. '93%', '142', '87.5').

    Example

    await actor.attemptsTo(
    Ensure.that(kpiCard.value(), equals('93%')),
    );

    Returns QuestionAdapter<string>

externalsubtitle

  • Additional context displayed below the value (e.g. '93 of 100 scenarios passed').

    Example

    await actor.attemptsTo(
    Ensure.that(kpiCard.subtitle(), includes('of 100 scenarios')),
    );

    Returns QuestionAdapter<string>

externalaccessibleLabel

  • The aria-label attribute of the card's root element, providing an accessible description for assistive technology.

    Example

    await actor.attemptsTo(
    Ensure.that(kpiCard.accessibleLabel(), includes('Pass Rate: 93%')),
    );

    Returns QuestionAdapter<string>