Discussion:
[Cucumber:11145] Pending step without skipping subsequent steps
(too old to reply)
vmoravec
2012-04-25 11:44:44 UTC
Permalink
Raw Message
Hi,
what is the preferred way of skipping one step without cancelling the
whole scenario?
Sometimes I need to mark some steps as pending without cancelling the
rest of the scenario execution. Currently I must comment out the code
within the step to get the required result. The negative effect of
doing this is that there is no message in the cucumber output (similar
to 'pending' ) about having an empty step definition. I am curious
what others has been doing in order to get such behaviour.
thanks.
vlad
--
You received this message because you are subscribed to the Google Groups "Cukes" group.
To post to this group, send email to cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/cukes?hl=en.
Julien Biezemans
2012-04-25 18:15:09 UTC
Permalink
Raw Message
Post by vmoravec
Hi,
what is the preferred way of skipping one step without cancelling the
whole scenario?
I never *skip* steps. Can you share an example of a situation where you'd
need that?
Post by vmoravec
Sometimes I need to mark some steps as pending without cancelling the
rest of the scenario execution. Currently I must comment out the code
within the step to get the required result. The negative effect of
doing this is that there is no message in the cucumber output (similar
to 'pending' ) about having an empty step definition. I am curious
what others has been doing in order to get such behaviour.
thanks.
vlad
--
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/cukes?hl=en.
-- There are two rules:

1) Please prefix the subject with [Ruby], [JVM] or [JS]. This allows people to filter messages.
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style

You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
vmoravec
2012-04-26 09:25:30 UTC
Permalink
Raw Message
Post by Julien Biezemans
I never *skip* steps. Can you share an example of a situation where you'd
need that?
We are a small team, let's say we have two devs, one is working on
hacking the product, while the other is writting the cucumber tests.
Sometimes I find a bug by failing step in the latest commit in repo I
work on, however I would like to skip that failing step while testing
and developing other stuff within the same scenario. Marking a
scenario with a tag is not the way to go, I would need to 'skip' that
step to get the subsequent steps executed when such failure does not
limit the correct results of the whole scenario.

If the bug is not trivial, I have to work with a commented out code in
the repository over couple of days. If I do not comment out the
failing line[s], I cannot test the rest of the scenario if am
currently working on it.

In Rspec you can find a pending examples approach where no exceptions
are being raised and we get a notice about an unimplemented stuff.
Post by Julien Biezemans
Post by vmoravec
Sometimes I need to mark some steps as pending without cancelling the
rest of the scenario execution. Currently I must comment out the code
within the step to get the required result. The negative effect of
doing this is that there is no message in the cucumber output (similar
to 'pending' ) about having an empty step definition. I am curious
what others has been doing in order to get such behaviour.
thanks.
vlad
--
You received this message because you are subscribed to the Google Groups
"Cukes" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/cukes?hl=en.
-- There are two rules:

1) Please prefix the subject with [Ruby], [JVM] or [JS]. This allows people to filter messages.
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style

You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
aslak hellesoy
2012-04-26 09:48:03 UTC
Permalink
Raw Message
Post by vmoravec
Post by Julien Biezemans
I never *skip* steps. Can you share an example of a situation where you'd
need that?
We are a small team, let's say we have two devs, one is working on
hacking the product, while the other is writting the cucumber tests.
Sometimes I find a bug by failing step in the latest commit in repo I
work on, however I would like to skip that failing step while testing
and developing other stuff within the same scenario. Marking a
scenario with a tag is not the way to go, I would need to 'skip' that
step to get the subsequent steps executed when such failure does not
limit the correct results of the whole scenario.
If the bug is not trivial, I have to work with a commented out code in
the repository over couple of days. If I do not comment out the
failing line[s], I cannot test the rest of the scenario if am
currently working on it.
In Rspec you can find a pending examples approach where no exceptions
are being raised and we get a notice about an unimplemented stuff.
A step can have the following results:

