android - Working with objects in a calabash-cucumber -


in process of studying calabash-cucumber testing mobile applications, question arose how work objects. testing took application ios, , here 1 of activites has 4 questions , 3 answers each question. pass next activiti, need answer these questions, , answer checkmark of option opposite question. picture looks this:

|1|0|0| or |1|0|0| |0|1|0| or |1|0|0| |0|0|1| or |1|0|0| |1|0|0| or |0|0|1| 

1 - selected option (check-box);

0 - not selected field.

there no bindings button - neither id nor text. have find coordinates. , here's question: how set object (button) given coordinates, , pass method (for example, object.touch(x, y)) in body of step? there interest check combinations, , there 81 of them (in steps much) - easier objects (you can write counter busting). here attempts, not work:

class tapper     def tap(x, y)         perform_action('click_on_screen', x, y)         #or touch(nil, {:offset => {:x => x.to_i, :y => y.to_i}})     end end  /^i touch on screen $/ |x, y|     @answer_1_1 = tapper.new     @answer_1_1.tap(802, 153) end 

the result either:

undefined step

or:

undefined method 'perform_action' object

calabash x-platform allows implement classes , object.

https://github.com/calabash/x-platform-example


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -