Scroll picker wheel

1,172 views
Skip to first unread message

Esben Rasmussen

unread,
Apr 24, 2012, 3:32:51 PM4/24/12
to calabash-ios
Hi all

I have tried to cope with the picker wheel.
How to scroll with the different wheels?
I want to be able to scroll (in my case) to a specific date.
It could be steps to scroll each wheel individually.

Please see the picker wheel here: http://dl.dropbox.com/u/21955281/PickerWheel.png

I can make the 1st wheel scroll by sending 'Then I swipe down on
number 1' but I'm not sure how to stop at the right date etc.

Any ideas?

Krukow

unread,
Apr 24, 2012, 3:56:01 PM4/24/12
to calaba...@googlegroups.com
I'll create an api for it tomorrow. If you can't wait for that you can easily create a custom step by putting together the following pieces.

piece 1: getting the currently selected date (as a string)

docs:
(explore interactively section)

code:
query("datePicker", "date").first

piece 2: Recording a touch event sequence
docs:

code/Action
- record_begin
then you should move down one of the picker wheels
- record_end("picker_down")

put it together:

 q="datePicker scrollView index:1" 
## or index:0, 2, 

playback "picker_down", :query => q


Ok?

- Karl

Esben Rasmussen

unread,
Apr 24, 2012, 5:11:09 PM4/24/12
to calabash-ios
Tried it but the query somehow can't find the picker wheel
(scrollview).

irb(main):011:0> q="datepicker scrollview index:1"
=> "datepicker scrollview index:1"
irb(main):012:0> playback "picker_year_up", :query => q
Saved screenshot: screenshot_irb.png
RuntimeError: playback failed because: query datepicker scrollview
index:1 found no views. Is accessibility enabled?

I'll wait and see what you come up with tomorrow - it's late
anyways ;-)

Thanks,
/Esben

On 24 Apr., 21:56, Krukow <karl.kru...@gmail.com> wrote:
> I'll create an api for it tomorrow. If you can't wait for that you can
> easily create a custom step by putting together the following pieces.
>
> piece 1: getting the currently selected date (as a string)
>
> docs:https://github.com/calabash/calabash-ios/wiki/01-Getting-started-guide
> (explore interactively section)
>
> code:
> query("datePicker", "date").first
>
> piece 2: Recording a touch event sequence
> docs:https://github.com/calabash/calabash-ios/wiki/04-Touch-recording-and-...

Krukow

unread,
Apr 25, 2012, 2:22:23 AM4/25/12
to calaba...@googlegroups.com
It should be scrollView not scrollview.

But I'll try to make a packaged step tonight.

- Karl

Joshua Moody

unread,
Jun 12, 2012, 10:34:15 AM6/12/12
to calaba...@googlegroups.com
hi Karl,

did you ever make a packaged step for this?

i have been working with a date picker.  i posted my efforts here: https://gist.github.com/e952bf49099279e3c212

i am interested to see how someone else tried to implement steps for interacting with pickers.


Krukow

unread,
Jun 13, 2012, 7:54:30 AM6/13/12
to calaba...@googlegroups.com
No sorry to say that, embarrassingly, I simply forgot to work on this one :)

It does seem to me that what you've done could be a good starting point for built-in picker support.

For now, I'll add to the wiki of user contributions. With time (or help) I'll integrate something built-in into calabash.

Reply all
Reply to author
Forward
0 new messages