Hello! Is there a way in SerenityJS to replace entered data on report to "*" or any symbols? I need to use it to test transactions that simulates entering credit card information or when someone is trying to enter username and password on the login page. Thanks!
Hey @marktigno! I'd create a custom interaction for that.
For example, the built-in Enter interaction works as follows (more or less):
const Enter = (value: string, target: Target) => Interaction.where(
`#actor enters ${value} into ${target}`,
actor => BrowseTheWeb.as(actor).locate(this.target).sendKeys(this.value)
)
This, however, prints the entered value in the report.
You'd need something along the lines of:
const EnterCreditCardNumber = (value: string, target: Target) => Interaction.where(
`#actor enters XXXX XXXX XXXX XXXX into ${target}`,
actor => BrowseTheWeb.as(actor).locate(this.target).sendKeys(this.value)
)
Let me know if that helps!
Jan
Hello @jan-molak! This is awesome, I never thought about this, I'll try to implement it on my end here. How about on the screenshot? Thanks! ^_^
Hi Jan,
I need to apply this in application to test whether my password field values are masked or not please help me to write in serenity typescript>>>
regards,sowmya