File tree 3 files changed +1445
-0
lines changed
3 files changed +1445
-0
lines changed Original file line number Diff line number Diff line change 15
15
< script src ="webdriver.js "> </ script >
16
16
< script src ="base64-arraybuffer.js "> </ script >
17
17
< script src ="FileSaver.js "> </ script >
18
+ < script src ="hammer.min.js "> </ script >
18
19
< script >
19
20
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
20
21
if ( ! String . prototype . startsWith ) {
105
106
'WebDriver.visualizerShowPoint()' ) ;
106
107
}
107
108
109
+ webdriver . ActionSequence . prototype . touchFlick = function ( speed ) {
110
+ var command = new webdriver . Command ( webdriver . CommandName . TOUCH_FLICK ) ;
111
+
112
+ command . setParameter ( 'xspeed' , speed . x ) ;
113
+ command . setParameter ( 'yspeed' , speed . y ) ;
114
+
115
+ this . schedule_ ( 'touchFlick' , command ) ;
116
+ return this ;
117
+ }
118
+
108
119
var Util = function ( ) { }
109
120
Util . WebDriverKeyFromJs = function ( keyCode ) {
110
121
switch ( keyCode ) {
372
383
373
384
return false ;
374
385
}
386
+
387
+ Hammer ( win . document ) . on ( "swipe" , function ( event ) {
388
+ self . driver . actions ( ) .
389
+ touchFlick ( { x : event . gesture . velocityX , y : event . gesture . velocityY } ) .
390
+ perform ( ) ;
391
+ } ) ;
375
392
}
376
393
377
394
WebDriverJsDemo . prototype . showVisualizationWindow = function ( source , size ) {
You can’t perform that action at this time.
0 commit comments