Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create a custom Allure step function for sensible data #481

Open
1 of 3 tasks
CarlosHernandezP opened this issue Mar 30, 2020 · 2 comments
Open
1 of 3 tasks
Labels
task:new feature Requesting new capability or software feature theme:core

Comments

@CarlosHernandezP
Copy link

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

With a step decorator like this:
imagen

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 No matter what I enter on the step title, the report always shows the info that was passed as arguments to the function.

My report looks like the following image:
imagen

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

Not a bug

What is the expected behavior?

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

What is the motivation / use case for changing the behavior?

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 directly on the reports due to data protection policies.

Please tell us about your environment:

  • Allure version: 2.13.0
  • Test framework: pytest@3.6.1
  • Allure adaptor: pytest-allure-adaptor@1.7.10

Other information

@ric79
Copy link

ric79 commented Apr 8, 2020

Hello, I use in my tests the Ansible way.
All passwords are encrypted in my inventory in SHA256 with decode_pass.

Before starting the tests, just set an environment var (decode_pass).

During tests, the functions receive the encrypted vars and then they use os.environ["decode_pass"] in order to decrypt.

@CarlosHernandezP
Copy link
Author

Even thought I did not use @ric79 specific answer it did give me the idea to use the 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. This results in the following report:

image

Which solves my privacy issues. Thank you @ric79

@delatrie delatrie added theme:core task:new feature Requesting new capability or software feature labels Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task:new feature Requesting new capability or software feature theme:core
Projects
None yet
Development

No branches or pull requests

3 participants