Masked
Index
Constructors
Methods
Constructors
constructor
Returns Masked
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
parameter: Answerable<string>
An Answerable representing the masked value.
Returns QuestionAdapter<string>
A QuestionAdapter representing the masked value.
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.