Class: Gametel::Views::WebView

Inherits:
View
  • Object
show all
Defined in:
lib/gametel/views/web_view.rb

Instance Attribute Summary

Attributes inherited from View

#locator, #platform

Instance Method Summary collapse

Methods inherited from View

#initialize, #raw_view, #view_class

Constructor Details

This class inherits a constructor from Gametel::Views::View

Instance Method Details

#clear_text(how, what) ⇒ Object



19
20
21
# File 'lib/gametel/views/web_view.rb', line 19

def clear_text(how, what)
  platform.clear_text_in_webview(how, what)
end

#click(how, what, index = 0, scroll = true) ⇒ Object



5
6
7
# File 'lib/gametel/views/web_view.rb', line 5

def click(how, what, index=0, scroll=true)
  platform.click_on_webview(how, what, index, scroll)
end

#enter_text(how, what, text) ⇒ Object



9
10
11
# File 'lib/gametel/views/web_view.rb', line 9

def enter_text(how, what, text)
  platform.enter_text_in_webview(how, what, text)
end

#has_element?(how, what) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
32
# File 'lib/gametel/views/web_view.rb', line 29

def has_element?(how, what)
  platform.get_web_views_by(how, what, :target => :Brazenhead)
  not platform.last_json.empty?
end

#type_text(how, what, text, index = 0) ⇒ Object



13
14
15
16
17
# File 'lib/gametel/views/web_view.rb', line 13

def type_text(how, what, text, index=0)
  find_element_by(how, what) do |device, by| 
    device.type_text_in_web_element(by, text, index, :target => :Robotium)
  end
end

#wait_for_element(how, what, timeout = 20, scroll = true) ⇒ Object



23
24
25
26
27
# File 'lib/gametel/views/web_view.rb', line 23

def wait_for_element(how, what, timeout=20, scroll=true)
  find_element_by(how, what) do |device, by|
    device.wait_for_web_element(by, timeout, scroll, :target => :Robotium)
  end
end