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

wdio-api-runner

v1.0.0

Published

A WebdriverIO runner for API automation testing without browser sessions

Readme

wdio-api-runner

A WebdriverIO runner for blazing-fast API automation testing

npm version License: MIT WebdriverIO Node.js

Documentation · Report Bug · Request Feature


Why wdio-api-runner?

Traditional WebdriverIO testing spins up browser sessions for every test—even when you're just testing APIs. This creates unnecessary overhead:

| Metric | Browser Runner | API Runner | |--------|---------------|------------| | Startup time | ~2-5 seconds | ~50ms | | Memory per worker | ~200-500MB | ~30MB | | Dependencies | Browser + Driver | None | | CI/CD complexity | High | Minimal |

wdio-api-runner bypasses browser session creation entirely, giving you the full power of WebdriverIO's test orchestration for pure API and backend testing.


Features

  • Zero Browser Overhead — No WebDriver, no browser binaries, no session management
  • Native Fetch API Client — Modern, Promise-based HTTP client with full TypeScript support
  • Fluent Assertions — Chain assertions for status, headers, body, and JSON schema validation
  • Authentication Helpers — Built-in Basic, API Key, Bearer/JWT, and OAuth2 support
  • GraphQL Support — Full support for queries, mutations, and subscriptions
  • HAR Logging — Record requests to HAR format for debugging and replay
  • Performance Metrics — p50/p95/p99 latency tracking with threshold checking
  • All WDIO Features — Parallel execution, reporters, services, and frameworks work seamlessly

Installation

npm install wdio-api-runner --save-dev

Quick Start

1. Configure WebdriverIO

// wdio.conf.ts
export const config: WebdriverIO.Config = {
    runner: 'api',
    specs: ['./test/api/**/*.spec.ts'],
    framework: 'mocha',
    reporters: ['spec'],
    baseUrl: 'https://api.example.com',

    apiRunner: {
        timeout: 30000,
        headers: {
            'Content-Type': 'application/json'
        }
    }
}

2. Write Your First Test

describe('Users API', () => {
    it('should fetch user by ID', async () => {
        const response = await api.get('/users/1')

        expect(response.status).toBe(200)
        expect(response.data).toHaveProperty('id', 1)
        expect(response.data).toHaveProperty('email')
    })

    it('should create a new user', async () => {
        const response = await api.post('/users', {
            name: 'John Doe',
            email: '[email protected]'
        })

        expect(response.status).toBe(201)
    })
})

3. Run Your Tests

npx wdio run wdio.conf.ts

Documentation

View Full Documentation →

| Guide | Description | |-------|-------------| | Getting Started | Installation and configuration | | API Client | HTTP methods, headers, and options | | Assertions | Fluent assertion helpers | | Authentication | Basic, Bearer, API Key, OAuth2 | | GraphQL | Queries, mutations, subscriptions | | Performance Metrics | Latency tracking and thresholds | | CI Integration | GitHub Actions, GitLab CI, Jenkins |


Example Usage

Fluent Assertions

import { assertResponse } from 'wdio-api-runner'

assertResponse(response)
    .toBeSuccess()
    .and.toHaveContentType('application/json')
    .and.toHaveBodyProperty('users')
    .and.toRespondWithin(500)

Authentication

import { bearerAuth, oauth2ClientCredentials } from 'wdio-api-runner'

// Bearer Token
api.addRequestInterceptor(bearerAuth({
    token: async () => await getToken()
}).interceptor)

// OAuth2 Client Credentials
api.addRequestInterceptor(oauth2ClientCredentials({
    tokenUrl: 'https://auth.example.com/token',
    clientId: 'my-client',
    clientSecret: 'secret'
}).interceptor)

GraphQL

import { createGraphQLClient } from 'wdio-api-runner'

const graphql = createGraphQLClient({
    endpoint: 'https://api.example.com/graphql'
})

const response = await graphql.query(`
    query GetUser($id: ID!) {
        user(id: $id) { id name email }
    }
`, { id: '123' })

Contributing

Contributions are welcome! Please read our contributing guidelines and submit pull requests to our repository.


License

MIT License - see LICENSE for details.


Built for the WebdriverIO ecosystem