GithubHelp home page GithubHelp logo

wanghaisheng / visual-impari-test-assistive-webdriver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amadeusitgroup/assistive-webdriver

0.0 2.0 0.0 3.15 MB

Assistive-Webdriver is a tool to automate end-to-end web application tests with a screen reader.

License: MIT License

Shell 0.73% JavaScript 12.60% C++ 4.17% C 0.30% TypeScript 81.83% HTML 0.19% Batchfile 0.19%

visual-impari-test-assistive-webdriver's Introduction

codecov

Presentation

This repository contains a set of components to automate end-to-end web application tests with a screen reader.

Web sites and web applications are increasingly required to be accessible, and, especially, compatible with screen readers, so that visually impaired users can use them.

To be sure that an application is compatible with a screen reader, it is important to test it in real conditions, which means using the application with the keyboard and listening to what the screen reader says. That is how a visually impaired user would interact with the application.

Most of the time those tests are currently done manually. The tools available in this repository allow to automate them.

Assistive-Webdriver

Assistive-webdriver is an implementation of a Webdriver server that allows testing a scenario in a web application with a screen reader and checking that the screen reader says what is expected.

Concretely, it adds screen reader-related functions to webdriver.

For example:

await driver.wait(forScreenReaderToSay("Date of departure"), 5000);

It also allows keystrokes to be sent low-level enough to pass through the screen reader (unlike usual webdriver implementations that send keystrokes directly to the browser and bypass hooks in the operating system).

For example, the "down arrow" key usually makes a screen reader read the next thing on the screen:

await driver.actions().sendKeys(Key.DOWN).perform();

Assistive-webdriver uses a virtual machine to run tests. Here is a schema describing how it works:

Architecture of Assistive-Webdriver

The 3 yellow boxes in this schema are the three components of Assistive-Webdriver, in the following three directories:

Inside of the assistive-webdriver component, all calls to create, control, and destroy the virtual machine are made through the following component that can be used independently:

Assistive-Playwright

Assistive-Playwright is similar to Assistive-Webdriver but is based on playwright rather than webdriver.

It adds screen reader-related functions to playwright:

await screenReader.waitForMessage("Date of departure");

In order to be able to send low-level mouse and keyboard events, Assistive-Playwright uses a virtual machine to run tests. Here is a schema describing how it works:

Architecture of Assistive-Playwright

The 3 yellow boxes in this schema are the three components of Assistive-Playwright, in the following three directories:

Another package is provided for integration with the @playwright/test test runner (it uses assistive-playwright-client internally):

Inside of the assistive-playwright-client component, all calls to create, control, and destroy the virtual machine are made through the following component that can be used independently:

Note that the recommended way to run tests with a screen reader is to use the assistive-playwright-test package along with @playwright/test.

visual-impari-test-assistive-webdriver's People

Contributors

divdavem avatar dependabot-preview[bot] avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.