[JVM] first, second, third in steps.. Transformers?

23 views
Skip to first unread message

Lennart

unread,
Feb 17, 2015, 8:37:24 AM2/17/15
to cu...@googlegroups.com
Hi, I saw there was a scalar support for transforming time into time object.

What I would like to do, is convert steps like these:

I open the first
I open the second
I open the third

into method calls of

open( int number );


Would I need to make something myself, does cucumber have any support to transform this into an int? or an enum?

Thanks in advance

aslak hellesoy

unread,
Feb 17, 2015, 8:46:14 AM2/17/15
to Cucumber Users
On Tue, Feb 17, 2015 at 1:37 PM, Lennart <lennar...@gmail.com> wrote:
Hi, I saw there was a scalar support for transforming time into time object.

What I would like to do, is convert steps like these:

I open the first
I open the second
I open the third


I suggest the following Gherkin

Given I open the 1st
Given I open the 2nd
Given I open the 3rd
Given I open the 4th
 
into method calls of

open( int number );


And the following stepdef:

@Given("I open the (\\d+)(?:st|nd|rd|th)")
public void i_open_the(int number) {
}
 
HTH,
Aslak


Would I need to make something myself, does cucumber have any support to transform this into an int? or an enum?

Thanks in advance

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lennart Tange

unread,
Feb 17, 2015, 9:08:51 AM2/17/15
to cu...@googlegroups.com
That is a perfect suggestion, thanks

You received this message because you are subscribed to a topic in the Google Groups "Cukes" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cukes/lIt8FSHiDk8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cukes+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages