---
title: Newman
description: Learn how to integrate Allure with Newman to generate rich, interactive test reports. Follow step-by-step setup, test execution, and report generation guidance.
---

# Getting started with Allure Newman

[![Allure Newman npm latest version](https://img.shields.io/npm/v/newman-reporter-allure?style=flat "Allure Newman npm latest version")](https://www.npmjs.com/package/newman-reporter-allure)

Generate beautiful HTML reports using [Allure Report](https://allurereport.org/docs/) and your [Newman](https://github.com/postmanlabs/newman) tests.

Info:
Check out the example projects at [github.com/allure-examples](https://github.com/orgs/allure-examples/repositories?q=visibility%3Apublic+archived%3Afalse+topic%3Aexample+topic%3Anewman) to see Allure Newman in action.

## Setting up

### 1. Prepare your project

1. Make sure [Node.js](https://nodejs.org/) is installed.

   Allure Newman is tested against Node.js 18 and higher. Older versions may work, but we can't guarantee that.

1. Open a terminal and go to the project directory. For example:

   ```bash
   cd /home/user/myproject
   ```

1. Make sure Allure Report is installed. If it's not, follow the [installation instructions](/docs/v2/install/). Note that Allure Report requires Java.

1. Install the Allure Newman integration.

   **npm:**
   ```bash
   npm install --save-dev newman-reporter-allure
   ```

   **yarn:**
   ```bash
   yarn add --dev newman-reporter-allure
   ```

   **pnpm:**
   ```bash
   pnpm install --dev newman-reporter-allure
   ```

### 2. Run tests

When running Newman:

1. Specify either a URL, an identifier, or a file path of your Postman collection.

1. Specify a list of [Newman reporters](https://learning.postman.com/docs/collections/using-newman-cli/newman-built-in-reporters/) that includes the `allure` reporter. You may want to include `cli` (the Newman's default reporter) as well to keep the terminal output informative.

1. Specify additional [Allure Newman configuration options](/docs/newman-configuration/) if necessary.

The example below assumes that the tests are [public](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/manage-workspaces/#change-workspace-visibility). (Alternatively, [use the Postman API](https://github.com/postmanlabs/newman?tab=readme-ov-file#using-newman-with-the-postman-api) to run them.)

**npm:**
```bash
npx newman run https://www.postman.com/collections/8854915-454a2dc7-dcbe-41cf-9bfa-da544fcd93a2 \
  --reporters cli,allure \
  --reporter-allure-resultsDir output/allure-results
```

**yarn:**
```bash
yarn run newman run https://www.postman.com/collections/8854915-454a2dc7-dcbe-41cf-9bfa-da544fcd93a2 \
  --reporters cli,allure \
  --reporter-allure-resultsDir output/allure-results
```

**pnpm:**
```bash
pnpx newman run https://www.postman.com/collections/8854915-454a2dc7-dcbe-41cf-9bfa-da544fcd93a2 \
  --reporters cli,allure \
  --reporter-allure-resultsDir output/allure-results
```

This will save necessary data into `allure-results`. If the directory already exists, the new files will be added to the existing ones, so that a future report will be based on them all.

### 3. Generate a report

Finally, convert the test results into an HTML report. This can be done by one of two commands:

- `allure generate` processes the test results and saves an HTML report into the `allure-report` directory. To view the report, use the `allure open` command.

- `allure serve` creates the same report as `allure generate`, then automatically opens the main page of the report in a web browser.

## Writing tests

The Allure Newman integration extends the standard reporting features of Newman by providing additional capabilities for crafting more informative and structured tests. This section highlights key enhancements that can be utilized:

- **Metadata Annotation**: Enhance test reports with [descriptions, links, and other metadata](#add-metadata).
- **Test Organization**: Structure your tests into clear hierarchies for better readability and organization [organize tests](#organize-tests).
- **Step Division**: Break down tests into smaller [test steps](#divide-a-test-into-steps) for easier understanding and maintenance.
- **Environment Details**: Include comprehensive [environment information](#environment-information) to accompany the test report.

### Add Metadata

Allure allows you to enrich your reports with a variety of [metadata](/docs/v2/readability/#description-links-and-other-metadata). This additional information provides context and details for each test, enhancing the report's usefulness. Refer to the [metadata reference section](/docs/jest-reference/#metadata) for an exhaustive list of what can be added.

```js
// @allure.label.owner=JohnDoe
// @allure.label.severity=critical
// @allure.label.tag=WebInterface
// @allure.label.tag=Authentication
pm.test("Test Authentication", function () {
  // ...
});
```

Danger:
Adding links to issues and other webpages is currently not supported by the Allure Newman integration.

### Organize tests

As described in [Improving navigation in your test report](/docs/v2/navigation/), Allure supports multiple ways to organize tests into hierarchical structures.

To specify a test's location in the [behavior-based hierarchy](/docs/v2/navigation/#behavior-based-hierarchy):

```js
// @allure.label.epic=WebInterface
// @allure.label.feature=EssentialFeatures
// @allure.label.story=Authentication
pm.test("Test Authentication", function () {
  // ...
});
```

To specify a test's location in the [suite-based hierarchy](/docs/v2/navigation/#suite-based-hierarchy):

```js
// @allure.label.parentSuite=WebInterface
// @allure.label.suite=EssentialFeatures
// @allure.label.subSuite=Authentication
pm.test("Test Authentication", function () {
  // ...
});
```

### Divide a test into steps

If a Postman request has multiple `pm.test()` calls in its “Tests” section, Allure will display them as separate [test steps](/docs/steps/).

```js
pm.test("Make sure the response is valid JSON", function () {
  // ...
});

pm.test("Compare the response with the expected data", function () {
  // ...
});
```

### Select tests via a test plan file

Danger:
Test plan is currently not supported by the Allure Newman integration.

### Environment information

For the main page of the report, you can collect various information about the environment in which the tests were executed.

For example, it is a good idea to use this to remember the OS version and Node.js version. This may help the future reader investigate bugs that are reproducible only in some environments.

Images: /images/js/environment-allure3.png, /images/js/environment-allure2.png

To provide environment information, put a file named `environment.properties` into the `allure-results` directory after running the tests. See the example in [Environment file](/docs/how-it-works-environment-file/).

Note that this feature should be used for properties that do not change for all tests in the report. If you have properties that can be different for different tests, consider using [Parametrized tests](/docs/jest-reference/#parametrized-tests).
