Communicates progress through the ordered steps of a wizard or multi-step flow.

Usage

import { PlumaTestHelpers } from '@customerio/pluma-components/react/test-helpers/pluma-test-helpers';

const stepper = PlumaTestHelpers.find('Stepper');

// Read across every step.
stepper.getStepCount();
stepper.getStepLabels();
stepper.getCurrentStepLabel();

// Drill into a single step (by label or index) for its detailed state.
const step = stepper.getStep('Content'); // or stepper.getStepAt(2)
step?.getStatus();
step?.isCurrent();
step?.isComplete();
step?.isDisabled();
step?.getHref();

// The two attention statuses, and the text each announces to assistive
// technology ('has errors' / 'needs attention'; empty for the statuses that
// announce nothing).
step?.isCritical();
step?.isCaution();
step?.getStatusAnnouncement();

// Navigate. Both throw rather than no-op — on a missing label, and on a step
// that is disabled or has neither an href nor an onClick.
await stepper.clickStep('Content');
await step?.click();

Test Helpers

Clicks the step with the label. Throws when no step carries it, naming the labels that are present.

Gets a scoped test helper for the current step, if any.

Gets the label of the current step, if any.

Gets a scoped test helper for a step by label.

Gets a scoped test helper for a step by zero-based index.

Gets the number of steps.

Gets the label of each step.

Gets a scoped test helper for each step.

Checks if a step with the label exists.

On this page