Setting Up Allure for API and UI Tests

To benefit from Allure, you need to integrate it with your existing test frameworks so that they emit Allure-compatible results. Fortunately, popular tools like pytest, JUnit, Playwright and Cypress already have plugins or reporters that make this straightforward.

Integrating Allure with Common Test Frameworks

The general pattern is to add an Allure plugin or reporter, configure the output directory and then run your tests as usual. For example, in Python you can use pytest-allure-adaptor-style plugins, while in JavaScript ecosystems you use dedicated reporters for Playwright or Cypress.

# Example: pytest + Allure setup
pip install allure-pytest

# Run tests and generate Allure results
pytest tests/api --alluredir=allure-results

# Example: Playwright + Allure (config extract)
# playwright.config.ts
import { defineConfig } from '@playwright/test';

export default defineConfig({
  reporter: [
    ['list'],
    ['allure-playwright', { outputFolder: 'allure-results' }],
  ],
});
Note: Many frameworks can output multiple reporters at once, so you can keep console output while also generating Allure results.
Tip: Standardise the allure-results folder location across projects so CI scripts and documentation stay simple.
Warning: Forgetting to clean or version-control large report folders can clutter repositories; usually you do not commit generated reports.

Once integration is in place, your pipelines can generate reports after each run and publish them automatically.

Common Mistakes

Mistake 1 โ€” Configuring Allure only for UI tests

This leaves gaps.

โŒ Wrong: Reporting only part of your suite.

โœ… Correct: Integrate Allure across API, UI and other automated tests where it makes sense.

Mistake 2 โ€” Mixing result folders between runs

This causes confusion.

โŒ Wrong: Writing multiple runs into the same directory without cleaning.

โœ… Correct: Use --clean or unique folders per run when generating reports.

🧠 Test Yourself

What is a typical step when setting up Allure for a test framework?