Hello fellow Cukers!I have a bit of a quandary on my hands, hoping you call can help. I'm in the process of advocating that we switch to Cucumber internally to test our API[1]. I think this makes a lot of sense, as our product is an API, so the language-neutral aspect of Cucumber is really appealing. And I'm really happy with the few scenarios I've worked out so far. But I have a problem....Our API relies on hypermedia. This means that we need to often make scenarios that are dependent on previous ones. Basically, GivenScenario from long, long ago is exactly what I want.For example, I may have a scenario around creating a new credit card in our system. I then want to make a scenario that creates a card, and then uses the URL in the response to create a second request to charge that card. I'd want a third scenario that creates a card, then uses the URL in the response to create a second request to change the address on the card. I'd want a third scenario which creates a card...
Now: I _could_ make the dependencies in Ruby, and call them from previous ones. But then the Ruby version may get out of synch with the scenario version. I _could_ make it so that the common steps are in Background, but then I'd be organizing according to Backgrounds and not use cases, which is what I'd prefer. I could just duplicate everything in every case, but that seems bad too, if something changes, it'd have to change everywhere...What should I do here? I think API testing is a really interesting use case for Cucumber, and I'm specifically trying to build better tooling for the hypermedia case. I totally get why 'normally' this would be bad.Thoughts? Thank you for your time.- Steve
--
-- Rules --
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
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/groups/opt_out.
Hello fellow Cukers!I have a bit of a quandary on my hands, hoping you call can help. I'm in the process of advocating that we switch to Cucumber internally to test our API[1]. I think this makes a lot of sense, as our product is an API, so the language-neutral aspect of Cucumber is really appealing. And I'm really happy with the few scenarios I've worked out so far. But I have a problem....Our API relies on hypermedia. This means that we need to often make scenarios that are dependent on previous ones. Basically, GivenScenario from long, long ago is exactly what I want.For example, I may have a scenario around creating a new credit card in our system. I then want to make a scenario that creates a card, and then uses the URL in the response to create a second request to charge that card. I'd want a third scenario that creates a card, then uses the URL in the response to create a second request to change the address on the card. I'd want a third scenario which creates a card...
--
-- Rules --
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
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/groups/opt_out.
Given I have an active credit card associated with my accountwould create an account, create a card and associate the two. Push the details of how the account and card are created and associated down into the support code.The support code may well create the domain entities through the API. In some environments, however, it may be possible to take shortcuts and create the entities directly in the database.
Yes, "workflows" might be a better way of phrasing what I'm trying to do.Your "given" makes sense, but how do I make sure that it doesn't get out of step with the Scenario that represents the same given? Do you just assume that there's duplication and make sure to change them both?
I am concerned about 1. My natural programmer instinct is 'duplication
is bad and will lead to bad things.'
Maybe I can live with it in this case.
--
-- Rules --
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
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/groups/opt_out.
I am concerned about 1. My natural programmer instinct is 'duplication
is bad and will lead to bad things.'
Maybe I can live with it in this case.
On Wednesday, 11 December 2013 at 13:08, Matt Wynne wrote:
On 10 Dec 2013, at 18:56, Steve Klabnik <st...@steveklabnik.com> wrote:Yes, this list has been exceedingly helpful, as well as on the Issues thread.
I knew I was about to do this, which is one of the reasons that the
"Rails 4 in Action" thread bummed me out; it made me look very
anti-Cukes when I knew I was about to end up advocating directly for
it shortly... heh.Good, glad we could help.Since you mention it, what bothers me about the Rails 4 in Action thing is not so much how *you* look, but the message that throwaway comment sends to new Ruby / Rails programmers. If a book tells them the community is moving away from Cucumber, they're less likely to try it out.
I'd be very grateful if you could get it pulled out, but I do understand what publishing schedules are like :)
--
-- Rules --
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
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/groups/opt_out.
--
-- Rules --
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
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/groups/opt_out.
Btw, what is this statement based on? Cucumber Gem download stats have been steadily increasing.
When presented as a collaboration tool rather than a testing tool, I
think Cukes makes a lot more sense. But there have been a lot of
people advocating for bad cukes over the years, we all remember
web_steps.rb.
Steve,On 11 Dec 2013, at 11:21, Steve Klabnik <st...@steveklabnik.com> wrote:Btw, what is this statement based on? Cucumber Gem download stats have been steadily increasing.When presented as a collaboration tool rather than a testing tool, I
think Cukes makes a lot more sense. But there have been a lot of
people advocating for bad cukes over the years, we all remember
web_steps.rb.Do you think we need to do more outreach work to spread this message at Ruby conferences?It's five years now since mabes wrote http://benmabey.com/2008/05/19/imperative-vs-declarative-scenarios-in-user-stories.html and over two years since http://aslakhellesoy.com/post/11055981222/the-training-wheels-came-off. I think I may be guilty of assuming, from inside my bubble, that everyone already knows this stuff.Maybe I should take the mortgage-driven talk to Ruby / Rails conf? http://skillsmatter.com/podcast/agile-testing/refuctoring-your-cukes
Cucumber usage is so immature. There are parallels with rails. Most cukers are writing fat controllers and putting their logic in views. Some have moved onto fat models. Only a few are creating their own service level objects.
[Tim] Cucumber (Like Fit/Fitnesse/Specflow) is not a testing tool. It is a requirements tool.