-
-
Notifications
You must be signed in to change notification settings - Fork 6
Hide or Remove test cases parameters in report
Alexandr D edited this page Apr 9, 2019
·
7 revisions
It is not always appropriate to show the value of all parameters in the report (for example, passwords).
So you can use the attribute [AllureHideParams]
relative to the test method, which takes as input the parameter numbers separated by commas, which should be hidden.
Example:
[AllureHideParams(2)]
public void LoginToApp(string login, string password)
{
// some code here
}
In this case, password parameter will be hidden in the report:
You can specify which parameters should be hidden, by using comma.
Example:
[AllureHideParams(1, 2)]
public void LoginToApp(string login, string password)
{
Pages.GetPage<AuthorizationPage>().LoginToApp(login, password);
}
In this case, login and password parameters will be hidden in the report:
If you want to delete parameter(s), use the attribute [AllureRemoveParams]
, as well as [AllureHideParam]
.
Example:
[AllureRemoveParams(2)]
public void LoginToApp(string login, string password)
{
Pages.GetPage<AuthorizationPage>().LoginToApp(login, password);
}
In this case, the password parameter will not be displayed in the report: