browser-inputs
v1.1.0
Published
Native browser user input simulators for frontend testing. 0 dependencies, extraced from ember.js
Downloads
4
Readme
Browser Inputs
Fast & mature native browser user input simulators for frontend testing. Includes 0 dependencies, extraced from ember.js
Installation:
npm install browser-inputs
import { click } from 'browser-inputs';
await click(document.querySelector('#button'));
await click('#button');
Public API:
- async blur(target, relatedTarget?)
- async click(target, mouseEventOptions?);
- async doubleClick(target, mouseEventOptions?);
- async fillIn(target, text);
- fireEvent(element, eventType, options?);
- async focus(target);
- async scrollTo(target, x, y);
- async select(target, optionsToSelect, keepPreviouslySelected = false);
- async tap(target, mouseEventOptions);
- async triggerEvent(target, eventType, options);
- async triggerKeyEvent(target, keyboardEventType, keyCode, keyModifier? = DEFAULT_MODIFIERS);
- async typeIn(target, text, optionsForDelay?);