iphone - Calabash, Detect UIButton pressed state -


i want know there way detect uibutton state calabash/ruby.

ex. imagine have iphone app contains view round rect uibutton. button hold state(if pressed it, on pressed state until pressed again). want know how verify state of button calabash test

given go home screen    should see "name" button pressed 

seems found way it. ruby step functions is

then /^i should see "([^\"]*)" pressed$/ |text|     state = query("button marked:'#{text}'", :isselected)[0]     state = state.to_i     if state!=1       screenshot_and_raise "current state not pressed button: #{text}"     end     sleep(step_pause) end 

which goes steps.rb file

and in calabash feature file can call it

then should see "namebtn" pressed 

if found improvements please add. thanks


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -