NightwatchJS Command to Repeat a Keystroke

Here’s a simple custom command that lets you repeat a specific key (single or combo) N number of times.

In the Drupal world you want to place this in your “Commands” directory (as defined in DRUPAL_NIGHTWATCH_SEARCH_DIRECTORY in web/core/.env).

You’d want to change “sitename” to be your site’s name (so it feels namespaced).



Using this in /tests/Nightwatch/Tests/misc.js with a 1000ms pause between each keystroke:

Leave a Reply

Your email address will not be published.