Get started
Building with Bitbucket

UserWay Continuous-Accessibility integrates into your Bitbucket pipelines through a custom Bitbucket Pipe. The main purpose of the pipe is to collect accessibility reports generated during e2e tests execution and to trigger analysis via Continuous-Accessibility API.

1. Add a repository variable

In your BitBucket repository, go to Repository settings > Repository variables and create a new secured variable

  • For the Name field, enter USERWAY_TOKEN
  • For the Secret field, paste project token found on your Continuous-Accessibility project settings page.

Keep checked the Secured checkbox, then click on the Add button

2. Install @userway/cicd-cli npm package

Install the @userway/cicd-cli package in the root of your website project. This package is a command line interface tool but it provides Typescript types for your convenience during editing of configuration files. Installing of this package will allow you to trigger a11y analysis from your local dev machine, not only from GitHub pipeline environment.

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

For more information about @userway/cicd-cli package refer to the npm package documentation (opens in a new tab)

3. Create file userway.config.ts

Project metadata, including the location of the reports to be analyzed, must be declared in the file userway.config.js (or userway.config.ts) in the the root of your project

userway.config.ts
import type { Config } from '@userway/cicd-core'
export default {
  organization: 'your-organization-slug-name',
  project: 'your-project-name',
  token: process.env.USERWAY_TOKEN,
  reportPaths: ['./uw-a11y-reports'],
} satisfies Config

4. Update bitbucket-pipelines.yml file

Update the script section by adding the following commands, after e2e test execution

bitbucket-pipelines.yml
- pipe: userway/cicd-bitbucket:1.1.8
  variables:
    USERWAY_TOKEN: $USERWAY_TOKEN

5. Verify configuration

It is always a good idea to validate changes made in the steps above before committing them into repository. In order to verify if your GitHub action configuration is correct - there are are few steps which can be performed on local developer environment:

  • Make all necessary changes described above
  • Run e2e tests locally (this section)
  • Run command in terminal
export USERWAY_TOKEN=YOUR-PROJECT-TOKEN
npx userway

For more information about troubleshooting of your GitHub build configuration refer to the documentation

Prerequisites

  • Node.js v18.19.0 or higher is required