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.

JavaScript
// @allure.label.owner=JohnDoe pm.test("Test Authentication", function () { // ... });

Tag

  • // @allure.label.tag=⟨VALUE⟩

Set the test's tags.

JavaScript
// @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”.

JavaScript
// @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.

JavaScript
// @allure.label.mylabel=value pm.test("Test Authentication", function () { // ... });

ID

  • // @allure.id=⟨VALUE⟩

Set the test's ID.

JavaScript
// @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.

JavaScript
// @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, with an optional addition of the collection name if --reporter-allure-collection-as-parent-suite is set.

You can override the names of a test's parent suite, suite and sub-suite individually by providing the special commands in JavaScript comments.

JavaScript
// @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.

JavaScript
pm.test("Make sure the response is valid JSON", function () { // ... }); pm.test("Compare the response with the expected data", function () { // ... });
Powered by
logo

Join our newsletter

Join our community

We aim to make Allure Report as reliable and user-friendly as possible, and together with the community, we're here to help when problems arise.

© 2024 Qameta Software Inc. All rights reserved.