Sha256: 103d0299e6aa1abf8bffb1835c193aa45cd52bf21e0ac595e4d16afca20eaddf
Contents?: true
Size: 1.22 KB
Versions: 10
Compression:
Stored size: 1.22 KB
Contents
module Calabash module Android # Simulates pressing a *physical* button on the device. Use these methods # carefully, as only a few devices have hardware key input. They can, # however, be very useful for testing behaviour that would be hard to # replicate otherwise. # @!visibility private module PhysicalButtons # @!visibility private def press_button(key) Device.default.perform_action('press_key', key) true end # @!visibility private def press_back_button press_button('KEYCODE_BACK') end # @!visibility private def press_menu_button press_button('KEYCODE_MENU') end # @!visibility private def press_down_button press_button('KEYCODE_DPAD_DOWN') end # @!visibility private def press_up_button press_button('KEYCODE_DPAD_UP') end # @!visibility private def press_left_button press_button('KEYCODE_DPAD_LEFT') end # @!visibility private def press_right_button press_button('KEYCODE_DPAD_RIGHT') end # @!visibility private def press_enter_button press_button('KEYCODE_ENTER') end end end end
Version data entries
10 entries across 10 versions & 1 rubygems