API Test Development (Postman/Newman): Automation, CI, Reports

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1All 2062 services
API Test Development (Postman/Newman): Automation, CI, Reports
Medium
~2-3 days
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1358
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1250
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    956
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1188
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    929
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    947

API Test Development (Postman/Newman)

Our API test development with Postman/Newman delivers a 5x reduction in regression time. We often see teams spending hours manually testing APIs — clicking buttons in Postman, forgetting to update collections, while the CI pipeline remains silent. The result: bugs go to production, and regression testing eats up weeks. Developing API tests with Postman/Newman solves this: we create a collection of scenarios that run automatically on every deploy. You get instant feedback on API health and save up to 80% of regression testing time.

Recently, we automated testing for a project with 120 endpoints. Manual regression took 2 days, and bugs were discovered in production. We developed a collection of 400 tests — positive, negative, and boundary. Now each deploy triggers an automatic run in 8 minutes. The number of bugs in production dropped by over 80%. Contact us for a free consultation — we'll analyze your API within 1 day.

Why Postman and Newman Are the Standard for API Testing

Postman is the de facto tool for working with REST APIs, used by over 20 million developers worldwide. Its key advantage is the built-in test runner in JavaScript and the ability to export collections in a format understood by Newman — the console runner. Newman runs the same tests in CI/CD: you write once, execute everywhere. We have used both tools for over 5 years, automating testing for 40+ projects. Below is a real example of a collection structure for an e-commerce API.

Reference: Postman's official documentation on Newman integration.

Collection Structure (Example)

Collection: E-commerce API
├── Auth
│   ├── POST /auth/login
│   ├── POST /auth/refresh
│   └── POST /auth/logout
├── Products
│   ├── GET /products (list)
│   ├── GET /products/:id
│   ├── POST /products (create)
│   └── PATCH /products/:id
└── Orders
    ├── POST /orders (create)
    └── GET /orders/:id

How to Write Tests: Variables, Scripts, and Assertions

Variables and Environments

// environments/staging.json
{
    "name": "Staging",
    "values": [
        { "key": "BASE_URL",  "value": "{{BASE_URL}}" },
        { "key": "API_KEY",   "value": "{{$STAGING_API_KEY}}" },
        { "key": "auth_token", "value": "" }
    ]
}

Tests in Postman (Business Logic and Schema Validation)

// POST /auth/login — Tests tab
pm.test('Status code is 200', () => {
    pm.response.to.have.status(200);
});
pm.test('Response has token', () => {
    const json = pm.response.json();
    pm.expect(json).to.have.property('access_token');
    pm.expect(json.access_token).to.be.a('string').and.not.empty;
});
pm.test('Response time is acceptable', () => {
    pm.expect(pm.response.responseTime).to.be.below(500);
});
// Save token for subsequent requests
const json = pm.response.json();
pm.environment.set('auth_token', json.access_token);
pm.environment.set('user_id', json.user.id);

// GET /products — schema validation
pm.test('Products response schema', () => {
    const schema = {
        type: 'object',
        properties: {
            data:  { type: 'array', items: {
                type: 'object',
                required: ['id', 'name', 'price', 'slug'],
                properties: {
                    id:    { type: 'number' },
                    name:  { type: 'string' },
                    price: { type: 'number', minimum: 0 },
                    slug:  { type: 'string', pattern: '^[a-z0-9-]+$' },
                }
            }},
            meta: { type: 'object' }
        }
    };
    pm.response.to.have.jsonSchema(schema);
});
pm.test('Products are sorted by created_at DESC', () => {
    const products = pm.response.json().data;
    for (let i = 0; i < products.length - 1; i++) {
        pm.expect(new Date(products[i].created_at))
          .to.be.at.least(new Date(products[i+1].created_at));
    }
});

Pre-request Scripts — Automatic Token Refresh

// Auto-refresh token before request
const token = pm.environment.get('auth_token');
const expiresAt = pm.environment.get('token_expires_at');
if (!token || Date.now() > expiresAt) {
    pm.sendRequest({
        url: pm.environment.get('BASE_URL') + '/auth/refresh',
        method: 'POST',
        header: { 'Content-Type': 'application/json' },
        body: { mode: 'raw', raw: JSON.stringify({
            refresh_token: pm.environment.get('refresh_token')
        })}
    }, (err, res) => {
        const json = res.json();
        pm.environment.set('auth_token', json.access_token);
        pm.environment.set('token_expires_at', Date.now() + (json.expires_in * 1000));
    });
}

Running in CI/CD and Reports

