selenium-webdriver 4.0.0-alpha.5 → 4.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.md +35 -1
- package/LICENSE +1 -1
- package/NOTICE +1 -1
- package/README.md +4 -4
- package/chrome.js +72 -592
- package/chromium.js +829 -0
- package/devtools/CDPConnection.js +37 -0
- package/edge.js +124 -86
- package/example/chrome_android.js +16 -13
- package/example/chrome_mobile_emulation.js +18 -14
- package/example/firefox_channels.js +35 -28
- package/example/google_search.js +9 -9
- package/example/google_search_test.js +20 -22
- package/example/headless.js +27 -19
- package/example/logging.js +34 -38
- package/firefox.js +200 -200
- package/http/index.js +131 -115
- package/http/util.js +56 -64
- package/ie.js +180 -104
- package/index.js +246 -199
- package/io/exec.js +34 -39
- package/io/index.js +142 -152
- package/io/zip.js +75 -65
- package/lib/actions.js +140 -122
- package/lib/atoms/find-elements.js +124 -0
- package/lib/atoms/get-attribute.js +79 -59
- package/lib/atoms/is-displayed.js +72 -73
- package/lib/atoms/mutation-listener.js +38 -0
- package/lib/by.js +192 -65
- package/lib/capabilities.js +82 -78
- package/lib/command.js +20 -20
- package/lib/error.js +134 -168
- package/lib/http.js +337 -230
- package/lib/input.js +325 -302
- package/lib/logging.js +127 -138
- package/lib/promise.js +60 -66
- package/lib/proxy.js +31 -41
- package/lib/session.js +12 -15
- package/lib/symbols.js +3 -4
- package/lib/until.js +162 -160
- package/lib/webdriver.js +1024 -541
- package/net/index.js +30 -36
- package/net/portprober.js +31 -144
- package/opera.js +406 -0
- package/package.json +19 -12
- package/proxy.js +2 -2
- package/remote/index.js +190 -187
- package/safari.js +40 -49
- package/testing/index.js +166 -155
package/lib/actions.js
CHANGED
|
@@ -15,38 +15,35 @@
|
|
|
15
15
|
// specific language governing permissions and limitations
|
|
16
16
|
// under the License.
|
|
17
17
|
|
|
18
|
-
'use strict'
|
|
19
|
-
|
|
20
|
-
const command = require('./command');
|
|
21
|
-
const error = require('./error');
|
|
22
|
-
const input = require('./input');
|
|
18
|
+
'use strict'
|
|
23
19
|
|
|
20
|
+
const command = require('./command')
|
|
21
|
+
const error = require('./error')
|
|
22
|
+
const input = require('./input')
|
|
24
23
|
|
|
25
24
|
/**
|
|
26
25
|
* @param {!IArrayLike} args .
|
|
27
26
|
* @return {!Array} .
|
|
28
27
|
*/
|
|
29
28
|
function flatten(args) {
|
|
30
|
-
|
|
29
|
+
const result = []
|
|
31
30
|
for (let i = 0; i < args.length; i++) {
|
|
32
|
-
|
|
31
|
+
const element = args[i]
|
|
33
32
|
if (Array.isArray(element)) {
|
|
34
|
-
result.push.apply(result, flatten(element))
|
|
33
|
+
result.push.apply(result, flatten(element))
|
|
35
34
|
} else {
|
|
36
|
-
result.push(element)
|
|
35
|
+
result.push(element)
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
|
-
return result
|
|
38
|
+
return result
|
|
40
39
|
}
|
|
41
40
|
|
|
42
|
-
|
|
43
41
|
const MODIFIER_KEYS = new Set([
|
|
44
42
|
input.Key.ALT,
|
|
45
43
|
input.Key.CONTROL,
|
|
46
44
|
input.Key.SHIFT,
|
|
47
|
-
input.Key.COMMAND
|
|
48
|
-
])
|
|
49
|
-
|
|
45
|
+
input.Key.COMMAND,
|
|
46
|
+
])
|
|
50
47
|
|
|
51
48
|
/**
|
|
52
49
|
* Checks that a key is a modifier key.
|
|
@@ -56,11 +53,10 @@ const MODIFIER_KEYS = new Set([
|
|
|
56
53
|
*/
|
|
57
54
|
function checkModifierKey(key) {
|
|
58
55
|
if (!MODIFIER_KEYS.has(key)) {
|
|
59
|
-
throw new error.InvalidArgumentError('Not a modifier key')
|
|
56
|
+
throw new error.InvalidArgumentError('Not a modifier key')
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
59
|
|
|
63
|
-
|
|
64
60
|
/**
|
|
65
61
|
* Class for defining sequences of complex user interactions. Each sequence
|
|
66
62
|
* will not be executed until {@link #perform} is called.
|
|
@@ -92,10 +88,10 @@ class LegacyActionSequence {
|
|
|
92
88
|
*/
|
|
93
89
|
constructor(driver) {
|
|
94
90
|
/** @private {!./webdriver.WebDriver} */
|
|
95
|
-
this.driver_ = driver
|
|
91
|
+
this.driver_ = driver
|
|
96
92
|
|
|
97
93
|
/** @private {!Array<{description: string, command: !command.Command}>} */
|
|
98
|
-
this.actions_ = []
|
|
94
|
+
this.actions_ = []
|
|
99
95
|
}
|
|
100
96
|
|
|
101
97
|
/**
|
|
@@ -109,8 +105,8 @@ class LegacyActionSequence {
|
|
|
109
105
|
schedule_(description, command) {
|
|
110
106
|
this.actions_.push({
|
|
111
107
|
description: description,
|
|
112
|
-
command: command
|
|
113
|
-
})
|
|
108
|
+
command: command,
|
|
109
|
+
})
|
|
114
110
|
}
|
|
115
111
|
|
|
116
112
|
/**
|
|
@@ -123,9 +119,9 @@ class LegacyActionSequence {
|
|
|
123
119
|
// Make a protected copy of the scheduled actions. This will protect against
|
|
124
120
|
// users defining additional commands before this sequence is actually
|
|
125
121
|
// executed.
|
|
126
|
-
|
|
127
|
-
for (
|
|
128
|
-
await this.driver_.execute(action.command)
|
|
122
|
+
const actions = this.actions_.concat()
|
|
123
|
+
for (const action of actions) {
|
|
124
|
+
await this.driver_.execute(action.command)
|
|
129
125
|
}
|
|
130
126
|
}
|
|
131
127
|
|
|
@@ -145,24 +141,24 @@ class LegacyActionSequence {
|
|
|
145
141
|
* @return {!LegacyActionSequence} A self reference.
|
|
146
142
|
*/
|
|
147
143
|
mouseMove(location, opt_offset) {
|
|
148
|
-
|
|
144
|
+
const cmd = new command.Command(command.Name.LEGACY_ACTION_MOUSE_MOVE)
|
|
149
145
|
|
|
150
146
|
if (typeof location.x === 'number') {
|
|
151
|
-
setOffset(/** @type {{x: number, y: number}} */(location))
|
|
147
|
+
setOffset(/** @type {{x: number, y: number}} */ (location))
|
|
152
148
|
} else {
|
|
153
|
-
cmd.setParameter('element', location.getId())
|
|
149
|
+
cmd.setParameter('element', location.getId())
|
|
154
150
|
if (opt_offset) {
|
|
155
|
-
setOffset(opt_offset)
|
|
151
|
+
setOffset(opt_offset)
|
|
156
152
|
}
|
|
157
153
|
}
|
|
158
154
|
|
|
159
|
-
this.schedule_('mouseMove', cmd)
|
|
160
|
-
return this
|
|
155
|
+
this.schedule_('mouseMove', cmd)
|
|
156
|
+
return this
|
|
161
157
|
|
|
162
158
|
/** @param {{x: number, y: number}} offset The offset to use. */
|
|
163
159
|
function setOffset(offset) {
|
|
164
|
-
cmd.setParameter('xoffset', offset.x || 0)
|
|
165
|
-
cmd.setParameter('yoffset', offset.y || 0)
|
|
160
|
+
cmd.setParameter('xoffset', offset.x || 0)
|
|
161
|
+
cmd.setParameter('yoffset', offset.y || 0)
|
|
166
162
|
}
|
|
167
163
|
}
|
|
168
164
|
|
|
@@ -182,22 +178,26 @@ class LegacyActionSequence {
|
|
|
182
178
|
* @private
|
|
183
179
|
*/
|
|
184
180
|
scheduleMouseAction_(
|
|
185
|
-
|
|
186
|
-
|
|
181
|
+
description,
|
|
182
|
+
commandName,
|
|
183
|
+
opt_elementOrButton,
|
|
184
|
+
opt_button
|
|
185
|
+
) {
|
|
186
|
+
let button
|
|
187
187
|
if (typeof opt_elementOrButton === 'number') {
|
|
188
|
-
button = opt_elementOrButton
|
|
188
|
+
button = opt_elementOrButton
|
|
189
189
|
} else {
|
|
190
190
|
if (opt_elementOrButton) {
|
|
191
191
|
this.mouseMove(
|
|
192
|
-
|
|
192
|
+
/** @type {!./webdriver.WebElement} */ (opt_elementOrButton)
|
|
193
|
+
)
|
|
193
194
|
}
|
|
194
|
-
button = opt_button !== void
|
|
195
|
+
button = opt_button !== void 0 ? opt_button : input.Button.LEFT
|
|
195
196
|
}
|
|
196
197
|
|
|
197
|
-
let cmd = new command.Command(commandName).
|
|
198
|
-
|
|
199
|
-
this
|
|
200
|
-
return this;
|
|
198
|
+
let cmd = new command.Command(commandName).setParameter('button', button)
|
|
199
|
+
this.schedule_(description, cmd)
|
|
200
|
+
return this
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
/**
|
|
@@ -224,8 +224,12 @@ class LegacyActionSequence {
|
|
|
224
224
|
* @return {!LegacyActionSequence} A self reference.
|
|
225
225
|
*/
|
|
226
226
|
mouseDown(opt_elementOrButton, opt_button) {
|
|
227
|
-
return this.scheduleMouseAction_(
|
|
228
|
-
|
|
227
|
+
return this.scheduleMouseAction_(
|
|
228
|
+
'mouseDown',
|
|
229
|
+
command.Name.LEGACY_ACTION_MOUSE_DOWN,
|
|
230
|
+
opt_elementOrButton,
|
|
231
|
+
opt_button
|
|
232
|
+
)
|
|
229
233
|
}
|
|
230
234
|
|
|
231
235
|
/**
|
|
@@ -250,12 +254,16 @@ class LegacyActionSequence {
|
|
|
250
254
|
* @return {!LegacyActionSequence} A self reference.
|
|
251
255
|
*/
|
|
252
256
|
mouseUp(opt_elementOrButton, opt_button) {
|
|
253
|
-
return this.scheduleMouseAction_(
|
|
254
|
-
|
|
257
|
+
return this.scheduleMouseAction_(
|
|
258
|
+
'mouseUp',
|
|
259
|
+
command.Name.LEGACY_ACTION_MOUSE_UP,
|
|
260
|
+
opt_elementOrButton,
|
|
261
|
+
opt_button
|
|
262
|
+
)
|
|
255
263
|
}
|
|
256
264
|
|
|
257
265
|
/**
|
|
258
|
-
* Convenience function for performing a "drag and drop"
|
|
266
|
+
* Convenience function for performing a "drag and drop" maneuver. The target
|
|
259
267
|
* element may be moved to the location of another element, or by an offset (in
|
|
260
268
|
* pixels).
|
|
261
269
|
*
|
|
@@ -266,7 +274,7 @@ class LegacyActionSequence {
|
|
|
266
274
|
* @return {!LegacyActionSequence} A self reference.
|
|
267
275
|
*/
|
|
268
276
|
dragAndDrop(element, location) {
|
|
269
|
-
return this.mouseDown(element).mouseMove(location).mouseUp()
|
|
277
|
+
return this.mouseDown(element).mouseMove(location).mouseUp()
|
|
270
278
|
}
|
|
271
279
|
|
|
272
280
|
/**
|
|
@@ -287,8 +295,12 @@ class LegacyActionSequence {
|
|
|
287
295
|
* @return {!LegacyActionSequence} A self reference.
|
|
288
296
|
*/
|
|
289
297
|
click(opt_elementOrButton, opt_button) {
|
|
290
|
-
return this.scheduleMouseAction_(
|
|
291
|
-
|
|
298
|
+
return this.scheduleMouseAction_(
|
|
299
|
+
'click',
|
|
300
|
+
command.Name.LEGACY_ACTION_CLICK,
|
|
301
|
+
opt_elementOrButton,
|
|
302
|
+
opt_button
|
|
303
|
+
)
|
|
292
304
|
}
|
|
293
305
|
|
|
294
306
|
/**
|
|
@@ -312,9 +324,12 @@ class LegacyActionSequence {
|
|
|
312
324
|
* @return {!LegacyActionSequence} A self reference.
|
|
313
325
|
*/
|
|
314
326
|
doubleClick(opt_elementOrButton, opt_button) {
|
|
315
|
-
return this.scheduleMouseAction_(
|
|
316
|
-
|
|
317
|
-
|
|
327
|
+
return this.scheduleMouseAction_(
|
|
328
|
+
'doubleClick',
|
|
329
|
+
command.Name.LEGACY_ACTION_DOUBLE_CLICK,
|
|
330
|
+
opt_elementOrButton,
|
|
331
|
+
opt_button
|
|
332
|
+
)
|
|
318
333
|
}
|
|
319
334
|
|
|
320
335
|
/**
|
|
@@ -327,10 +342,11 @@ class LegacyActionSequence {
|
|
|
327
342
|
* @private
|
|
328
343
|
*/
|
|
329
344
|
scheduleKeyboardAction_(description, keys) {
|
|
330
|
-
let cmd = new command.Command(
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
345
|
+
let cmd = new command.Command(
|
|
346
|
+
command.Name.LEGACY_ACTION_SEND_KEYS
|
|
347
|
+
).setParameter('value', keys)
|
|
348
|
+
this.schedule_(description, cmd)
|
|
349
|
+
return this
|
|
334
350
|
}
|
|
335
351
|
|
|
336
352
|
/**
|
|
@@ -345,8 +361,8 @@ class LegacyActionSequence {
|
|
|
345
361
|
* key.
|
|
346
362
|
*/
|
|
347
363
|
keyDown(key) {
|
|
348
|
-
checkModifierKey(key)
|
|
349
|
-
return this.scheduleKeyboardAction_('keyDown', [key])
|
|
364
|
+
checkModifierKey(key)
|
|
365
|
+
return this.scheduleKeyboardAction_('keyDown', [key])
|
|
350
366
|
}
|
|
351
367
|
|
|
352
368
|
/**
|
|
@@ -359,8 +375,8 @@ class LegacyActionSequence {
|
|
|
359
375
|
* key.
|
|
360
376
|
*/
|
|
361
377
|
keyUp(key) {
|
|
362
|
-
checkModifierKey(key)
|
|
363
|
-
return this.scheduleKeyboardAction_('keyUp', [key])
|
|
378
|
+
checkModifierKey(key)
|
|
379
|
+
return this.scheduleKeyboardAction_('keyUp', [key])
|
|
364
380
|
}
|
|
365
381
|
|
|
366
382
|
/**
|
|
@@ -373,13 +389,13 @@ class LegacyActionSequence {
|
|
|
373
389
|
* @return {!LegacyActionSequence} A self reference.
|
|
374
390
|
* @throws {Error} If the key is not a valid modifier key.
|
|
375
391
|
*/
|
|
376
|
-
sendKeys(
|
|
377
|
-
|
|
378
|
-
|
|
392
|
+
sendKeys(_var_args) {
|
|
393
|
+
// eslint-disable-line
|
|
394
|
+
const keys = flatten(arguments)
|
|
395
|
+
return this.scheduleKeyboardAction_('sendKeys', keys)
|
|
379
396
|
}
|
|
380
397
|
}
|
|
381
398
|
|
|
382
|
-
|
|
383
399
|
/**
|
|
384
400
|
* Class for defining sequences of user touch interactions. Each sequence
|
|
385
401
|
* will not be executed until {@link #perform} is called.
|
|
@@ -409,10 +425,10 @@ class LegacyTouchSequence {
|
|
|
409
425
|
*/
|
|
410
426
|
constructor(driver) {
|
|
411
427
|
/** @private {!./webdriver.WebDriver} */
|
|
412
|
-
this.driver_ = driver
|
|
428
|
+
this.driver_ = driver
|
|
413
429
|
|
|
414
430
|
/** @private {!Array<{description: string, command: !command.Command}>} */
|
|
415
|
-
this.actions_ = []
|
|
431
|
+
this.actions_ = []
|
|
416
432
|
}
|
|
417
433
|
|
|
418
434
|
/**
|
|
@@ -425,8 +441,8 @@ class LegacyTouchSequence {
|
|
|
425
441
|
schedule_(description, command) {
|
|
426
442
|
this.actions_.push({
|
|
427
443
|
description: description,
|
|
428
|
-
command: command
|
|
429
|
-
})
|
|
444
|
+
command: command,
|
|
445
|
+
})
|
|
430
446
|
}
|
|
431
447
|
|
|
432
448
|
/**
|
|
@@ -438,9 +454,9 @@ class LegacyTouchSequence {
|
|
|
438
454
|
// Make a protected copy of the scheduled actions. This will protect against
|
|
439
455
|
// users defining additional commands before this sequence is actually
|
|
440
456
|
// executed.
|
|
441
|
-
let actions = this.actions_.concat()
|
|
457
|
+
let actions = this.actions_.concat()
|
|
442
458
|
for (let action of actions) {
|
|
443
|
-
await this.driver_.execute(action.command)
|
|
459
|
+
await this.driver_.execute(action.command)
|
|
444
460
|
}
|
|
445
461
|
}
|
|
446
462
|
|
|
@@ -451,11 +467,12 @@ class LegacyTouchSequence {
|
|
|
451
467
|
* @return {!LegacyTouchSequence} A self reference.
|
|
452
468
|
*/
|
|
453
469
|
tap(elem) {
|
|
454
|
-
let cmd = new command.Command(
|
|
455
|
-
|
|
470
|
+
let cmd = new command.Command(
|
|
471
|
+
command.Name.LEGACY_ACTION_TOUCH_SINGLE_TAP
|
|
472
|
+
).setParameter('element', elem.getId())
|
|
456
473
|
|
|
457
|
-
this.schedule_('tap', cmd)
|
|
458
|
-
return this
|
|
474
|
+
this.schedule_('tap', cmd)
|
|
475
|
+
return this
|
|
459
476
|
}
|
|
460
477
|
|
|
461
478
|
/**
|
|
@@ -465,11 +482,12 @@ class LegacyTouchSequence {
|
|
|
465
482
|
* @return {!LegacyTouchSequence} A self reference.
|
|
466
483
|
*/
|
|
467
484
|
doubleTap(elem) {
|
|
468
|
-
|
|
469
|
-
|
|
485
|
+
const cmd = new command.Command(
|
|
486
|
+
command.Name.LEGACY_ACTION_TOUCH_DOUBLE_TAP
|
|
487
|
+
).setParameter('element', elem.getId())
|
|
470
488
|
|
|
471
|
-
this.schedule_('doubleTap', cmd)
|
|
472
|
-
return this
|
|
489
|
+
this.schedule_('doubleTap', cmd)
|
|
490
|
+
return this
|
|
473
491
|
}
|
|
474
492
|
|
|
475
493
|
/**
|
|
@@ -479,11 +497,12 @@ class LegacyTouchSequence {
|
|
|
479
497
|
* @return {!LegacyTouchSequence} A self reference.
|
|
480
498
|
*/
|
|
481
499
|
longPress(elem) {
|
|
482
|
-
|
|
483
|
-
|
|
500
|
+
const cmd = new command.Command(
|
|
501
|
+
command.Name.LEGACY_ACTION_TOUCH_LONG_PRESS
|
|
502
|
+
).setParameter('element', elem.getId())
|
|
484
503
|
|
|
485
|
-
this.schedule_('longPress', cmd)
|
|
486
|
-
return this
|
|
504
|
+
this.schedule_('longPress', cmd)
|
|
505
|
+
return this
|
|
487
506
|
}
|
|
488
507
|
|
|
489
508
|
/**
|
|
@@ -493,12 +512,12 @@ class LegacyTouchSequence {
|
|
|
493
512
|
* @return {!LegacyTouchSequence} A self reference.
|
|
494
513
|
*/
|
|
495
514
|
tapAndHold(location) {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
515
|
+
const cmd = new command.Command(command.Name.LEGACY_ACTION_TOUCH_DOWN)
|
|
516
|
+
.setParameter('x', location.x)
|
|
517
|
+
.setParameter('y', location.y)
|
|
499
518
|
|
|
500
|
-
this.schedule_('tapAndHold', cmd)
|
|
501
|
-
return this
|
|
519
|
+
this.schedule_('tapAndHold', cmd)
|
|
520
|
+
return this
|
|
502
521
|
}
|
|
503
522
|
|
|
504
523
|
/**
|
|
@@ -508,12 +527,12 @@ class LegacyTouchSequence {
|
|
|
508
527
|
* @return {!LegacyTouchSequence} A self reference.
|
|
509
528
|
*/
|
|
510
529
|
move(location) {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
530
|
+
const cmd = new command.Command(command.Name.LEGACY_ACTION_TOUCH_MOVE)
|
|
531
|
+
.setParameter('x', location.x)
|
|
532
|
+
.setParameter('y', location.y)
|
|
514
533
|
|
|
515
|
-
this.schedule_('move', cmd)
|
|
516
|
-
return this
|
|
534
|
+
this.schedule_('move', cmd)
|
|
535
|
+
return this
|
|
517
536
|
}
|
|
518
537
|
|
|
519
538
|
/**
|
|
@@ -523,12 +542,12 @@ class LegacyTouchSequence {
|
|
|
523
542
|
* @return {!LegacyTouchSequence} A self reference.
|
|
524
543
|
*/
|
|
525
544
|
release(location) {
|
|
526
|
-
let cmd = new command.Command(command.Name.LEGACY_ACTION_TOUCH_UP)
|
|
527
|
-
|
|
528
|
-
|
|
545
|
+
let cmd = new command.Command(command.Name.LEGACY_ACTION_TOUCH_UP)
|
|
546
|
+
.setParameter('x', location.x)
|
|
547
|
+
.setParameter('y', location.y)
|
|
529
548
|
|
|
530
|
-
this.schedule_('release', cmd)
|
|
531
|
-
return this
|
|
549
|
+
this.schedule_('release', cmd)
|
|
550
|
+
return this
|
|
532
551
|
}
|
|
533
552
|
|
|
534
553
|
/**
|
|
@@ -538,12 +557,12 @@ class LegacyTouchSequence {
|
|
|
538
557
|
* @return {!LegacyTouchSequence} A self reference.
|
|
539
558
|
*/
|
|
540
559
|
scroll(offset) {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
560
|
+
const cmd = new command.Command(command.Name.LEGACY_ACTION_TOUCH_SCROLL)
|
|
561
|
+
.setParameter('xoffset', offset.x)
|
|
562
|
+
.setParameter('yoffset', offset.y)
|
|
544
563
|
|
|
545
|
-
this.schedule_('scroll', cmd)
|
|
546
|
-
return this
|
|
564
|
+
this.schedule_('scroll', cmd)
|
|
565
|
+
return this
|
|
547
566
|
}
|
|
548
567
|
|
|
549
568
|
/**
|
|
@@ -555,13 +574,13 @@ class LegacyTouchSequence {
|
|
|
555
574
|
* @return {!LegacyTouchSequence} A self reference.
|
|
556
575
|
*/
|
|
557
576
|
scrollFromElement(elem, offset) {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
577
|
+
const cmd = new command.Command(command.Name.LEGACY_ACTION_TOUCH_SCROLL)
|
|
578
|
+
.setParameter('element', elem.getId())
|
|
579
|
+
.setParameter('xoffset', offset.x)
|
|
580
|
+
.setParameter('yoffset', offset.y)
|
|
562
581
|
|
|
563
|
-
this.schedule_('scrollFromElement', cmd)
|
|
564
|
-
return this
|
|
582
|
+
this.schedule_('scrollFromElement', cmd)
|
|
583
|
+
return this
|
|
565
584
|
}
|
|
566
585
|
|
|
567
586
|
/**
|
|
@@ -572,12 +591,12 @@ class LegacyTouchSequence {
|
|
|
572
591
|
* @return {!LegacyTouchSequence} A self reference.
|
|
573
592
|
*/
|
|
574
593
|
flick(speed) {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
594
|
+
const cmd = new command.Command(command.Name.LEGACY_ACTION_TOUCH_FLICK)
|
|
595
|
+
.setParameter('xspeed', speed.xspeed)
|
|
596
|
+
.setParameter('yspeed', speed.yspeed)
|
|
578
597
|
|
|
579
|
-
this.schedule_('flick', cmd)
|
|
580
|
-
return this
|
|
598
|
+
this.schedule_('flick', cmd)
|
|
599
|
+
return this
|
|
581
600
|
}
|
|
582
601
|
|
|
583
602
|
/**
|
|
@@ -589,21 +608,20 @@ class LegacyTouchSequence {
|
|
|
589
608
|
* @return {!LegacyTouchSequence} A self reference.
|
|
590
609
|
*/
|
|
591
610
|
flickElement(elem, offset, speed) {
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
this.schedule_('flickElement', cmd)
|
|
599
|
-
return this
|
|
611
|
+
const cmd = new command.Command(command.Name.LEGACY_ACTION_TOUCH_FLICK)
|
|
612
|
+
.setParameter('element', elem.getId())
|
|
613
|
+
.setParameter('xoffset', offset.x)
|
|
614
|
+
.setParameter('yoffset', offset.y)
|
|
615
|
+
.setParameter('speed', speed)
|
|
616
|
+
|
|
617
|
+
this.schedule_('flickElement', cmd)
|
|
618
|
+
return this
|
|
600
619
|
}
|
|
601
620
|
}
|
|
602
621
|
|
|
603
|
-
|
|
604
622
|
// PUBLIC API
|
|
605
623
|
|
|
606
624
|
module.exports = {
|
|
607
625
|
LegacyActionSequence,
|
|
608
626
|
LegacyTouchSequence,
|
|
609
|
-
}
|
|
627
|
+
}
|