Appearance
Allure Newman reference
When collecting data for a test report, the Allure Newman adapter analyzes the Newman's native metadata, as well as special commands found in the JavaScript comments.
Note that the values in such commands cannot contain spaces.
Metadata
Assign a test's description, links and other metadata.
Description
If a Postman request has documentation, it will be used as the test's description in Allure Report.
Owner
// @allure.label.owner=⟨VALUE⟩
Set the test's owner.
js
// @allure.label.owner=JohnDoe
pm.test("Test Authentication", function () {
// ...
});
Tag
// @allure.label.tag=⟨VALUE⟩
Set the test's tags.
js
// @allure.label.tag=WebInterface
// @allure.label.tag=Authentication
pm.test("Test Authentication", function () {
// ...
});
Severity
// @allure.label.severity=⟨VALUE⟩
Set the test's severity.
Allowed values are: “trivial”, “minor”, “normal”, “critical”, and “blocker”.
js
// @allure.label.severity=critical
pm.test("Test Authentication", function () {
// ...
});
Label
// @allure.label.⟨NAME⟩=⟨VALUE⟩
Set an arbitrary label for the test. This is the underlying implementation for a lot of Allure's other metadata.
You can use this command multiple times to create an array of values under the given name.
js
// @allure.label.mylabel=value
pm.test("Test Authentication", function () {
// ...
});
ID
// @allure.id=⟨VALUE⟩
Set the test's ID.
js
// @allure.id=123
pm.test("Test Authentication", function () {
// ...
});
Behavior-based hierarchy
// @allure.label.epic=⟨VALUE⟩
// @allure.label.feature=⟨VALUE⟩
// @allure.label.story=⟨VALUE⟩
Assign names of epics, features or user stories for a test, as part of Allure's behavior-based hierarchy.
js
// @allure.label.epic=WebInterface
// @allure.label.feature=EssentialFeatures
// @allure.label.story=Authentication
pm.test("Test Authentication", function () {
// ...
});
Suite-based hierarchy
// @allure.label.parentSuite=⟨VALUE⟩
// @allure.label.suite=⟨VALUE⟩
// @allure.label.subSuite=⟨VALUE⟩
By default, Allure Newman uses the folder hierarchy from the Postman collection for the Allure's suite-based hierarchy. You can override the names of a test's parent suite, suite and sub-suite individually by providing the special commands in JavaScript comments.
js
// @allure.label.parentSuite=WebInterface
// @allure.label.suite=EssentialFeatures
// @allure.label.subSuite=Authentication
pm.test("Test Authentication", function () {
// ...
});
Test steps
If a Postman request has multiple pm.test()
calls in its “Tests” section, Allure will display them as separate test steps.
js
pm.test("Make sure the response is valid JSON", function () {
// ...
});
pm.test("Compare the response with the expected data", function () {
// ...
});