Class: Selenium::WebDriver::TouchActionBuilder

Inherits:
ActionBuilder show all
Defined in:
rb/lib/selenium/webdriver/common/touch_action_builder.rb

Instance Method Summary (collapse)

Methods inherited from ActionBuilder

#click, #click_and_hold, #context_click, #double_click, #drag_and_drop, #drag_and_drop_by, #key_down, #key_up, #move_by, #move_to, #perform, #release, #send_keys

Constructor Details

- (TouchActionBuilder) initialize(mouse, keyboard, touch_screen)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of TouchActionBuilder



9
10
11
12
# File 'rb/lib/selenium/webdriver/common/touch_action_builder.rb', line 9

def initialize(mouse, keyboard, touch_screen)
  super(mouse, keyboard)
  @devices[:touch_screen] = touch_screen
end

Instance Method Details

- (Object) double_tap(element)



37
38
39
40
# File 'rb/lib/selenium/webdriver/common/touch_action_builder.rb', line 37

def double_tap(element)
  @actions << [:touch_screen, :double_tap, [element]]
  self
end

- (Object) down(x, y = nil)



47
48
49
50
# File 'rb/lib/selenium/webdriver/common/touch_action_builder.rb', line 47

def down(x, y = nil)
  @actions << [:touch_screen, :down, [x, y]]
  self
end

- (Object) flick(*args)



23
24
25
26
27
28
29
30
# File 'rb/lib/selenium/webdriver/common/touch_action_builder.rb', line 23

def flick(*args)
  unless [2,4].include? args.size
    raise ArgumentError, "wrong number of arguments, expected 2 or 4, got #{args.size}"
  end

  @actions << [:touch_screen, :flick, args]
  self
end

- (Object) long_press(element)



42
43
44
45
# File 'rb/lib/selenium/webdriver/common/touch_action_builder.rb', line 42

def long_press(element)
  @actions << [:touch_screen, :long_press, [element]]
  self
end

- (Object) move(x, y = nil)



57
58
59
60
# File 'rb/lib/selenium/webdriver/common/touch_action_builder.rb', line 57

def move(x, y = nil)
  @actions << [:touch_screen, :move, [x, y]]
  self
end

- (Object) scroll(*args)



14
15
16
17
18
19
20
21
# File 'rb/lib/selenium/webdriver/common/touch_action_builder.rb', line 14

def scroll(*args)
  unless [2,3].include? args.size
    raise ArgumentError, "wrong number of arguments, expected 2..3, got #{args.size}"
  end

  @actions << [:touch_screen, :scroll, args]
  self
end

- (Object) single_tap(element)



32
33
34
35
# File 'rb/lib/selenium/webdriver/common/touch_action_builder.rb', line 32

def single_tap(element)
  @actions << [:touch_screen, :single_tap, [element]]
  self
end

- (Object) up(x, y = nil)



52
53
54
55
# File 'rb/lib/selenium/webdriver/common/touch_action_builder.rb', line 52

def up(x, y = nil)
  @actions << [:touch_screen, :up, [x, y]]
  self
end