Skip to content

Accessibility testing of docs part using Cypress locally

Navaneeth S Nair edited this page Oct 14, 2025 · 3 revisions

Docs Accessibility Testing with Cypress

This guide explains how to set up and run accessibility tests for docs part of webpage using Cypress in your local environment.


Installation

  1. Open your terminal and navigate to the Cypress test directory:
    cd src/test/cypressjs
    
  2. Install the required dependencies:
    npm install
    
  3. Install Cypress as a development dependency:
    npm install cypress --save-dev
    

Configuration

  1. Update the following properties in cypress.config.js to your respective local directories:

    • supportFile
    • specPattern
    • downloadsFolder

    For example:

    specPattern: '/__w/openliberty.io/openliberty.io/src/test/cypressjs/cypress/e2e/**/*.cy.js'

    Change it to match your local path:

    specPattern: '/Users/navaneeth/Documents/openliberty.io/src/test/cypressjs/cypress/e2e/**/*.cy.js'

Running Cypress

  1. Launch Cypress using the following command:
    npx cypress open
  2. The Cypress Test Runner window will open in Chrome.
  3. Choose E2E Testing.
  4. Select your preferred browser and click Start Testing.
  5. Pick the test file you want to run.

Viewing Test Results

Tests will execute in the Cypress window.

  1. Results are stored locally in the following folder: src/test/cypressjs/results
  2. You can view:
    • Individual test results in separate files.
    • Overall summary in the summary.json file.

Clone this wiki locally