class Gametel::Platforms::BrazenheadPlatform
Constants
- ENTER_KEY
Public Instance Methods
back()
click to toggle source
press the back button
# File lib/gametel/platforms/brazenhead_platform.rb, line 184 def back result = go_back end
clear_text(locator)
click to toggle source
clear the text in a text box
# File lib/gametel/platforms/brazenhead_platform.rb, line 65 def clear_text(locator) clear_edit_text(locator[:index]) if locator[:index] clear_text_by_id(locator[:id]) if locator[:id] end
click_checkbox(locator)
click to toggle source
click a checkbox
# File lib/gametel/platforms/brazenhead_platform.rb, line 82 def click_checkbox(locator) result = click_on_check_box(locator[:index]) if locator[:index] result = click_on_text(locator[:text]) if locator[:text] result = click_on_view_by_id(locator[:id]) if locator[:id] end
click_image(locator)
click to toggle source
click an image
# File lib/gametel/platforms/brazenhead_platform.rb, line 100 def click_image(locator) result = click_on_image(locator[:index]) if locator[:index] result = click_on_view_by_id(locator[:id]) if locator[:id] end
click_view(locator)
click to toggle source
click a view
# File lib/gametel/platforms/brazenhead_platform.rb, line 133 def click_view(locator) result = click_on_text(locator[:text]) if locator[:text] result = click_on_view_by_id(locator[:id]) if locator[:id] result = click_on_view_by_class(locator[:class], locator[:index]) if locator[:class] end
enabled?(locator)
click to toggle source
determine if a view is enabled
# File lib/gametel/platforms/brazenhead_platform.rb, line 176 def enabled?(locator) result = is_enabled_by_id(locator) result.body == 'true' end
enter()
click to toggle source
press the enter key
# File lib/gametel/platforms/brazenhead_platform.rb, line 191 def enter result = send_key ENTER_KEY end
enter_text(text, locator)
click to toggle source
enter text in a text box
# File lib/gametel/platforms/brazenhead_platform.rb, line 57 def enter_text(text, locator) enter_text_by_index(locator[:index], text) if locator[:index] enter_text_by_id(locator[:id], text) if locator[:id] end
get_spinner_value(locator)
click to toggle source
get the selected spinner value
# File lib/gametel/platforms/brazenhead_platform.rb, line 116 def get_spinner_value(locator) result = get_spinner_value_by_id(locator[:id]) if locator[:id] result = get_spinner_value_by_index(locator[:index]) if locator[:index] last_json end
get_text(locator)
click to toggle source
get text
# File lib/gametel/platforms/brazenhead_platform.rb, line 32 def get_text(locator) result = get_text_by_id(locator[:id]) if locator[:id] result = get_text_by_index(locator[:index]) if locator[:index] last_json end
get_text_description(locator)
click to toggle source
get the content description
# File lib/gametel/platforms/brazenhead_platform.rb, line 49 def get_text_description(locator) result = get_text_description_by_id(locator[:id]) last_json end
get_text_hint(locator)
click to toggle source
get the hint text
# File lib/gametel/platforms/brazenhead_platform.rb, line 41 def get_text_hint(locator) result = get_text_hint_by_id(locator[:id]) last_json end
has_drawable?(locator)
click to toggle source
return if a view has a drawable
# File lib/gametel/platforms/brazenhead_platform.rb, line 163 def has_drawable?(locator) begin view = get_view_by_id(locator[:id]) if locator[:id] view = get_image(locator[:index]) if locator[:index] last_json['hasDrawable'] rescue Exception false end end
has_text?(text)
click to toggle source
determine if text exists on the screen and visible
# File lib/gametel/platforms/brazenhead_platform.rb, line 142 def has_text?(text) result = search_text(text, true) result.body == 'true' end
has_view?(locator)
click to toggle source
determine if a view exists
# File lib/gametel/platforms/brazenhead_platform.rb, line 150 def has_view?(locator) begin result = get_view_by_id(locator[:id]) if locator[:id] result = get_view_by_index(locator[:class], locator[:index]) if locator[:class] result.body.include? 'windowLocation' rescue Exception false end end
select_spinner_value(locator, index)
click to toggle source
select the spinner value using the item’s index
# File lib/gametel/platforms/brazenhead_platform.rb, line 125 def select_spinner_value(locator, index) result = select_spinner_value_by_id(locator[:id], index) if locator[:id] result = press_spinner_item(locator[:index], index) if locator[:index] end