Get started
Accessibility scan without e2e tests

UserWay CI/CD works great in combination with e2e testing frameworks such as Selenium. But if your web project does not currently have existing e2e test suites, there is an option of using UserWay managed scan. You will have to configure userway.config.js with the connection to your running website and all page paths you want to scan and we will collect accessibility insights by executing analysis completely on UserWay infrastructure.

1. Install @userway/cicd-cli npm package

Install the @userway/cicd-cli package in the root of your e2e testing project. This is a command line interface tool which collects all necessary information about your workflow environment (such as branch name, recent commit hash etc.), and communicates with UserWay CI/CD backend in order trigger accessibility analysis.

npm install --save-dev @userway/cicd-cli

Note: latest version can be found on npmjs (opens in a new tab)

2. Configure file userway.config.js with the website connection

Once you have installed the @userway/cicd-cli package, you must create a configuration file to specify a connection to your running website. The website connection configuration depends on the type of deployment. There are two options:

  • The website is deployed into a publicly accessible endpoint, such as a QA or staging environment. This website is accessible from the Internet to any user.
  • The website is running on localhost (dev machine or DevOps pipeline instance) and is not visible to the outside world.

Connection config depends on the deployment option you use:

a. Connection for a website accessible from the Internet

Connection config for a publicly accessible website is just a website URL, including protocol, hostname, and port. Default ports 80 and 443 can be omitted. E.g., connection: “http://qa.website.com:8080” (opens in a new tab)

userway.config.ts
import type { Config } from '@userway/cicd-core'
export default {
  connection: 'https://www.apple.com',
} satisfies Config

b. Connection for a website accessible on a localhost

The connection config for a website that runs on a localhost requires an HTTP tunnel for CI/CD infrastructure to connect to. The provided example uses ngrok as a built-in HTTP tunnel. Note: You can use a free ngrok instance or configure a paid one. In either case, you have to provide an ngrok authtoken. E.g.: connection: { addr: 80, authtoken: '2LpE4d1jA4aY6XGwNRasfASDas_7RcLm263SxaHvASDAsdasd' }

userway.config.ts
import type { Config } from '@userway/cicd-core'
export default {
  connection: {
    addr: 'localhost:1342',
    proto: 'http',
    authtoken: 'env.NGROK_TOKEN', // TODO set via env variable
  },
} satisfies Config

Refer to Javascript SDK for ngrok for more options https://www.npmjs.com/package/ngrok#options (opens in a new tab)

To see a working example of managed scan configuration via userway.config.js visit sample project repository (opens in a new tab)

3. Configure userway.config.js with pages

Now, you must update the userway.config.js file with the pages you wish to scan. Pages config is a list of objects, each with fields like url and devices. Assuming that we have selected option a. in the previous section, final userway.config.js can look like this one:

userway.config.ts
import type { Config } from '@userway/cicd-core'
export default {
   connection: 'https://www.apple.com',
   pages: [
    { url: '/airpods/', devices: mobile, ... },
    { url: '/iphone/' },
    { url: '/ipad/' }
   ]
} satisfies Config

4. Verify configuration

It is always a good idea to validate changes in the steps above before committing them to the repository. To verify if your managed scan configuration is correct - there are a few steps that can be performed on the local developer environment:

  • Make all necessary changes described above
  • Run scan locally:
export USERWAY_TOKEN=<YOUR-PROJECT-TOKEN>
npx userway

Make sure there are no errors and scan pass successfully

For more information about troubleshooting of @userway/cicd-cli tool refer to the documentation: https://docs.cicd.dev.userway.dev/get-started/troubleshooting (opens in a new tab)

Prerequisites

  • Node.js v16.20.2 or higher

Managed scan pricing

Please note, that UserWay-hosted scan requires activation of corresponding subscription.