npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

allure-webdriverio

v2.0.3

Published

Allure WebdriverIO integration

Readme

Allure WebdriverIO Reporter

npm npm

This is the WebdriverIO reporter for Allure Framework. It provides detailed test execution reports with rich metadata, attachments, and test history.

Features

  • Automatic test case status tracking
  • WebDriver commands reporting
  • Screenshot attachments
  • Test suite hierarchies
  • Parallel execution support
  • Environment information
  • Test categorization
  • Test case links
  • Custom labels and attachments
  • Parameterized test support
  • Step-by-step test execution

Installation

# Using yarn (recommended)
yarn add -D allure-webdriverio

# Using npm
npm install allure-webdriverio --save-dev

Quick Start

  1. Install the package:

    yarn add -D allure-webdriverio
  2. Update your WebdriverIO configuration:

    // wdio.conf.ts
    import type { Options } from '@wdio/types'
    
    export const config: Options.Testrunner = {
        // ... other config
        reporters: [
            ['allure', {
                outputDir: 'allure-results',
                disableWebdriverStepsReporting: false,
                disableWebdriverScreenshotsReporting: false
            }]
        ],
        // ... rest of config
    }
  3. Run your tests:

    yarn wdio run wdio.conf.ts
  4. Generate and view the report:

    # Install Allure CLI
    yarn global add allure-commandline
    
    # Generate report
    allure generate allure-results --clean
    
    # Open report
    allure open

Configuration

Basic Configuration

// wdio.conf.ts
export const config: Options.Testrunner = {
    // ... other config
    reporters: [
        ['allure', {
            outputDir: 'allure-results',
            clean: true,
            disableWebdriverStepsReporting: false,
            disableWebdriverScreenshotsReporting: false
        }]
    ],
    // ... rest of config
}

Advanced Configuration

// wdio.conf.ts
export const config: Options.Testrunner = {
    // ... other config
    reporters: [
        ['allure', {
            outputDir: 'allure-results',
            clean: true,
            disableWebdriverStepsReporting: false,
            disableWebdriverScreenshotsReporting: false,
            environmentInfo: {
                node: process.version,
                platform: process.platform,
                browser: 'Chrome',
                version: 'latest'
            },
            categories: [
                {
                    name: 'Failed tests',
                    messageRegex: '.*',
                    matchedStatuses: ['failed']
                },
                {
                    name: 'Product defects',
                    messageRegex: '.*expected.*',
                    matchedStatuses: ['broken']
                }
            ],
            links: {
                issue: {
                    pattern: ["{}", "https://example.org/issue/{}"],
                    urlTemplate: "https://example.org/issue/%s"
                },
                tms: {
                    pattern: ["{}", "https://example.org/tms/{}"],
                    urlTemplate: "https://example.org/tms/%s"
                }
            },
            globalLabels: {
                framework: 'webdriverio',
                language: 'typescript'
            }
        }]
    ],
    // ... rest of config
}

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | outputDir | string | './allure-results' | Directory where Allure report files will be written | | clean | boolean | false | Clean the output directory before running tests | | disableWebdriverStepsReporting | boolean | false | Disable automatic reporting of WebDriver commands | | disableWebdriverScreenshotsReporting | boolean | false | Disable automatic reporting of screenshots | | environmentInfo | Record<string, string> | {} | Custom environment information | | categories | Category[] | [] | Test result categories configuration | | links | LinksConfig | {} | Configuration for test case links | | globalLabels | Record<string, string> | {} | Labels to be added to all test cases |

Usage Examples

Basic Test with Allure

import { allure } from 'allure-webdriverio';

describe('User Login', () => {
    it('should login successfully with valid credentials', async () => {
        // Add test metadata
        allure.addLabel('severity', 'critical');
        allure.addLabel('feature', 'Login');
        allure.addLabel('story', 'User logs in with valid credentials');
        
        // Add description
        allure.addDescription('This test verifies that a user can log in with valid credentials.');
        
        // Add links
        allure.addIssue('AUTH-123');
        allure.addTestId('LOGIN-1');
        
        // Test steps
        await allure.step('Open login page', async () => {
            await browser.url('/login');
        });
        
        await allure.step('Enter credentials and submit', async () => {
            await $('#username').setValue('user');
            await $('#password').setValue('password');
            await $('#login-button').click();
        });
        
        await allure.step('Verify successful login', async () => {
            await expect($('#welcome')).toBeDisplayed();
        });
    });
});

Parameterized Test

import { allure } from 'allure-webdriverio';

describe('Cross-browser Testing', () => {
    const browsers = ['chrome', 'firefox', 'safari'];
    
    browsers.forEach(browserName => {
        it(`should work in ${browserName}`, async () => {
            // Add browser parameter
            allure.addParameter('browser', browserName);
            allure.addParameter('environment', process.env.TEST_ENV || 'staging');
            
            // Test implementation
            await browser.url('/');
            await expect($('h1')).toHaveText('Welcome');
        });
    });
});

Test with Attachments

import { allure } from 'allure-webdriverio';

describe('Screenshot Tests', () => {
    it('should capture screenshot on failure', async () => {
        try {
            await browser.url('/');
            await expect($('.non-existent-element')).toBeDisplayed();
        } catch (error) {
            // Capture screenshot
            const screenshot = await browser.takeScreenshot();
            allure.addAttachment(
                'Failure Screenshot', 
                Buffer.from(screenshot, 'base64'), 
                'image/png'
            );
            throw error;
        }
    });
});

Categories

Categories allow you to group test results based on their status and error messages:

categories: [
    {
        name: 'Failed tests',
        messageRegex: '.*',
        matchedStatuses: ['failed']
    },
    {
        name: 'Product defects',
        messageRegex: '.*expected.*',
        matchedStatuses: ['broken']
    },
    {
        name: 'Test defects',
        messageRegex: '.*error.*',
        matchedStatuses: ['broken']
    }
]

Links

Configure links to external systems (issue trackers, test management systems):

links: {
    issue: {
        pattern: ["{}", "https://example.org/issue/{}"],
        urlTemplate: "https://example.org/issue/%s"
    },
    tms: {
        pattern: ["{}", "https://example.org/tms/{}"],
        urlTemplate: "https://example.org/tms/%s"
    }
}

API Reference

Allure Methods

| Method | Description | |--------|-------------| | allure.addLabel(name, value) | Add a label to the test | | allure.addParameter(name, value) | Add a parameter to the test | | allure.addDescription(text) | Add description to the test | | allure.addDescriptionHtml(html) | Add HTML description to the test | | allure.addAttachment(name, content, type) | Add attachment to the test | | allure.addIssue(issueId) | Add issue link | | allure.addTestId(testId) | Add test case ID | | allure.addLink(url, name, type) | Add custom link | | allure.step(name, fn) | Create a test step |

Available Labels

| Label | Description | |-------|-------------| | severity | Test severity (blocker, critical, normal, minor, trivial) | | feature | Feature name | | story | User story | | epic | Epic name | | suite | Test suite name | | framework | Testing framework | | language | Programming language |

Development

Running Tests

# Run all tests
yarn test

# Run tests in watch mode
yarn test:watch

# Run tests with coverage
yarn test:coverage

# Run tests for this package only
yarn workspace allure-webdriverio test

Building

# Build the package
yarn build

# Clean build artifacts
yarn clean

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Support