Module: Gametel::Webviewable
Constant Summary collapse
- ROBOTIUM_LEFT =
21
- ROBOTIUM_RIGHT =
22
Instance Attribute Summary collapse
-
#platform ⇒ Object
readonly
Returns the value of attribute platform.
Instance Method Summary collapse
-
#click_on_text(text) ⇒ Object
click on the provided text.
-
#has_text?(text) ⇒ Boolean
Returns true if the provided text is found on the screen.
- #initialize(pform = :brazenhead) ⇒ Object
-
#scroll_down ⇒ Object
scroll down.
-
#scroll_left ⇒ Object
scroll left.
-
#scroll_right ⇒ Object
scroll right.
-
#scroll_up ⇒ Object
scroll up.
-
#wait_for_text(text_to_find) ⇒ Object
Wait for the provided text to appear.
Instance Attribute Details
#platform ⇒ Object (readonly)
Returns the value of attribute platform.
4 5 6 |
# File 'lib/gametel/webviewable.rb', line 4 def platform @platform end |
Instance Method Details
#click_on_text(text) ⇒ Object
click on the provided text
17 18 19 |
# File 'lib/gametel/webviewable.rb', line 17 def click_on_text(text) platform.click_on_text text end |
#has_text?(text) ⇒ Boolean
Returns true if the provided text is found on the screen
25 26 27 |
# File 'lib/gametel/webviewable.rb', line 25 def has_text?(text) platform.has_text?(text) end |
#initialize(pform = :brazenhead) ⇒ Object
10 11 12 |
# File 'lib/gametel/webviewable.rb', line 10 def initialize(pform = :brazenhead) @platform = Gametel::Platforms::BrazenheadPlatform.new if pform == :brazenhead end |
#scroll_down ⇒ Object
scroll down
41 42 43 |
# File 'lib/gametel/webviewable.rb', line 41 def scroll_down platform.scroll_down end |
#scroll_left ⇒ Object
scroll left
55 56 57 |
# File 'lib/gametel/webviewable.rb', line 55 def scroll_left platform.scroll_to_side ROBOTIUM_LEFT end |
#scroll_right ⇒ Object
scroll right
62 63 64 |
# File 'lib/gametel/webviewable.rb', line 62 def scroll_right platform.scroll_to_side ROBOTIUM_RIGHT end |
#scroll_up ⇒ Object
scroll up
48 49 50 |
# File 'lib/gametel/webviewable.rb', line 48 def scroll_up platform.scroll_up end |
#wait_for_text(text_to_find) ⇒ Object
Wait for the provided text to appear
33 34 35 36 |
# File 'lib/gametel/webviewable.rb', line 33 def wait_for_text(text_to_find) platform.wait_for_text(text_to_find) raise "Timed out waiting for the text '#{text_to_find}'" unless platform.last_json end |