* undefined (no matching stepdef)
* pending (a matching stepdef that throws PendingException)
* passed (a matching stepdef that doesn't throw anything)
* failed (a matching stepdef that throws an exception that isn't
PendingException)
* skipped (a step following a step that threw any exception
(undefined, pending or failed))

What you're asking for is a new kind of result - ignored. It could be
implemented by throwing an IgnoredException.
This would mean that skipped would have to be changed to: (a step
following a step that threw any exception (undefined, pending or
failed) - unless the exception was IgnoredException)

I'm not sure I like this. It sounds like more complicated than it
needs to be. You already have the necessary information that something
is amiss - your step will either fail or be pending. I don't see the
value in continuing to execute the following steps. You still have to
implement the failing/pending step.

As long as you're reminded that "there is work to be done here" I
don't think it's wortwhile complicating Cucumber to tell you what kind
of work needs to be done...

Aslak
Post by vmoravec
Post by Julien Biezemans
Post by vmoravec
Sometimes I need to mark some steps as pending without cancelling the
rest of the scenario execution. Currently I must comment out the code
within the step to get the required result. The negative effect of
doing this is that there is no message in the cucumber output (similar
to 'pending' ) about having an empty step definition. I am curious
what others has been doing in order to get such behaviour.
thanks.
vlad
--
You received this message because you are subscribed to the Google Groups
"Cukes" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/cukes?hl=en.
1) Please prefix the subject with [Ruby], [JVM] or [JS]. This allows people to filter messages.
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
-- There are two rules:

1) Please prefix the subject with [Ruby], [JVM] or [JS]. This allows people to filter messages.
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style

You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
vmoravec
2012-04-26 15:11:05 UTC
Permalink
Raw Message
...
Post by aslak hellesoy
What you're asking for is a new kind of result - ignored. It could be
implemented by throwing an IgnoredException.
This would mean that skipped would have to be changed to: (a step
following a step that threw any exception (undefined, pending or
failed) - unless the exception was IgnoredException)
Correct.
Post by aslak hellesoy
I'm not sure I like this. It sounds like more complicated than it
needs to be. You already have the necessary information that something
is amiss - your step will either fail or be pending. I don't see the
value in continuing to execute the following steps. You still have to
implement the failing/pending step.
Marking a step ignored does not have to mean that the step is failing
or pending.
I would see it more like a help/tool for the developer to ignore the
step because
the dev or app environment or even the developer need such a
workflow.

I think I could provide a better example for such use case as the one
above.
Sometimes we have scenarios or backgrounds with steps that modify
server environment or application state which is not possible or easy
to replicate (virtual server configurations). Such steps are located
in different *_steps.rb files which makes them easy to be ignored by
the commits concerning some special feature with its own scenarios and
steps.
Post by aslak hellesoy
As long as you're reminded that "there is work to be done here" I
don't think it's wortwhile complicating Cucumber to tell you what kind
of work needs to be done...
It does not have to be a reminder of work to be done. It could be
simply a reminder of a step being ignored on a special purpose by
developer for himself.

Vlad
Post by aslak hellesoy
Post by Julien Biezemans
Post by vmoravec
Sometimes I need to mark some steps as pending without cancelling the
rest of the scenario execution. Currently I must comment out the code
within the step to get the required result. The negative effect of
doing this is that there is no message in the cucumber output (similar
to 'pending' ) about having an empty step definition. I am curious
what others has been doing in order to get such behaviour.
thanks.
vlad
--
You received this message because you are subscribed to the Google Groups
"Cukes" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/cukes?hl=en.
1) Please prefix the subject with [Ruby], [JVM] or [JS]. This allows people to filter messages.
2) Please use interleaved answershttp://en.wikipedia.org/wiki/Posting_style#Interleaved_style
-- There are two rules:

1) Please prefix the subject with [Ruby], [JVM] or [JS]. This allows people to filter messages.
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style

You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
George Dinwiddie
2012-04-26 10:14:56 UTC
Permalink
Raw Message
Vlad,
Post by vmoravec
Post by Julien Biezemans
I never *skip* steps. Can you share an example of a situation where you'd
need that?
We are a small team, let's say we have two devs, one is working on
hacking the product, while the other is writting the cucumber tests.
Sometimes I find a bug by failing step in the latest commit in repo I
work on, however I would like to skip that failing step while testing
and developing other stuff within the same scenario. Marking a
scenario with a tag is not the way to go, I would need to 'skip' that
step to get the subsequent steps executed when such failure does not
limit the correct results of the whole scenario.
It sounds like you're trying to drive all of your development from
Cucumber. I drive story acceptance with Cucumber, but I drive much of
the development from a lower level BDD or unit test framework such as
rspec or junit.
Post by vmoravec
If the bug is not trivial, I have to work with a commented out code in
the repository over couple of days. If I do not comment out the
failing line[s], I cannot test the rest of the scenario if am
currently working on it.
In such a situation, I would I would mark the scenario Pending if I did
not want to address the bug immediately. More likely, I would address
the bug as soon as I ran the scenario after inserting the defect.

I'm curious about the level of detail in your Cucumber scenarios,
though. Mine are generally 2 to 4 lines long. It's rather exceptional
that I would be checking enough things in one scenario that it would get
in my way for checking something else. That makes me curious about what
causes this to happen for you.