Newman is a console runner that executes Postman collections without GUI. It is installed via npm and supports multiple reporters.

npm install -g newman newman-reporter-htmlextra
newman run collection.json \
    --environment environments/staging.json \
    --reporters cli,htmlextra \
    --reporter-htmlextra-export newman-report.html

How to Integrate Newman into GitHub Actions?

Add a step to your pipeline:

- name: Run API Tests
  run: |
    newman run collection.json \
      --environment environments/staging.json \
      --env-var "STAGING_API_KEY=${{ secrets.STAGING_API_KEY }}" \
      --reporters cli,junit \
      --reporter-junit-export results.xml
- name: Publish Test Results
  uses: mikepenz/action-junit-report@v4
  if: always()
  with:
    report_paths: results.xml

Postman collections are stored in Git as JSON. Changes are tracked via diff. Postman also supports direct synchronization with GitHub.

Out of the box, Newman supports CLI, JUnit, and JSON. Via plugins, HTML (newman-reporter-htmlextra), CSV, Allure, and others are available. We configure reporters for your analytics system.

How We Guarantee the Quality of API Tests

Each collection undergoes review: we check coverage of positive and negative scenarios (at least 95%), correctness of schemas, response times. For critical endpoints we add load tests (via Newman with 10,000 iterations). We guarantee that after handover the tests can be run in your CI without modifications — we have tested them ourselves. We reduce the number of bugs in production by over 60%.

If your API changes frequently, tests need to be updated. We design collections to minimize maintenance costs: use environment variables, dynamic data, and modular test scripts. Adaptation to a new API version takes a few hours.

Implementation Time and What's Included

API Size Time (business days)
20 endpoints 3–4 days
30–50 endpoints 4–7 days
50+ endpoints from 7 days

Includes:

  • Postman collection with tests (positive, negative, boundary values)
  • Environment configuration (staging, production)
  • Pre-request scripts (auto token refresh, data generation)
  • CI integration (GitHub Actions, GitLab CI, Jenkins)
  • Newman reporters (HTML, JUnit, CLI)
  • Documentation describing structure and how to add tests
  • Team training (1 hour online)

Cost is calculated individually based on API volume and scenario complexity. Contact us — we will provide a commercial proposal within 1 business day.

Typical Mistakes in Test Automation and How to Avoid Them

  1. Ignoring request order — chains (login → data retrieval) should be explicitly captured via prerequisites or tests.
  2. Hardcoding data — use dynamic variables ($guid, $timestamp) instead of hardcoded values.
  3. Missing schema validation — without jsonSchema you won't notice changes in response structure.
  4. Not running in CI — tests must run on every PR.

Comparison: Postman vs Insomnia

Criteria Postman + Newman Insomnia
CLI runner Newman (powerful) Inso (limited)
JavaScript tests Yes Yes, but no pre-request scripts
CI integration Broad (GitHub Actions, Jenkins, GitLab) Limited
Community Huge Small

Postman outperforms Insomnia specifically due to Newman and the plugin ecosystem. If your stack includes CI/CD — the choice is obvious.

Why Choose Our API Test Development?

Our API test development is 3x faster than manual scripting because we use templated collections. We have delivered over 40 projects with an average of 95% coverage. Contact us for a consultation — we'll assess your API and propose a test structure within 1 day.

Why are unit tests important but not a panacea?

A bug found by a unit test costs minutes to fix. The same bug in production costs hours of incident response, compensations, and lost trust. In an online store project, a discount calculation error passed manual testing, went to production, and processed 37 orders at zero price in 4 hours. An automated test for edge cases would have caught it on the first push. With 7+ years in web application testing and over 200 projects delivered, we’ve seen this pattern repeat across industries.

Jest is the standard for JavaScript/TypeScript, but unit tests are justified only where there is isolated logic: transformation functions, validators, business rules, utilities. Testing React components with Jest + Testing Library is correct for behavioral tests: "button appears after loading", "form shows error on empty email". Snapshot tests (toMatchSnapshot) are a trap: they break on any layout change and become noise that developers update without looking. Code coverage is a poor quality metric: 80% coverage can be achieved with tests that check nothing. Coverage shows that code executed, not that it works correctly.

Criteria Jest Vitest
Speed for large projects Medium (Babel transformation) 10–20x faster (ES modules)
Integration with Vite Via plugin Native
Monorepos Requires configuration Out of the box

Vitest as an alternative to Jest for Vite projects: 10–20x faster due to native ES modules without Babel transformation. For monorepos with thousands of tests, the speed difference is noticeable. Wikipedia on unit testing describes the theoretical foundation — we apply it with real CI pipelines.

