selenium-webdriver 4.0.0-alpha.8 → 4.0.0-beta.4

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.
Files changed (53) hide show
  1. package/CHANGES.md +41 -1
  2. package/LICENSE +202 -0
  3. package/NOTICE +2 -0
  4. package/README.md +0 -0
  5. package/chrome.js +0 -0
  6. package/chromium.js +23 -202
  7. package/devtools/CDPConnection.js +16 -18
  8. package/edge.js +89 -130
  9. package/example/chrome_android.js +45 -0
  10. package/{lib/atoms/make-atoms-module.js → example/chrome_mobile_emulation.js} +26 -15
  11. package/example/firefox_channels.js +84 -0
  12. package/example/google_search.js +50 -0
  13. package/example/google_search_test.js +70 -0
  14. package/example/headless.js +63 -0
  15. package/example/logging.js +64 -0
  16. package/firefox.js +10 -9
  17. package/http/index.js +0 -0
  18. package/http/util.js +3 -3
  19. package/ie.js +0 -0
  20. package/index.js +2 -2
  21. package/io/exec.js +3 -3
  22. package/io/index.js +12 -13
  23. package/io/zip.js +5 -6
  24. package/lib/atoms/find-elements.js +78 -78
  25. package/lib/atoms/get-attribute.js +64 -68
  26. package/lib/atoms/is-displayed.js +27 -27
  27. package/lib/atoms/mutation-listener.js +55 -0
  28. package/lib/by.js +1 -1
  29. package/lib/capabilities.js +2 -3
  30. package/lib/command.js +2 -15
  31. package/lib/error.js +0 -0
  32. package/lib/http.js +17 -30
  33. package/lib/input.js +2 -286
  34. package/lib/logging.js +0 -0
  35. package/lib/promise.js +4 -16
  36. package/lib/proxy.js +0 -0
  37. package/lib/session.js +0 -0
  38. package/lib/symbols.js +0 -0
  39. package/lib/until.js +17 -15
  40. package/lib/webdriver.js +336 -16
  41. package/net/index.js +0 -0
  42. package/net/portprober.js +8 -8
  43. package/opera.js +0 -0
  44. package/package.json +13 -13
  45. package/proxy.js +0 -0
  46. package/remote/index.js +6 -7
  47. package/safari.js +0 -0
  48. package/testing/index.js +504 -0
  49. package/.eslintrc.js +0 -27
  50. package/.prettierrc +0 -4
  51. package/devtools/generator/protocol-dts-generator.js +0 -429
  52. package/lib/README +0 -5
  53. package/lib/actions.js +0 -626
