For the complete documentation index, see llms.txt. This page is also available as Markdown.

WebdriverIO Quickstart

Set up visual testing in your WebdriverIO tests with the Argos WebdriverIO SDK.

Set up Argos with WebdriverIO, the Node.js test automation framework for web and mobile applications, to run visual tests on every pull request: capture screenshots with the SDK, then upload them with the Argos CLI.

Prerequisites

1

Install

Install the Argos CLI and the Argos WebdriverIO SDK:

npm i --save-dev @argos-ci/cli @argos-ci/webdriverio
yarn add --dev @argos-ci/cli @argos-ci/webdriverio
pnpm add --save-dev @argos-ci/cli @argos-ci/webdriverio
bun add --dev @argos-ci/cli @argos-ci/webdriverio

No configuration is needed — the SDK works directly in your tests.

2

Capture screenshots

Use the argosScreenshot helper to capture screenshots in your tests:

test/specs/homepage.e2e.js
import { browser } from "@wdio/globals";
import { argosScreenshot } from "@argos-ci/webdriverio";

describe("Integration test with visual testing", () => {
  it("covers homepage", async () => {
    await browser.url("http://localhost:3000");
    await argosScreenshot(browser, "homepage");
  });
});

Screenshots are written to the ./screenshots/argos directory. Add screenshots/ to your .gitignore file to avoid committing them.

3

Set up CI

Run your WebdriverIO tests in CI, then upload the screenshots to Argos with the CLI:

.github/workflows/argos.yml
name: Argos

on:
  pull_request:
  push:
    branches:
      - main

jobs:
  argos:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-node@v6
      - run: npm ci
      - name: Run WebdriverIO tests
        run: npm test

      - name: Upload screenshots to Argos
        run: npm exec -- argos upload ./screenshots/argos
        env:
          ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }}

ARGOS_TOKEN is the project token from Settings → General → Token. On GitHub Actions, you can also use OIDC or tokenless authentication to avoid managing a secret.

You're all set

Push your changes and open a pull request — the Argos check appears on it once the build is uploaded. Review the visual changes, approve or reject them, and merge with confidence.

Argos needs a baseline to compare against. Until a build runs on your default branch, pull request builds are marked as orphan. Merge this setup or run the workflow once on your default branch to establish the baseline.

Next steps


Last updated

Was this helpful?