Skip to main content

WebdriverIO Quickstart

Learn how to setup visual testing using the Argos WebdriverIO SDK.

Prerequisites

To get the most out of this guide, you’ll need to:

1. Install

npm i --save-dev @argos-ci/cli @argos-ci/webdriverio

Read the CLI documentation if you need information about advanced usages.

2. Take screenshots

Use argosScreenshot helper to capture screenshots in your E2E tests.

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 stored in screenshots/argos, don't forget to add this folder to your .gitignore.

3. Setup your CI

Add this command to your CI pipeline to upload the screenshots to Argos.

npm exec -- argos upload --token <ARGOS_TOKEN> screenshots
Note: The value of ARGOS_TOKEN is available your project settings on Argos.

Congratulations on installing Argos! 👏

After committing and pushing your changes, the Argos check status will appear on your pull request in GitHub (or GitLab).

Note: you need a reference build to compare your changes with. If you don't have one, builds will remain orphan until you run Argos on your reference branch.

You can now review changes of your app for each pull request, avoid visual bugs and merge with confidence. Welcome on board!

Additional resources


Join our Discord, submit an issue on GitHub or just send an email if you need help.