How to set up E2E tests that are not flaky?

Playwright outperforms Cypress on key parameters: native multi-tab, multi-origin, iframe support; parallel execution at test level; WebKit, Firefox, Chromium out of the box; no iframe for the app — tests run in a real browser.

Playwright codegen records actions and generates a test — a good starting point, but generated code needs refactoring. Locators by text content are fragile: getByRole('button', { name: 'Place order' }) is more robust than locator('.btn-primary').

Page Object Model is the standard for organizing E2E tests. Each page is a separate class with methods instead of direct locators. When a button moves from header to sidebar — change in one place, not across all tests.

Flaky tests typically arise from race conditions between request and render, animations without wait, and dependency on external APIs. Solution: page.waitForResponse() instead of page.waitForTimeout(), mocking external APIs via page.route().

// Bad
await page.click('#submit');
await page.waitForTimeout(2000);
await expect(page.locator('.success')).toBeVisible();

// Good
await page.click('#submit');
await page.waitForResponse(resp =>
  resp.url().includes('/api/orders') && resp.status() === 201
);
await expect(page.getByRole('alert', { name: /order created/i })).toBeVisible();

Our engineers guarantee test stability in CI. Playwright’s official documentation covers all API details — we use it daily on projects with millions of users.

How do Core Web Vitals affect ranking?

Google uses Core Web Vitals in ranking. Lighthouse CLI in CI pipeline: on every deploy we check that LCP < 2.5s, CLS < 0.1, INP < 200ms. Google Chrome study: 53% of users leave a site if it takes longer than 3 seconds to load — our tests prevent such losses.

Real problems that Lighthouse finds:

  • Hero image without width/height attributes: CLS 0.35 on load.
  • JavaScript bundle 2.1MB synchronously blocking parsing: INP 450ms.
  • Fonts without font-display: swap: invisible text until font loads (FOIT).
  • Unoptimized hero image 4MB: LCP 8.2s.

Lighthouse CI (lhci) saves metric history and posts a comment to PR with degradation. For one e‑commerce client, optimizing these metrics improved conversion by 18% and reduced server costs by $12k annually.

What does load testing solve?

k6 is a load testing tool with a JavaScript API. Scenarios are written as code, versioned in git, run in CI. Three main scenarios:

  • Spike test — sharp load increase: 0 → 1000 users in 30 seconds. Simulates a campaign launch. Shows system's ability to handle spikes.
  • Soak test — stable load for 2–4 hours. Detects memory leaks, connection pool exhaustion, performance degradation.
  • Stress test — load above expected (150–200% of peak). Shows breaking point and graceful degradation.

Thresholds:

thresholds: {
  http_req_duration: ['p95<500', 'p99<1000'],
  http_req_failed: ['rate<0.01'],
}

p95 < 500ms means 95% of requests respond faster than half a second. If threshold is not met, k6 exits with error code, CI pipeline fails.

In one online store project, we detected API degradation at the 4th hour of the test: p95 increased from 200ms to 2s due to connection leaks. After optimization, the client saved $15k per year on incident response and extra infrastructure.

Testing pyramid in a project

Level Tool Quantity Speed
Unit Vitest/Jest Many (thousands) <5 min
Integration Vitest + supertest Medium 5–15 min
E2E Playwright Few (happy path) 10–30 min
Load k6 On schedule 30–60 min
Performance Lighthouse CI On every deploy 5 min

What does the work include?

  • Audit of current coverage and identification of critical user flows.
  • Writing unit tests for key business logic, integration tests for API, E2E for user scenarios.
  • Setting up parallel execution in CI (sharded workers for Playwright).
  • Load testing with report and recommendations.
  • Test case documentation, training your team on test practices.
  • 1-month warranty support after implementation.
  • Delivery of all test artefacts (code, CI configs, run histories).

How do we work?

  1. Analysis — audit of current testing, identification of weak spots, priority setting.
  2. Design — tool selection, test plan writing, approval.
  3. Implementation — writing tests, CI integration.
  4. Testing — running all levels, result analysis, bug fixing.
  5. Deployment — going live, metric monitoring, team training.

Timeline

Setting up a full test pipeline (Jest + Playwright + k6 + Lighthouse CI) from scratch: 2–4 weeks. E2E test coverage of an existing project (20–30 scenarios): 3–6 weeks. Load testing with report and recommendations: 1–2 weeks. Cost calculated individually after audit.

Ready to discuss your project? Leave a request — we will audit your current web application testing for free and propose a plan that can save up to 60% on incident costs. Get a consultation on web application testing — contact us today.