- George
--
----------------------------------------------------------------------
* George Dinwiddie * http://blog.gdinwiddie.com
Software Development http://www.idiacomputing.com
Consultant and Coach http://www.agilemaryland.org
----------------------------------------------------------------------

-- There are two rules:

1) Please prefix the subject with [Ruby], [JVM] or [JS]. This allows people to filter messages.
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style

You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
vmoravec
2012-04-26 15:38:18 UTC
Permalink
Raw Message
Post by George Dinwiddie
It sounds like you're trying to drive all of your development from
Cucumber. I drive story acceptance with Cucumber, but I drive much of
the development from a lower level BDD or unit test framework such as
rspec or junit.
Not at all, the code has been written for months, we're trying to test
the overall customer experience from top to bottom and back. We're
using ruby Test::Unit and friends for that.
Post by George Dinwiddie
Post by vmoravec
If the bug is not trivial, I have to work with a commented out code in
the repository over couple of days. If I do not comment out the
failing line[s], I cannot test the rest of the scenario if am
currently working on it.
In such a situation, I would I would mark the scenario Pending if I did
not want to address the bug immediately. More likely, I would address
the bug as soon as I ran the scenario after inserting the defect.
I'm curious about the level of detail in your Cucumber scenarios,
though. Mine are generally 2 to 4 lines long. It's rather exceptional
that I would be checking enough things in one scenario that it would get
in my way for checking something else. That makes me curious about what
causes this to happen for you.
This is a very good point. I have been trying to rewrite some of the
scenarios and it had some positive impact on the testing workflow,
thanks for this.

However, the reason for temporarily ignoring one step is perhaps due
to the specific nature of the test environment - which is not limited
to the application but accross several virtual/physical servers.
Ignoring some steps makes life easier for me as a developer writing
these cucumber scenarios and steps; it helps me to concentrate on
specific details and let me ignore complex server deployment strategy
temporarily.

Vlad
Post by George Dinwiddie
--
  ----------------------------------------------------------------------
   * George Dinwiddie *                      http://blog.gdinwiddie.com
   Software Development                    http://www.idiacomputing.com
   Consultant and Coach                    http://www.agilemaryland.org
  ----------------------------------------------------------------------
-- There are two rules:

1) Please prefix the subject with [Ruby], [JVM] or [JS]. This allows people to filter messages.
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style

You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
Oscar Rieken
2012-04-26 16:18:51 UTC
Permalink
Raw Message
I am still a bit puzzled.
I would think that your steps would describe

The initial state of the application
changes made to the application
the expected results of those changes to the application

I dont see how you can go from an initial state and end up with the same
expected results without doing those actions

Given I am logged in with a valid account
When I deposit 10.00
Then I should have 10.00 balance on my account

that example is kinda simple but if i skip the "When" the "Then" would
fail. maybe your examples are much more complex I'm sure. or maybe I am
missing something.
Post by vmoravec
Post by George Dinwiddie
It sounds like you're trying to drive all of your development from
Cucumber. I drive story acceptance with Cucumber, but I drive much of
the development from a lower level BDD or unit test framework such as
rspec or junit.
Not at all, the code has been written for months, we're trying to test
the overall customer experience from top to bottom and back. We're
using ruby Test::Unit and friends for that.
Post by George Dinwiddie
Post by vmoravec
If the bug is not trivial, I have to work with a commented out code in
the repository over couple of days. If I do not comment out the
failing line[s], I cannot test the rest of the scenario if am
currently working on it.
In such a situation, I would I would mark the scenario Pending if I did
not want to address the bug immediately. More likely, I would address
the bug as soon as I ran the scenario after inserting the defect.
I'm curious about the level of detail in your Cucumber scenarios,
though. Mine are generally 2 to 4 lines long. It's rather exceptional
that I would be checking enough things in one scenario that it would get
in my way for checking something else. That makes me curious about what
causes this to happen for you.
This is a very good point. I have been trying to rewrite some of the
scenarios and it had some positive impact on the testing workflow,
thanks for this.
However, the reason for temporarily ignoring one step is perhaps due
to the specific nature of the test environment - which is not limited
to the application but accross several virtual/physical servers.
Ignoring some steps makes life easier for me as a developer writing
these cucumber scenarios and steps; it helps me to concentrate on
specific details and let me ignore complex server deployment strategy
temporarily.
Vlad
Post by George Dinwiddie
--
----------------------------------------------------------------------
* George Dinwiddie * http://blog.gdinwiddie.com
Software Development http://www.idiacomputing.com
Consultant and Coach http://www.agilemaryland.org
----------------------------------------------------------------------
1) Please prefix the subject with [Ruby], [JVM] or [JS]. This allows
people to filter messages.
2) Please use interleaved answers
http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group, send email to
https://groups.google.com/d/forum/cukes?hl=en
-- There are two rules:

