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

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -