Skip to content

17 Test Reporting

DodaTech 3 min read

title: "Test Reporting with Allure and Newman" description: "Generate comprehensive API test reports using Allure for rich test visualization and Newman reporters for Postman collection results. Learn report configuration, history tracking, and CI integration." weight: 17 date: 2026-06-28 lastmod: 2026-06-28 tags: [api-development, testing] }

Test reporting transforms raw test results into actionable insights. Allure provides rich, interactive test reports with history, trends, and categorization. Newman reporters generate HTML and JUnit reports from Postman collection runs.

What You'll Learn

  • Allure report configuration and generation
  • Newman HTML reporter setup
  • Test history and trend tracking
  • Report embedding in CI/CD
  • Custom report dashboards

Why It Matters

Good reports answer: what failed, why it failed, and is this a regression. Allure shows test trends over time. Newman reports provide quick feedback on collection runs. Both integrate with CI/CD artifacts.

Real-World Use

Selenium uses Allure for test reporting. Many open-source projects publish Allure reports. Postman monitoring uses Newman reporters for dashboard visualization.

flowchart LR
    Tests[Test Execution] --> Results[Test Results]
    Results --> Allure[Allure Reporter]
    Results --> Newman[Newman Reporter]
    Allure --> HTML[Allure HTML Report]
    Allure --> History[Test History]
    Allure --> Trends[Trend Graphs]
    Newman --> HTML2[HTML Report]
    Newman --> JUnit[JUnit XML]

Teacher Mindset

Choose your reporting tool based on your test framework. Allure works with most test frameworks. Newman is specific to Postman collections. Both should generate reports as CI artifacts.

Code Examples

// Example 1: Allure with Jest
const allure = require('allure-js-commons');

describe('User API', () => {
  it('creates a user', async () => {
    allure.feature('User Management');
    allure.story('Create User');
    allure.severity('critical');

    allure.startStep('Sending request');
    const res = await request(app)
      .post('/api/users')
      .send({ name: 'Alice', email: 'alice@test.com' });
    allure.endStep();

    allure.startStep('Verifying response');
    expect(res.status).toBe(201);
    allure.endStep();
  });
});
# Example 2: Generate Allure report
# Run tests with Allure
npm run test -- --alluredir=allure-results

# Generate and serve Allure report
allure generate allure-results --clean -o allure-report
allure open allure-report

# In CI, publish report as artifact
allure generate allure-results --clean -o allure-report
# Example 3: Newman with HTML reporter
# Install htmlextra reporter
npm install -g newman-reporter-htmlextra

# Run collection with HTML report
newman run collection.json \
  --reporters cli,htmlextra,junit \
  --reporter-htmlextra-export ./reports/newman-report.html \
  --reporter-junit-export ./reports/newman-results.xml \
  --reporter-htmlextra-title "API Regression Tests" \
  --reporter-htmlextra-browserTitle "API Tests"

# Run with test data and environment
newman run collection.json \
  -e staging.json \
  -d data.csv \
  -r htmlextra \
  --reporter-htmlextra-export ./reports/data-driven-report.html

Common Mistakes

  • Not generating reports in CI and only relying on CLI output
  • Forgetting to store reports as build artifacts
  • Not using test annotations for report categorization
  • Ignoring historical trends and only looking at current run
  • Generating reports without including screenshots or logs for failures

Practice

  1. Configure Allure in your test framework and generate a report.
  2. Add Allure annotations (feature, story, severity) to your tests.
  3. Run a Postman collection with Newman htmlextra reporter.
  4. Store both reports as CI artifacts.
  5. Challenge: Create a CI pipeline that archives Allure history and shows trends across builds.

FAQ

What is the difference between Allure and Newman reporters?

Allure is a general-purpose test report framework. Newman reporters are specific to Postman collection results.

Can Allure show test history?

Yes. Allure stores previous results and shows trends on the timeline and graph views.

How do I embed reports in CI?

Generate reports as CI artifacts. Use GitHub Pages, S3, or Netlify to host them publicly.

Does Allure support video recording?

Yes. Allure can attach videos, screenshots, and logs to test steps.

What is the best CI integration for Allure?

Use the Allure GitHub Action or Jenkins Allure plugin. Both automatically publish reports.

Mini Project

Set up Allure reporting for an API test suite. Add feature and severity annotations. Generate reports in CI. Configure Allure history to show trends. Integrate with Newman for Postman collection reporting alongside the code-based tests.

What's Next

Next, you will learn about API monitoring tests for production validation.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro