Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cypress-tab-until

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress-tab-until

Cypress keyboard accessibility tests

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

tab-until

Cypress keyboard only tests

Installation

npm i -D cypress-tab-until
# or
yarn add -D cypress-tab-until

Usage

cypress-tab-until extends the cy command.

Add the following to your project's cypress/support/commands.js :

import 'cypress-tab-until';

You can then start writing tests that just use the keyboard

cy.tabUntil({ accessibleTextIs: 'Username' });
cy.focused().type('some-username');

cy.tabUntil({accessibleTextIs: 'Password'}});
cy.focused().type('some-password');

cy.tabUntil({accessibleTextIs: 'Something up the page', direction: 'backwards'});

Accessible text

The accessible text for an element is calculated by fetching the node from the Accessibility Tree (using getPartialTree) and looking at the names within that node.

This means that the following all have the same accessible text:


<a href="#">Something</a>
<button>Something</a>
<input aria-label="Something">

This pushes us as developers to write tests that must consider the content being surfaced to a screen reader.

FAQs

Package last updated on 13 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc