Skip to main content
No Result Found

Integrate accessibility testing with App Automate

Learn how to add accessibility checks to your existing WebdriverIO functional test suites.

This feature is currently in Alpha. To get access, contact support.

BrowserStack supports out of the box integration with WebdriverIO (WDIO). You can integrate your existing functional test suites with App Accessibility Automate to run accessibility checks on your mobile apps. You can access the generated accessibility violation reports on the App Accessibility dashboard.

For Android devices, App Accessibility automated tests are supported on version 11 and above.

Prerequisites

  • Ensure you have a BrowserStack Username and Access key. Obtain your username and access key from the Account & Profile section on the dashboard.
    If you have not yet created an account, sign up for a Free Trial.
  • App Accessibility Automate supports WebDriverIO (WDIO) versions 8 and 9. Ensure at least one of them is installed on your system.
  • Node.js recommendations:
    • For WDIO v8, it is recommended to use Node.js v16.19.0.
    • For WDIO v9, it is recommended to use Node.js v20.11.1.
    • To install, run nvm install {node.js version number} in your terminal.
  • Ensure you have a functional WebDriverIO test suite. To set one up, see Run accessibility checks on a sample repo.

Integrate App Accessibility Automate to run accessibility checks

Follow these steps to add automated accessibility checks to your test suite:

Set your BrowserStack credentials

Save your BrowserStack credentials as environment variables to make it easier to run your test suite from your local or CI environment.

Copy icon Copy
Copy icon Copy

Update WebDriverIO dependencies

Open the package.json file of your project and update the WDIO dependency to either version 8 or 9, matching your current setup. This applies to both Android and iOS projects.

See the following sample package.json file with WDIO dependencies set to version 9.

package.json
Copy icon Copy

Install dependencies

Run the following command to install all WebDriverIO dependencies.

npm install

Modify your WebdriverIO config file

Update the following parameters in the configuration file to run automated accessibility tests on BrowserStack.

If you are using the BrowserStack sample repository, open the parallel.conf.js file from the /examples/run-parallel-test/parallel.conf.js directory to set the required capabilities to run your tests.

Update the following parameters in the configuration file.

  1. Add browserstack to the services section of your configuration file if it’s not already present.
  2. Set the accessibility flag to true to enable accessibility testing. By default, the flag is set to false.
  3. Add the relative or absolute path of the app you want to test to the app property. For example, app: ./examples/BStackSampleApp.apk.
    You can upload an Android app (.apk or .aab file) or an iOS app (.ipa file) from your local filesystem.
  4. Set the accessibilityOptions property to configure various accessibility testing options. For details, see Configuration options.
  5. Increase the test timeout value, for example timeout: 100000. You must increase the test timeout value to give enough time for the accessibility checks to run.
  6. If you are upgrading WDIO version to v9, you must pass the relative path of test file to the specs property, for example, ./specs/single_test.js.
  7. Set the projectName and buildName.

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 App Automate since Automated tests will automatically identify different build runs.

Click the following file for a sample WDIO configuration

Sample parallel.conf.js

Sample parallel.conf.js
Copy icon Copy

Run the automated test

In the sample test repository, run the following command:

Run automated test
Copy icon Copy

After the test completes, access the report in your project folder on the App Accessibility dashboard.


Visit App Accessibility 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 Check Circle