Module: Gametel::Webview::Accessors

Defined in:
lib/gametel/webview/accessors.rb

Instance Method Summary collapse

Instance Method Details



7
8
9
10
11
12
13
# File 'lib/gametel/webview/accessors.rb', line 7

def link(name, locator)
  index = value_or_default(locator, :index, 0)
  locator = cleanup(locator)
  define_method name  do
    platform.click_on_webview(locator.first[0], locator.first[1], index)
  end
end

#text(name, locator) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/gametel/webview/accessors.rb', line 15

def text(name, locator)
  locator = cleanup(locator)
  define_method "#{name}="  do |text|
    platform.enter_text_in_webview(locator.first[0], locator.first[1], text)
  end
  define_method "clear_#{name}" do
    platform.clear_text_in_webview(locator.first[0], locator.first[1])
  end
end