Skip to main content

externalResultCount <NET>

Simple interaction object representing the displayed result count (e.g. '7 of 23 scenarios').

Unlike most interaction objects in the HTML reporter, ResultCount does not extend InteractionObject — it takes a root element directly and provides a single Question for reading the count text.

A ResultCount is composed into views like ScenariosView and is typically accessed via the parent view's resultCount field or resultCountText() method.

Instantiation (within a parent interaction object)

import { ResultCount } from '@serenity-js/html-reporter/serenity';
import { By } from '@serenity-js/web';

export class MyView<NET> extends InteractionObject<NET> {
readonly resultCount = new ResultCount(this.child(By.css('[data-testid="result-count"]')));
}

Usage in a test

await actor.attemptsTo(
Ensure.that(scenariosView.resultCount.text(), includes('7 of 23')),
);

Index

Constructors

Methods

Constructors

externalconstructor

Methods

externaltext

  • The displayed result count text (e.g. '7 of 23 scenarios', '3 results').

    Reflects the current filter and search state of the parent view.

    Example

    await actor.attemptsTo(
    Ensure.that(resultCount.text(), includes('7 of 23')),
    );

    Returns QuestionAdapter<string>

Page Options