Automated accessibility testing setup with axe-core

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Accessibility Testing with axe-core

axe-core is a library from Deque Systems for automated accessibility testing (WCAG 2.1/2.2). It runs in the browser and Node.js, integrates with Jest, Playwright, Cypress, and Storybook. It automatically detects approximately 57% of accessibility violations.

Integration with Jest + Testing Library

npm install --save-dev jest-axe @testing-library/react
// __tests__/accessibility.test.tsx
import { render } from '@testing-library/react';
import { axe, toHaveNoViolations } from 'jest-axe';

expect.extend(toHaveNoViolations);

describe('Component accessibility', () => {
  it('Button has no violations', async () => {
    const { container } = render(<Button>Submit</Button>);
    const results = await axe(container);
    expect(results).toHaveNoViolations();
  });

  it('Form has no violations', async () => {
    const { container } = render(
      <form>
        <label htmlFor="email">Email</label>
        <input id="email" type="email" />
        <button type="submit">Sign In</button>
      </form>
    );
    const results = await axe(container, {
      rules: {
        'color-contrast': { enabled: true },
        'label': { enabled: true },
      },
    });
    expect(results).toHaveNoViolations();
  });
});

Integration with Playwright

// tests/accessibility.spec.ts
import { test, expect } from '@playwright/test';
import AxeBuilder from '@axe-core/playwright';

test('Homepage passes WCAG 2.1 AA', async ({ page }) => {
  await page.goto('/');

  const results = await new AxeBuilder({ page })
    .withTags(['wcag2a', 'wcag2aa', 'wcag21aa'])
    .exclude('.cookie-banner')  // Exclude third-party components
    .analyze();

  expect(results.violations).toEqual([]);
});

test('Registration form accessibility', async ({ page }) => {
  await page.goto('/register');

  const results = await new AxeBuilder({ page })
    .include('#registration-form')
    .analyze();

  // Detailed report on failure
  if (results.violations.length > 0) {
    console.table(results.violations.map(v => ({
      id:          v.id,
      impact:      v.impact,
      description: v.description,
      nodes:       v.nodes.length,
    })));
  }

  expect(results.violations).toEqual([]);
});

Integration with Storybook

npm install --save-dev @storybook/addon-a11y
// .storybook/main.js
module.exports = {
  addons: ['@storybook/addon-a11y'],
};

// In stories
export default {
  component: Button,
  parameters: {
    a11y: {
      config: {
        rules: [{ id: 'color-contrast', enabled: true }],
      },
    },
  },
};

Programmatic Browser Run

// For auditing arbitrary page via console
import axe from 'axe-core';

axe.run(document, {
  runOnly: { type: 'tag', values: ['wcag2aa'] },
}).then(results => {
  console.log('Violations:', results.violations.length);
  results.violations.forEach(v => {
    console.group(`[${v.impact.toUpperCase()}] ${v.id}`);
    console.log(v.description);
    v.nodes.forEach(n => console.log('  Element:', n.target[0]));
    console.groupEnd();
  });
});

Violation Levels

Impact Meaning Example
critical Blocks access Image without alt
serious Significantly impairs Form without label
moderate Difficult to use Insufficient contrast
minor Minor inconvenience Incorrect lang

Timeline

Setting up axe-core in Jest + Playwright, covering key pages and components: 2–3 business days.