Class: Leaflet::Draw::Rails::Testing::Browser

Inherits:
Object
  • Object
show all
Defined in:
lib/leaflet-draw-rails/browser.rb

Instance Method Summary collapse

Constructor Details

#initialize(el) ⇒ Browser

Returns a new instance of Browser.



4
5
6
# File 'lib/leaflet-draw-rails/browser.rb', line 4

def initialize(el)
  @el = el
end

Instance Method Details

#click(x, y) ⇒ Object



12
13
14
15
16
# File 'lib/leaflet-draw-rails/browser.rb', line 12

def click(x, y)
  move_to(x, y)
  action.click_and_hold.perform
  action.release.perform
end

#click_and_holdObject



18
19
20
# File 'lib/leaflet-draw-rails/browser.rb', line 18

def click_and_hold
  action.click_and_hold.perform
end

#move_to(x, y) ⇒ Object



8
9
10
# File 'lib/leaflet-draw-rails/browser.rb', line 8

def move_to(x, y)
  action.move_to(native).move_by(*correct_point(x, y)).perform
end

#releaseObject



22
23
24
# File 'lib/leaflet-draw-rails/browser.rb', line 22

def release
  action.release.perform
end