-
-
Save leviwilson/5672351 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'gametel' | |
Gametel.apk_path = "../app/bin/CoPilot-debug.apk" | |
Gametel.start "_AppActivity" | |
@driver = Gametel.default_driver | |
@platform = @driver.platform | |
def tag_for(item, list, which_image=0) | |
@platform.get_view_by_index('android.widget.ListView', list) do |d| | |
d.get_child_at item, :variable => '@@the_list_item@@' | |
d.get_class | |
d.for_name 'android.widget.ImageView', :variable => '@@image_class@@' | |
d.get_current_views '@@image_class@@', '@@the_list_item@@', :target => :Robotium | |
d.get(which_image) | |
d.get_tag | |
end | |
@platform.last_json | |
end | |
def drawable_id(id) | |
@platform.chain_calls do |d| | |
d.get_current_activity | |
d.get_resources :variable => '@@resources@@' | |
d.get_identifier id, 'drawable', 'copilot.app' | |
end | |
@platform.last_json | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment