0

I am currently working on a Testing Automation team, using Python and Allure to make reports of all the test cases that we run. Sometimes we deal with sensible data (e.g: passwords) that I can't show on the reports. If I use a function with a step decorator, something like this:

example of the function that I need to tweak

Which takes an element (a text box) and enters the value in it. In the step function I display the value that I want to enter, I could easily change that but the problem resides in the actual report. No matter what I enter on the step title, the report always shows the info that was passed as arguments to the function:

Where the problem resides

Thus, the "value" argument will always be displayed and that is something that I cannot have on certain projects. Is there anyway to make a custom step function that solves my problem?. I could either use with not showing the value at all or to change it to something like '*****'.

Community
  • 1
  • 1

2 Answers2

0

Just a thought.

@allure.step("Entering a value in element {3}")
def setSecureBoxValue(driver, element, value, box_name):

supputuri
  • 13,644
  • 2
  • 21
  • 39
  • The problem with this approach is that, in the report, the string inside "value" will be shown as in the second picture after clicking on the green arrow (which shows the drop down menu). – Carlos Hernandez Perez Apr 07 '20 at 11:42
0

I solved my problem with the use of Fernet cryptography library.

I created a new function for the sensible data that encrypts the strings and then, inside this new function I call the one I shared on the screenshot (with a slight modification to decrypt the data). This results in the following report:

enter image description here