package/lib/actions.js DELETED
@@ -1,626 +0,0 @@
1
- // Licensed to the Software Freedom Conservancy (SFC) under one
2
- // or more contributor license agreements. See the NOTICE file
3
- // distributed with this work for additional information
4
- // regarding copyright ownership. The SFC licenses this file
5
- // to you under the Apache License, Version 2.0 (the
6
- // "License"); you may not use this file except in compliance
7
- // with the License. You may obtain a copy of the License at
8
- //
9
- // http://www.apache.org/licenses/LICENSE-2.0
10
- //
11
- // Unless required by applicable law or agreed to in writing,
12
- // software distributed under the License is distributed on an
13
- // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- // KIND, either express or implied. See the License for the
15
- // specific language governing permissions and limitations
16
- // under the License.
17
-
18
- 'use strict'
19
-
20
- const command = require('./command')
21
- const error = require('./error')
22
- const input = require('./input')
23
-
24
- /**
25
- * @param {!IArrayLike} args .
26
- * @return {!Array} .
27
- */
28
- function flatten(args) {
29
- let result = []
30
- for (let i = 0; i < args.length; i++) {
31
- let element = args[i]
32
- if (Array.isArray(element)) {
33
- result.push.apply(result, flatten(element))
34
- } else {
35
- result.push(element)
36
- }
37
- }
38
- return result
39
- }
40
-
41
- const MODIFIER_KEYS = new Set([
42
- input.Key.ALT,
43
- input.Key.CONTROL,
44
- input.Key.SHIFT,
45
- input.Key.COMMAND,
46
- ])
47
-
48
- /**
49
- * Checks that a key is a modifier key.
50
- * @param {!input.Key} key The key to check.
51
- * @throws {error.InvalidArgumentError} If the key is not a modifier key.
52
- * @private
53
- */
54
- function checkModifierKey(key) {
55
- if (!MODIFIER_KEYS.has(key)) {
56
- throw new error.InvalidArgumentError('Not a modifier key')
57
- }
58
- }
59
-
60
- /**
61
- * Class for defining sequences of complex user interactions. Each sequence
62
- * will not be executed until {@link #perform} is called.
63
- *
64
- * This class should not be instantiated directly. Instead, obtain an instance
65
- * using {@link ./webdriver.WebDriver#actions() WebDriver.actions()}.
66
- *
67
- * Sample usage:
68
- *
69
- * new LegacyActions(driver).
70
- * keyDown(Key.SHIFT).
71
- * click(element1).
72
- * click(element2).
73
- * dragAndDrop(element3, element4).
74
- * keyUp(Key.SHIFT).
75
- * perform();
76
- *
77
- * @deprecated This class is strongly deprecated and will be removed once
78
- * [Google's Chrome][Chrome] and [Microsoft's Edge][Edge] browsers
79
- * support the new action sequence API.
80
- *
81
- * [Chrome]: https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md
82
- * [Edge]: https://docs.microsoft.com/en-us/microsoft-edge/webdriver
83
- */
84
- class LegacyActionSequence {
85
- /**
86
- * @param {!./webdriver.WebDriver} driver The driver that should be used to
87
- * perform this action sequence.
88
- */
89
- constructor(driver) {
90
- /** @private {!./webdriver.WebDriver} */
91
- this.driver_ = driver
92
-
93
- /** @private {!Array<{description: string, command: !command.Command}>} */
94
- this.actions_ = []
95
- }
96
-
97
- /**
98
- * Schedules an action to be executed each time {@link #perform} is called on
99
- * this instance.
100
- *
101
- * @param {string} description A description of the command.
102
- * @param {!command.Command} command The command.
103
- * @private
104
- */
105
- schedule_(description, command) {
106
- this.actions_.push({
107
- description: description,
108
- command: command,
109
- })
110
- }
111
-
112
- /**
113
- * Executes this action sequence.
114
- *
115
- * @return {!Promise} A promise that will be resolved once this sequence has
116
- * completed.
117
- */
118
- async perform() {
119
- // Make a protected copy of the scheduled actions. This will protect against
120
- // users defining additional commands before this sequence is actually
121
- // executed.
122
- let actions = this.actions_.concat()
123
- for (let action of actions) {
124
- await this.driver_.execute(action.command)
125
- }
126
- }
127
-
128
- /**
129
- * Moves the mouse. The location to move to may be specified in terms of the
130
- * mouse's current location, an offset relative to the top-left corner of an
131
- * element, or an element (in which case the middle of the element is used).
132
- *
133
- * @param {(!./webdriver.WebElement|{x: number, y: number})} location The
134
- * location to drag to, as either another WebElement or an offset in
135
- * pixels.
136
- * @param {{x: number, y: number}=} opt_offset If the target {@code location}
137
- * is defined as a {@link ./webdriver.WebElement}, this parameter defines
138
- * an offset within that element. The offset should be specified in pixels
139
- * relative to the top-left corner of the element's bounding box. If
140
- * omitted, the element's center will be used as the target offset.
141
- * @return {!LegacyActionSequence} A self reference.
142
- */
143
- mouseMove(location, opt_offset) {
144
- let cmd = new command.Command(command.Name.LEGACY_ACTION_MOUSE_MOVE)
145
-
146
- if (typeof location.x === 'number') {
147
- setOffset(/** @type {{x: number, y: number}} */ (location))
148
- } else {
149
- cmd.setParameter('element', location.getId())
150
- if (opt_offset) {
151
- setOffset(opt_offset)
152
- }
153
- }
154
-
155
- this.schedule_('mouseMove', cmd)
156
- return this
157
-
158
- /** @param {{x: number, y: number}} offset The offset to use. */
159
- function setOffset(offset) {
160
- cmd.setParameter('xoffset', offset.x || 0)
161
- cmd.setParameter('yoffset', offset.y || 0)
162
- }
163
- }
164
-
165
- /**
166
- * Schedules a mouse action.
167
- * @param {string} description A simple descriptive label for the scheduled
168
- * action.
169
- * @param {!command.Name} commandName The name of the command.
170
- * @param {(./webdriver.WebElement|input.Button)=} opt_elementOrButton Either
171
- * the element to interact with or the button to click with.
172
- * Defaults to {@link input.Button.LEFT} if neither an element nor
173
- * button is specified.
174
- * @param {input.Button=} opt_button The button to use. Defaults to
175
- * {@link input.Button.LEFT}. Ignored if the previous argument is
176
- * provided as a button.
177
- * @return {!LegacyActionSequence} A self reference.
178
- * @private
179
- */
180
- scheduleMouseAction_(
181
- description,
182
- commandName,
183
- opt_elementOrButton,
184
- opt_button
185
- ) {
186
- let button
187
- if (typeof opt_elementOrButton === 'number') {
188
- button = opt_elementOrButton
189
- } else {
190
- if (opt_elementOrButton) {
191
- this.mouseMove(
192
- /** @type {!./webdriver.WebElement} */ (opt_elementOrButton)
193
- )
194
- }
195
- button = opt_button !== void 0 ? opt_button : input.Button.LEFT
196
- }
197
-
198
- let cmd = new command.Command(commandName).setParameter('button', button)
199
- this.schedule_(description, cmd)
200
- return this
201
- }
202
-
203
- /**
204
- * Presses a mouse button. The mouse button will not be released until
205
- * {@link #mouseUp} is called, regardless of whether that call is made in this
206
- * sequence or another. The behavior for out-of-order events (e.g. mouseDown,
207
- * click) is undefined.
208
- *
209
- * If an element is provided, the mouse will first be moved to the center
210
- * of that element. This is equivalent to:
211
- *
212
- * sequence.mouseMove(element).mouseDown()
213
- *
214
- * Warning: this method currently only supports the left mouse button. See
215
- * [issue 4047](http://code.google.com/p/selenium/issues/detail?id=4047).
216
- *
217
- * @param {(./webdriver.WebElement|input.Button)=} opt_elementOrButton Either
218
- * the element to interact with or the button to click with.
219
- * Defaults to {@link input.Button.LEFT} if neither an element nor
220
- * button is specified.
221
- * @param {input.Button=} opt_button The button to use. Defaults to
222
- * {@link input.Button.LEFT}. Ignored if a button is provided as the
223
- * first argument.
224
- * @return {!LegacyActionSequence} A self reference.
225
- */
226
- mouseDown(opt_elementOrButton, opt_button) {
227
- return this.scheduleMouseAction_(
228
- 'mouseDown',
229
- command.Name.LEGACY_ACTION_MOUSE_DOWN,
230
- opt_elementOrButton,
231
- opt_button
232
- )
233
- }
234
-
235
- /**
236
- * Releases a mouse button. Behavior is undefined for calling this function
237
- * without a previous call to {@link #mouseDown}.
238
- *
239
- * If an element is provided, the mouse will first be moved to the center
240
- * of that element. This is equivalent to:
241
- *
242
- * sequence.mouseMove(element).mouseUp()
243
- *
244
- * Warning: this method currently only supports the left mouse button. See
245
- * [issue 4047](http://code.google.com/p/selenium/issues/detail?id=4047).
246
- *
247
- * @param {(./webdriver.WebElement|input.Button)=} opt_elementOrButton Either
248
- * the element to interact with or the button to click with.
249
- * Defaults to {@link input.Button.LEFT} if neither an element nor
250
- * button is specified.
251
- * @param {input.Button=} opt_button The button to use. Defaults to
252
- * {@link input.Button.LEFT}. Ignored if a button is provided as the
253
- * first argument.
254
- * @return {!LegacyActionSequence} A self reference.
255
- */
256
- mouseUp(opt_elementOrButton, opt_button) {
257
- return this.scheduleMouseAction_(
258
- 'mouseUp',
259
- command.Name.LEGACY_ACTION_MOUSE_UP,
260
- opt_elementOrButton,
261
- opt_button
262
- )
263
- }
264
-
265
- /**
266
- * Convenience function for performing a "drag and drop" maneuver. The target
267
- * element may be moved to the location of another element, or by an offset (in
268
- * pixels).
269
- *
270
- * @param {!./webdriver.WebElement} element The element to drag.
271
- * @param {(!./webdriver.WebElement|{x: number, y: number})} location The
272
- * location to drag to, either as another WebElement or an offset in
273
- * pixels.
274
- * @return {!LegacyActionSequence} A self reference.
275
- */
276
- dragAndDrop(element, location) {
277
- return this.mouseDown(element).mouseMove(location).mouseUp()
278
- }
279
-
280
- /**
281
- * Clicks a mouse button.
282
- *
283
- * If an element is provided, the mouse will first be moved to the center
284
- * of that element. This is equivalent to:
285
- *
286
- * sequence.mouseMove(element).click()
287
- *
288
- * @param {(./webdriver.WebElement|input.Button)=} opt_elementOrButton Either
289
- * the element to interact with or the button to click with.
290
- * Defaults to {@link input.Button.LEFT} if neither an element nor
291
- * button is specified.
292
- * @param {input.Button=} opt_button The button to use. Defaults to
293
- * {@link input.Button.LEFT}. Ignored if a button is provided as the
294
- * first argument.
295
- * @return {!LegacyActionSequence} A self reference.
296
- */
297
- click(opt_elementOrButton, opt_button) {
298
- return this.scheduleMouseAction_(
299
- 'click',
300
- command.Name.LEGACY_ACTION_CLICK,
301
- opt_elementOrButton,
302
- opt_button
303
- )
304
- }
305
-
306
- /**
307
- * Double-clicks a mouse button.
308
- *
309
- * If an element is provided, the mouse will first be moved to the center of
310
- * that element. This is equivalent to:
311
- *
312
- * sequence.mouseMove(element).doubleClick()
313
- *
314
- * Warning: this method currently only supports the left mouse button. See
315
- * [issue 4047](http://code.google.com/p/selenium/issues/detail?id=4047).
316
- *
317
- * @param {(./webdriver.WebElement|input.Button)=} opt_elementOrButton Either
318
- * the element to interact with or the button to click with.
319
- * Defaults to {@link input.Button.LEFT} if neither an element nor
320
- * button is specified.
321
- * @param {input.Button=} opt_button The button to use. Defaults to
322
- * {@link input.Button.LEFT}. Ignored if a button is provided as the
323
- * first argument.
324
- * @return {!LegacyActionSequence} A self reference.
325
- */
326
- doubleClick(opt_elementOrButton, opt_button) {
327
- return this.scheduleMouseAction_(
328
- 'doubleClick',
329
- command.Name.LEGACY_ACTION_DOUBLE_CLICK,
330
- opt_elementOrButton,
331
- opt_button
332
- )
333
- }
334
-
335
- /**
336
- * Schedules a keyboard action.
337
- *
338
- * @param {string} description A simple descriptive label for the scheduled
339
- * action.
340
- * @param {!Array<(string|!input.Key)>} keys The keys to send.
341
- * @return {!LegacyActionSequence} A self reference.
342
- * @private
343
- */
344
- scheduleKeyboardAction_(description, keys) {
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
350
- }
351
-
352
- /**
353
- * Performs a modifier key press. The modifier key is <em>not released</em>
354
- * until {@link #keyUp} or {@link #sendKeys} is called. The key press will be
355
- * targeted at the currently focused element.
356
- *
357
- * @param {!input.Key} key The modifier key to push. Must be one of
358
- * {ALT, CONTROL, SHIFT, COMMAND, META}.
359
- * @return {!LegacyActionSequence} A self reference.
360
- * @throws {error.InvalidArgumentError} If the key is not a valid modifier
361
- * key.
362
- */
363
- keyDown(key) {
364
- checkModifierKey(key)
365
- return this.scheduleKeyboardAction_('keyDown', [key])
366
- }
367
-
368
- /**
369
- * Performs a modifier key release. The release is targeted at the currently
370
- * focused element.
371
- * @param {!input.Key} key The modifier key to release. Must be one of
372
- * {ALT, CONTROL, SHIFT, COMMAND, META}.
373
- * @return {!LegacyActionSequence} A self reference.
374
- * @throws {error.InvalidArgumentError} If the key is not a valid modifier
375
- * key.
376
- */
377
- keyUp(key) {
378
- checkModifierKey(key)
379
- return this.scheduleKeyboardAction_('keyUp', [key])
380
- }
381
-
382
- /**
383
- * Simulates typing multiple keys. Each modifier key encountered in the
384
- * sequence will not be released until it is encountered again. All key events
385
- * will be targeted at the currently focused element.
386
- *
387
- * @param {...(string|!input.Key|!Array<(string|!input.Key)>)} var_args
388
- * The keys to type.
389
- * @return {!LegacyActionSequence} A self reference.
390
- * @throws {Error} If the key is not a valid modifier key.
391
- */
392
- sendKeys(var_args) { // eslint-disable-line
393
- let keys = flatten(arguments)
394
- return this.scheduleKeyboardAction_('sendKeys', keys)
395
- }
396
- }
397
-
398
- /**
399
- * Class for defining sequences of user touch interactions. Each sequence
400
- * will not be executed until {@link #perform} is called.
401
- *
402
- * This class should not be instantiated directly. Instead, obtain an instance
403
- * using {@link ./webdriver.WebDriver#touchActions() WebDriver.touchActions()}.
404
- *
405
- * Sample usage:
406
- *
407
- * new LegacyActions(driver).
408
- * tapAndHold({x: 0, y: 0}).
409
- * move({x: 3, y: 4}).
410
- * release({x: 10, y: 10}).
411
- * perform();
412
- *
413
- * @deprecated This class is strongly deprecated and will be removed once
414
- * [Google's Chrome][Chrome] and [Microsoft's Edge][Edge] browsers
415
- * support the new action sequence API.
416
- *
417
- * [Chrome]: https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md
418
- * [Edge]: https://docs.microsoft.com/en-us/microsoft-edge/webdriver
419
- */
420
- class LegacyTouchSequence {
421
- /**
422
- * @param {!./webdriver.WebDriver} driver The driver that should be used to
423
- * perform this action sequence.
424
- */
425
- constructor(driver) {
426
- /** @private {!./webdriver.WebDriver} */
427
- this.driver_ = driver
428
-
429
- /** @private {!Array<{description: string, command: !command.Command}>} */
430
- this.actions_ = []
431
- }
432
-
433
- /**
434
- * Schedules an action to be executed each time {@link #perform} is called on
435
- * this instance.
436
- * @param {string} description A description of the command.
437
- * @param {!command.Command} command The command.
438
- * @private
439
- */
440
- schedule_(description, command) {
441
- this.actions_.push({
442
- description: description,
443
- command: command,
444
- })
445
- }
446
-
447
- /**
448
- * Executes this action sequence.
449
- * @return {!Promise} A promise that will be resolved once this sequence has
450
- * completed.
451
- */
452
- async perform() {
453
- // Make a protected copy of the scheduled actions. This will protect against
454
- // users defining additional commands before this sequence is actually
455
- // executed.
456
- let actions = this.actions_.concat()
457
- for (let action of actions) {
458
- await this.driver_.execute(action.command)
459
- }
460
- }
461
-
462
- /**
463
- * Taps an element.
464
- *
465
- * @param {!./webdriver.WebElement} elem The element to tap.
466
- * @return {!LegacyTouchSequence} A self reference.
467
- */
468
- tap(elem) {
469
- let cmd = new command.Command(
470
- command.Name.LEGACY_ACTION_TOUCH_SINGLE_TAP
471
- ).setParameter('element', elem.getId())
472
-
473
- this.schedule_('tap', cmd)
474
- return this
475
- }
476
-
477
- /**
478
- * Double taps an element.
479
- *
480
- * @param {!./webdriver.WebElement} elem The element to double tap.
481
- * @return {!LegacyTouchSequence} A self reference.
482
- */
483
- doubleTap(elem) {
484
- let cmd = new command.Command(
485
- command.Name.LEGACY_ACTION_TOUCH_DOUBLE_TAP
486
- ).setParameter('element', elem.getId())
487
-
488
- this.schedule_('doubleTap', cmd)
489
- return this
490
- }
491
-
492
- /**
493
- * Long press on an element.
494
- *
495
- * @param {!./webdriver.WebElement} elem The element to long press.
496
- * @return {!LegacyTouchSequence} A self reference.
497
- */
498
- longPress(elem) {
499
- let cmd = new command.Command(
500
- command.Name.LEGACY_ACTION_TOUCH_LONG_PRESS
501
- ).setParameter('element', elem.getId())
502
-
503
- this.schedule_('longPress', cmd)
504
- return this
505
- }
506
-
507
- /**
508
- * Touch down at the given location.
509
- *
510
- * @param {{x: number, y: number}} location The location to touch down at.
511
- * @return {!LegacyTouchSequence} A self reference.
512
- */
513
- tapAndHold(location) {
514
- let cmd = new command.Command(command.Name.LEGACY_ACTION_TOUCH_DOWN)
515
- .setParameter('x', location.x)
516
- .setParameter('y', location.y)
517
-
518
- this.schedule_('tapAndHold', cmd)
519
- return this
520
- }
521
-
522
- /**
523
- * Move a held {@linkplain #tapAndHold touch} to the specified location.
524
- *
525
- * @param {{x: number, y: number}} location The location to move to.
526
- * @return {!LegacyTouchSequence} A self reference.
527
- */
528
- move(location) {
529
- let cmd = new command.Command(command.Name.LEGACY_ACTION_TOUCH_MOVE)
530
- .setParameter('x', location.x)
531
- .setParameter('y', location.y)
532
-
533
- this.schedule_('move', cmd)
534
- return this
535
- }
536
-
537
- /**
538
- * Release a held {@linkplain #tapAndHold touch} at the specified location.
539
- *
540
- * @param {{x: number, y: number}} location The location to release at.
541
- * @return {!LegacyTouchSequence} A self reference.
542
- */
543
- release(location) {
544
- let cmd = new command.Command(command.Name.LEGACY_ACTION_TOUCH_UP)
545
- .setParameter('x', location.x)
546
- .setParameter('y', location.y)
547
-
548
- this.schedule_('release', cmd)
549
- return this
550
- }
551
-
552
- /**
553
- * Scrolls the touch screen by the given offset.
554
- *
555
- * @param {{x: number, y: number}} offset The offset to scroll to.
556
- * @return {!LegacyTouchSequence} A self reference.
557
- */
558
- scroll(offset) {
559
- let cmd = new command.Command(command.Name.LEGACY_ACTION_TOUCH_SCROLL)
560
- .setParameter('xoffset', offset.x)
561
- .setParameter('yoffset', offset.y)
562
-
563
- this.schedule_('scroll', cmd)
564
- return this
565
- }
566
-
567
- /**
568
- * Scrolls the touch screen, starting on `elem` and moving by the specified
569
- * offset.
570
- *
571
- * @param {!./webdriver.WebElement} elem The element where scroll starts.
572
- * @param {{x: number, y: number}} offset The offset to scroll to.
573
- * @return {!LegacyTouchSequence} A self reference.
574
- */
575
- scrollFromElement(elem, offset) {
576
- let cmd = new command.Command(command.Name.LEGACY_ACTION_TOUCH_SCROLL)
577
- .setParameter('element', elem.getId())
578
- .setParameter('xoffset', offset.x)
579
- .setParameter('yoffset', offset.y)
580
-
581
- this.schedule_('scrollFromElement', cmd)
582
- return this
583
- }
584
-
585
- /**
586
- * Flick, starting anywhere on the screen, at speed xspeed and yspeed.
587
- *
588
- * @param {{xspeed: number, yspeed: number}} speed The speed to flick in each
589
- direction, in pixels per second.
590
- * @return {!LegacyTouchSequence} A self reference.
591
- */
592
- flick(speed) {
593
- let cmd = new command.Command(command.Name.LEGACY_ACTION_TOUCH_FLICK)
594
- .setParameter('xspeed', speed.xspeed)
595
- .setParameter('yspeed', speed.yspeed)
596
-
597
- this.schedule_('flick', cmd)
598
- return this
599
- }
600
-
601
- /**
602
- * Flick starting at elem and moving by x and y at specified speed.
603
- *
604
- * @param {!./webdriver.WebElement} elem The element where flick starts.
605
- * @param {{x: number, y: number}} offset The offset to flick to.
606
- * @param {number} speed The speed to flick at in pixels per second.
607
- * @return {!LegacyTouchSequence} A self reference.
608
- */
609
- flickElement(elem, offset, speed) {
610
- let cmd = new command.Command(command.Name.LEGACY_ACTION_TOUCH_FLICK)
611
- .setParameter('element', elem.getId())
612
- .setParameter('xoffset', offset.x)
613
- .setParameter('yoffset', offset.y)
614
- .setParameter('speed', speed)
615
-
616
- this.schedule_('flickElement', cmd)
617
- return this
618
- }
619
- }
620
-
621
- // PUBLIC API
622
-
623
- module.exports = {
624
- LegacyActionSequence,
625
- LegacyTouchSequence,
626
- }