17 Test Reporting
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
- Configure Allure in your test framework and generate a report.
- Add Allure annotations (feature, story, severity) to your tests.
- Run a Postman collection with Newman htmlextra reporter.
- Store both reports as CI artifacts.
- Challenge: Create a CI pipeline that archives Allure history and shows trends across builds.
FAQ
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