touch-robot
v1.0.3
Published
机器模拟移动端触碰点击,手指滑动,供自动化测试使用
Downloads
10
Readme
touchRobot
机器模拟移动端触碰点击,手指滑动
Install
NPM
npm install touch-robot
import touchRobot from 'touch-robot';
CDN
<script type="text/javascript" src="./dist/touch-robot.min.js"></script>
Usage
var robot = new touchRobot(dom);
robot.touchLeft();
API
|方法(method)|描述(description)| |----|----:| touchLeft|左滑 touchRight|右滑 touchTop|上滑 touchBottom|下滑 touchTo|定点滑动,参数startX,startY,endX,endY touchClick|触碰点击
DEMO
jQuery-slide滑块验证码
操作步骤
step1
将代码在控制台粘贴执行
step2
var robot = new touchRobot(document.querySelector('#btn'));
robot.touchTo(0,0,400,0);
swiper轮播
操作步骤
step1
将代码在控制台粘贴执行
step2
var robot = new touchRobot(document.querySelector('.swiper-container'))
robot.touchLeft()