ngryman / simulator

Mouse and touch events simulator
3 stars 1 forks source link

simulator npm size travis

Mouse and touch events simulator

sauce

Install

$ npm install --save-dev simulator

Usage

var Simulator = require('simulator')

// simulate tap
Simulator.tap()
Simulator.tap({ duration: 100 })

// simulate double tap
Simulator.doubleTap()
Simulator.doubleTap({ duration: 200 })

// simulate press
Simulator.press()
Simulator.press({ duration: 300 })

// simulate press (100 pixels to the right by default)
Simulator.swipe()
Simulator.swipe({ to: [100, 100] })

// position the simulator
Simulator.position(10, 10).tap()

// supports promises
Simulator.tap().then(Simulator.press)

// ...but also callbacks
Simulator.tap(Simulator.press)

License

MIT © Nicolas Gryman