Serenity-js: Masking sensitive data/information during test and on the report

Created on 29 Nov 2017  路  3Comments  路  Source: serenity-js/serenity-js

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!

documentation question

All 3 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

edupeeth picture edupeeth  路  7Comments

y3rsh picture y3rsh  路  4Comments

mrj04 picture mrj04  路  3Comments

rajeshwarp picture rajeshwarp  路  5Comments

GeeChao picture GeeChao  路  6Comments