Skip to main content

Accessibility Automation on WebdriverIO

Quick start guide to integrate BrowserStack Accessibility Automation with WebdriverIO

Pre-requisites

  • You have an account with BrowserStack (even a free trial works) and can get the Username and Access Key from your Account & Profile.
  • You have a WebdriverIO test suite which is running on BrowserStack Automate.
  • You are using Node.js version 16 or above.

Integrate with Accessibility Automation

Follow the steps below to get started with adding Accessibility Automation to your test suite:

Follow these steps to start using BrowserStack Accessibility Automation with your existing setup of WebdriverIO tests running on BrowserStack Automate:

Update to the latest version of the browserstack-service npm package

Go to your WebdriverIO project’s root directory and run the following commands to update the installed version of @wdio/browserstack-service and later check the installed version:

You need to install @wdio/browserstack-service if you’re not already using it and configure it using the following steps:

Terminal
npm update @wdio/browserstack-service
npm list @wdio/browserstack-service

Please ensure that you have v7.33.0 or above (if using WDIO v7) or v8.16.7 or above (if using WDIO v8) before proceeding.

Set up the config file

Your wdio.conf.js file should include the Username and Access Key as in the following code snippet:

The projectName and buildName config must be static and not change across different runs of the same build. This is a deviation in approach as specified by BrowserStack Automate since Accessibility Automation will automatically identify different build runs.

wdio.conf.js
  exports.config = {
    //...
    user: 'YOUR_USERNAME' || process.env.BROWSERSTACK_USERNAME,
    key: 'YOUR_ACCESS_KEY' || process.env.BROWSERSTACK_ACCESS_KEY,
    commonCapabilities: {
      'bstack:options': {
        projectName: "Your static project name goes here",
        buildName: "Your static build/job name goes here"
      }
    },
    services: [
      ['browserstack', {
        accessibility: true,
        // Optional configuration options
        accessibilityOptions: {
          'wcagVersion': 'wcag21a',
          'includeIssueType': {
            'bestPractice': false,
            'needsReview': true
          },
          'includeTagsInTestingScope': ['Specify tags of test cases to be included'],
          'excludeTagsInTestingScope': ['Specify tags of test cases to be excluded']
        },
      }]
    ],
    //...
  };

Any other config parameters that are already existing can exist as it is.

Accessibility testing will only run on Desktops (Mac & Windows) with Chrome 95 & above on Automate.

Run your suite with BrowserStack Accessibility Automation

Use your pre-existing command that you use to trigger an automated build. Once the build has completed and the Accessibility report is ready, it will automatically get sent to the Accessibility Automation dashboard.

Visit Accessibility Automation Dashboard

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Download Copy