Skip to content
Learn with RV – Tech Blog
Learn with RV – Tech Blog

#testautomation #qa #programming #linux #devops

  • Home
  • Who am I?
  • 1-on-1 Mentoring
  • Test Automation Incubator
  • 24 Testimonials
  • YouTube
  • LinkedIn
  • Contact
Learn with RV – Tech Blog

#testautomation #qa #programming #linux #devops

August 8, 2023September 27, 2024

Automated Tests for website Accessibility with Axe and TestCafe

Often, making websites accessible to people with disabilities is often omitted.
We can easily create automated tests to cover & increase the confidence on this topic, using tools like Axe and TestCafe

Note: If you want to manually perform a quick audit on your websites using Axe, there is a chrome browser extension that you can install to enable the audit tool in your DevTools.

Prerequisites

– NodeJS, NPM – setup tutorial HERE

– Chrome Browser
– you already have an automation testing framework created with TestCafe. I’ve previously created blog articles and videos about how to create it, step by step.

Blog article – HERE
YouTube Playlist – HERE

Step 1

Add Axe dependency in your project with the following CLI command

npm install axe-core axe-testcafe --save-dev

Step 2

Include accessibility assertion in your existing testcafe e2e tests or create a new test for this purpose.

tc-axe

That’s it! your test is ready to be executed (axe.js is the test file that contains the above test)
npx testcafe chrome tests/axe.js

 

The test failed because the website (QA-Practice) failed some of the accessibility validations. The test results report looks like this:

tc-axe-results1

Optional Config Step

Axe module allows you to define the context and options (e.g. to apply rules/exclude some HTML tags from the audit process).

Test Example:

tc-axe-config

Enjoyed this article? Make sure to subscribe to my YouTube Channel for more Test Automation tutorials, and follow me on LinkedIn and Twitter for regular insights.
Looking to accelerate your test automation journey?
I’ve designed a personalized 1-on-1 mentoring program tailored to boost your skills. Reach out at iamqarv@gmail.com for more details 🚀

Post Views: 445

Related

Share this article:
QA #testautomation#testcafe

Post navigation

Previous post
Next post

Recent Posts

  • Using npm –prefix to Run Scripts from a Nested package.json
  • Unit Testing in JavaScript: Getting started with Vitest
  • Fail Fast in Playwright with maxFailures
  • Cleaner asserts in Grafana k6 load tests using expect
  • AI: What Happens When an AI’s Context Window Gets Full?

Recent Comments

  1. Paul on Web Accessibility: A step-by-step guide to Testing with pa11y
  2. Automated Tests for website Accessibility with Axe and TestCafe - Learn with RV - Tech Blog on How to generate E2E TestCafe Framework in seconds
  3. RV on Exploring Faker.js: A Powerful Tool for Generating Realistic Random Test Data
  4. Adrian Maciuc on Exploring Faker.js: A Powerful Tool for Generating Realistic Random Test Data
  5. Nick on Cypress vs Playwright vs Testcafe – which framework is faster?

Archives

  • July 2026
  • June 2026
  • May 2026
  • April 2026
  • March 2026
  • February 2026
  • November 2025
  • October 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • March 2025
  • February 2025
  • January 2025
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023

Categories

  • AI
  • k6
  • Linux
  • Programming
  • QA
  • Tools
  • Uncategorized
©2026 Learn with RV – Tech Blog | WordPress Theme by SuperbThemes