Discussion:
[Cucumber] How to Fail a step in cucumber?
(too old to reply)
Ravindra Lb
2018-03-19 14:15:21 UTC
Permalink
Hello everyone,

I'm fairly new to Cucumber implementation for Selenium. I am trying to find
a solution to mark a cucumber step as "failed" so it shows up on the
cucumber extent report plugin that i am using.

Currently, the report fails only on assertion (junit) errors/exceptions and
skips the rest of the steps under a feature scenario.


Please suggest. Thanks!
--
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-03-22 10:56:22 UTC
Permalink
A cucumber scenario should fail for one of the following reasons

1. An exception, or error was thrown
2. An assertion failed

If you want to fail a scenario, throw an exception. But why would you want
to do this if your scenario is working?

All best

Andrew
Post by Ravindra Lb
Hello everyone,
I'm fairly new to Cucumber implementation for Selenium. I am trying to
find a solution to mark a cucumber step as "failed" so it shows up on the
cucumber extent report plugin that i am using.
Currently, the report fails only on assertion (junit) errors/exceptions
and skips the rest of the steps under a feature scenario.
Please suggest. Thanks!
--
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.
Koen Prins
2018-03-25 06:10:40 UTC
Permalink
Andrew,

He asks how to fail a step and, I assume, for the scenario to continue.
@Ravindra, there is no good reason to continue a scenario if a step failed.
If you want to assert each and every step in a scenarion, write seperate
scenario's for each step.
Cucumber approaches a scenario as a whole, all steps are part of the test
so if one fails, the entire test fails.
Hope this helps.

Gr,
Koen
Post by Andrew Premdas
A cucumber scenario should fail for one of the following reasons
1. An exception, or error was thrown
2. An assertion failed
If you want to fail a scenario, throw an exception. But why would you want
to do this if your scenario is working?
All best
Andrew
Post by Ravindra Lb
Hello everyone,
I'm fairly new to Cucumber implementation for Selenium. I am trying to
find a solution to mark a cucumber step as "failed" so it shows up on the
cucumber extent report plugin that i am using.
Currently, the report fails only on assertion (junit) errors/exceptions
and skips the rest of the steps under a feature scenario.
Please suggest. Thanks!
--
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
For more options, visit https://groups.google.com/d/optout.
--
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...