Skip to main content

Masked

This question masks sensitive data handled by the actors and prevents it from being shown in Serenity/JS reports and console logs. You should use it to wrap passwords, secret tokens, phone numbers, credit card numbers, or any other personally identifiable information (PII). However, even though the wrapped value is masked in the output, you can still retrieve the unmasked value by making the actor answer the question in your custom interactions.

Index

Constructors

Methods

Constructors

constructor

Methods

staticvalueOf

  • Retrieves the value of a sensitive parameter and mask it in any report.

    Example

    import { actorCalled, Masked } from '@serenity-js/core';
    import { Ensure, equals } from '@serenity-js/assertions';

    await actorCalled('John')
    .attemptsTo(
    Enter.theValue(Masked.valueOf('your little secret')).into(Form.exampleInput())
    );

    Parameters

    Returns QuestionAdapter<string>

    A QuestionAdapter representing the masked value.