⚠️ this module is in beta, and might cause some strange failures. Please report bugs in the issues of this repo.
Note: please refer to this issue for updates about official cypress tab support
Installation
Add the plugin to devDependencies
npm install -D cypress-plugin-tab
At the top of cypress/support/index.js
:
Usage
.tab()
must be chained off of a tabbable(focusable) subject, or thebody
.tab()
changes the subject to the newly focused element after pressingtab
.tab({ shift: true })
sends a shift-tab to the element
cytype'foo'type'bar' // type foo, then press tab, then type bar cy // tab into the first tabbable element on the page cy // tab into the currently focused element
shift+tab:
cy type'foop' type'bar' type'foo' // correct your mistake