Skip to content

@testurio/reporter-allure

Allure TestOps reporter for Testurio. Converts test results to Allure-compatible format for interactive HTML reports.

bash
npm install @testurio/reporter-allure --save-dev

AllureReporter

typescript
import { AllureReporter } from '@testurio/reporter-allure';

const scenario = new TestScenario({
  name: 'API Tests',
  components: [server, client],
  reporters: [
    new AllureReporter({
      resultsDir: 'allure-results',
    }),
  ],
});

Constructor Options

OptionTypeDefaultDescription
resultsDirstring"allure-results"Output directory for results
environmentInfoRecord<string, string>Environment info in report
labelsLabel[]Default labels for all tests
tmsUrlPatternstringTMS link pattern (use {id})
issueUrlPatternstringIssue link pattern (use {id})
defaultEpicstringDefault epic for all tests
defaultFeaturestringDefault feature for all tests
includePayloads"parameters" | "attachments" | "both"Include payloads in steps
maxPayloadSizenumber1000Max payload size for parameters

Test Metadata

typescript
const tc = testCase('Get user', (test) => { /* ... */ })
  .id('TC-001')
  .epic('User Management')
  .feature('User API')
  .story('Get User')
  .severity('critical')
  .tags('api', 'smoke', 'regression')
  .issue('BUG-123')
  .description('Verifies user retrieval by ID');

Generating Reports

bash
# Install Allure CLI
npm install -g allure-commandline

# Generate HTML report
allure generate allure-results -o allure-report

# Open in browser
allure open allure-report

# Or generate + open in one step
allure serve allure-results

Output Files

FileDescription
{uuid}-result.jsonIndividual test result
{uuid}-container.jsonContainer grouping test cases
environment.propertiesEnvironment information
{uuid}-attachment.{ext}Payload attachments

IReporter Interface

Implement this interface to create custom reporters:

typescript
interface IReporter {
  readonly name: string;
  onStart?(result: { name?: string; startTime: number }): void;
  onTestCaseStart?(testCase: { name: string }): void;
  onStepComplete?(step: TestStepResult): void;
  onTestCaseComplete?(result: TestCaseResult): void;
  onComplete(result: TestResult): void;
  onError?(error: Error): void;
}

Released under the MIT License.