Custom fields
Custom fields are arbitrary key-value pairs that can be assigned to test cases. Similar to a tag, the actual meaning of a custom field is project-specific.
The general purpose of custom fields is to help filter and group test cases. You can use them:
- to group test cases by specific values in custom trees,
- to search for test cases using filters,
- to filter test cases via AQL (e.g., when creating test plans).
To start using a new custom field:
- As an administrator, declare the custom field.
- As an administrator or a project owner, add the custom field to the project.
- As a project owner or a test author, edit values for test cases manually or automatically.
System fields
To each project in Allure TestOps, some system fields are added automatically. This includes:
- Epic, Feature, Story — used by default for the “Features” tree,
- Suite — used by default for the “Suites” tree,
- Component — not used by default but often used for custom trees or filters.
The system fields cannot be removed from a project. You can, however, add or remove mappings for any field, see Setting custom fields automatically.
The labels in the default mappings for Epic, Feature, Story, and Suite match the labels generated by the standard functions in most Allure adapters.
Declaring custom fields
Before a custom field can be added to individual projects, it must be declared globally by an Allure TestOps instance administrator. At this point, only the human-readable name of the field is being determined.
To declare a new custom field:
- Click on your avatar and go to Administration.
- Select the Custom Fields tab.
- Click New field.
- Enter a human-readable name for the new field and click Create.
To rename or remove an existing custom field, use the icons in the top right corner.
Adding custom fields to a project
Once you have declared a custom field in the Allure TestOps instance, you need to add it to your project to start using it. This can be done either from the administration panel by an administrator or from the project settings by the project owner.
- Click on your avatar and go to Administration.
- Select the Custom Fields tab.
- Select the field you want to add to a project.
- Click Add to projects.
- In the dialog that appears, select the projects for which the field should be available, then click Add.
- Optionally, click the three dots icon next to the project name and switch on the Required field toggle.
- Go to the project settings.
- Select Custom Fields.
- Click Add field.
- In the dialog that appears, select the custom fields that should be available for the project, then click Add.
- Optionally, click the three dots icon in the upper-right corner of the screen and switch on the Required field toggle.
The Required field option means that a user is expected to provide a value for the custom field in every test case. In the test case details, a required field is always visible. If no value is assigned, it will display the red “No values” caption.
Setting custom field values
Allure TestOps provides three ways of setting the values for a test case's custom fields:
- set values manually for one test case (supported for the manual QA; can be enabled for the automation QA),
- set values manually for multiple test cases (supported for both the manual QA and the automation QA),
- set values automatically (supported for the automation QA only).
Set values manually for one test case
Go to the Test cases section of your project.
Select a test case.
On the right side of the page, next to Fields, click the pencil icon.
In the dialog that appears, edit the table of custom field values.
In each row, the Custom Field must be a field name previously added to the project, and Value can contain one or more arbitrary text values.
Click Submit to save the changes.
Set values manually for multiple test cases
To add custom field values to all selected test cases:
Go to the Test cases section of your project.
Use the checkboxes to select multiple test cases.
Click the Bulk actions button and select Add value to custom fields.
In the dialog that appears, choose one or more custom fields. Specify one or more values for each of them. Click Add.
Allure TestOps will add the specified values to each selected test case. Existing values will not be affected.
To remove certain custom field values from all selected test cases:
Go to the Test cases section of your project.
Use the checkboxes to select multiple test cases.
Click the Bulk actions button and select Remove value to custom fields.
In the dialog that appears, the custom fields will be shown, with a combined list of values for each of them. Click the close icon next to the values that you want to remove. Click Submit.
Allure TestOps will remove the specified values from each selected test case where they were present. Other values will not be affected.
Set values automatically
Go to the project settings.
Go to the Custom Fields section.
Select the custom field that should be loaded from test results.
Click New mapping.
In the dialog that appears, enter the name of the label and click Create.
In your test code, use the specified label name to set the values.
The example is written in Java.
@Test public void testAuthentication() { Allure.label("component", "Core"); Allure.label("version", "1.23"); // ... }
Depending on the language and framework you use, there can be multiple ways to define labels for your test cases. See your Allure adapter's reference for more details.
The example shows a part of a test result file that will be generated when running the test. After uploading the test results, Allure TestOps will use the values from this file.
"labels": [ { "name": "component", "value": "Core" }, { "name": "version", "value": "1.23" } ],
For more details on the file format, see the Allure Report documentation.
Once the mapping is configured and the code is updated where necessary, make sure to run a new launch and close it to apply the changes.