Vaughn Dice
unread,May 17, 2012, 3:32:04 PM5/17/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Zucchini Framework
Hello,
As I write multiple screens and perform actions with them as dictated
by my feature.zucchini file, I find that I wish to add more actions to
the screen.coffee superclass. I've done so, but ran into a roadblock
(read: my lack of coffee-script knowledge!) when intending to write an
action with more than one parameter -- specifically, wanting to create
a 'Type (text) in the (field) field'. (A template I would use quite
often.)
I understand and have used the single parameter 'Type (text)' action:
'Type "([^"]*)"$': (text) ->
app.keyboard().typeString text
(Here I must add an aside: for the app I'm testing, instead of
performing a field.setValue, I've found it necessary to actually
employ the app.keyboard() to type the text -- which assumes the field
has been tapped/selected in a prior step/action)
But I'm unsure how to construct a similar action with two parameters
(text and field). The crux of my confusion lies on not understanding
the '$' character, its use and placement. My rough draft looks like:
'Type "([^"]*)" in the "([^"]*)" field$': (text, field) ->
field.tap()
app.keyboard().typeString text
Any information/tips/suggestions would be greatly appreciated. Thank
you very much for your time and energy!
Vaughn