1) Please prefix the subject with [Ruby], [JVM] or [JS]. This allows people to filter messages.
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style

You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
George Dinwiddie
2012-04-27 12:27:11 UTC
Permalink
Raw Message
Vlad,
Post by vmoravec
However, the reason for temporarily ignoring one step is perhaps due
to the specific nature of the test environment - which is not limited
to the application but accross several virtual/physical servers.
Ignoring some steps makes life easier for me as a developer writing
these cucumber scenarios and steps; it helps me to concentrate on
specific details and let me ignore complex server deployment strategy
temporarily.
I guess I'm still not following what you're trying to accomplish. Can
you give a concrete example of a scenario where you would want to ignore
a step?

- George
--
----------------------------------------------------------------------
* George Dinwiddie * http://blog.gdinwiddie.com
Software Development http://www.idiacomputing.com
Consultant and Coach http://www.agilemaryland.org
----------------------------------------------------------------------

-- There are two rules:

1) Please prefix the subject with [Ruby], [JVM] or [JS]. This allows people to filter messages.
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style

You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
Faraz
2012-07-08 16:59:45 UTC
Permalink
Raw Message
I think "configuration over convention" is reason enough. Here's the trick
I've used on occasion more so with scenarios then steps however.

When /^WHATEVER_YOU_LIKE/ do
pending
end


Just swap When with the relevant keyword (Given/When/And/Then) and swap
WHAT_EVER_YOU_LIKE with some string that you'll prefix all the steps you
want to appear as pending.

Then PENDING I should see a shiny apple


Cheers,
Faraz
Post by George Dinwiddie
Vlad,
Post by vmoravec
However, the reason for temporarily ignoring one step is perhaps due
to the specific nature of the test environment - which is not limited
to the application but accross several virtual/physical servers.
Ignoring some steps makes life easier for me as a developer writing
these cucumber scenarios and steps; it helps me to concentrate on
specific details and let me ignore complex server deployment strategy
temporarily.
I guess I'm still not following what you're trying to accomplish. Can
you give a concrete example of a scenario where you would want to ignore
a step?
- George
--
----------------------------------------------------------------------
* George Dinwiddie * http://blog.gdinwiddie.com
Software Development http://www.idiacomputing.com
Consultant and Coach http://www.agilemaryland.org
----------------------------------------------------------------------
-- 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 cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
s***@gmail.com
2018-08-19 09:12:16 UTC
Permalink
Raw Message
George
Post by George Dinwiddie
I guess I'm still not following what you're trying to accomplish. Can
you give a concrete example of a scenario where you would want to ignore
a step?
We run our Cucumber tests on Fake backend (just mock server) OR Real
backend (database) by using different parameters.
Some of our tests have additional steps only for real backend (e.g. to
check that changes performed also in the database, not only on the UI side).
So, we have a special condition: if we run test on Real backend - all steps
should be executed, if we run test on Fake backend - steps for real backend
should be ignored.
How can we do it in Cucumber without separation (duplication) our tests for
fake and real backend?
I think, the 'Ignored' step status is a good idea and can use in different
situations.
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Andrew Premdas
2018-08-19 11:34:36 UTC
Permalink
Raw Message
Post by George Dinwiddie
George
Post by George Dinwiddie
I guess I'm still not following what you're trying to accomplish. Can
you give a concrete example of a scenario where you would want to ignore
a step?
We run our Cucumber tests on Fake backend (just mock server) OR Real
backend (database) by using different parameters.
Some of our tests have additional steps only for real backend (e.g. to
check that changes performed also in the database, not only on the UI side).
So, we have a special condition: if we run test on Real backend - all
steps should be executed, if we run test on Fake backend - steps for real
backend should be ignored.
How can we do it in Cucumber without separation (duplication) our tests
for fake and real backend?
I think, the 'Ignored' step status is a good idea and can use in different
situations.
The way to deal with this is to push the decision down the stack (ideally
into a helper for your step definition class, and use the same step in your
scenario. Your implementation can then make the decision about what to
execute. An easy way to control this would be by an environment variable.

Your scenarios should have no knowledge about HOW they are run, or even HOW
the application works. They should be about WHAT the application does and
WHY its important. If you push the details down you'll have a much better
experience with Cucumber.

All best

Andrew
Post by George Dinwiddie
--
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
For more options, visit https://groups.google.com/d/optout.
--
------------------------
Andrew Premdas
blog.andrew.premdas.org
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...