how to force a cucumber scenario to pass?

56 views
Skip to first unread message

Deena P

unread,
Feb 2, 2018, 7:18:01 AM2/2/18
to Cukes
I have my framework integrated with JIRA, wheneven I execute scripts, it will check with JIRA for the testcase status, then will it run. If it's already passed, right now I am handling it with 

throw new SkipException("\"Scenario: \\\"\" + scenario.getName() + \"\\\" is already passed in the previous test cycle\"");

But this fails the scenario in reports.

Instead I want to show this scenario as PASS in the report. Any solution?

Thanks

Thomas Sundberg

unread,
Feb 2, 2018, 2:13:14 PM2/2/18
to Cukes
Before we suggest any solution to this, could you please share why you
don't want to run a scenario that has passed again? It did pass the
last time so there should not be any reason why it shouldn't pass
again. Unless a silly mistake has been done. The only cost is a bit
longer execution cycle. Why do you think this is a bad idea?

Please enlighten me. I am curios.
Thomas


> 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+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Thomas Sundberg
M. Sc. in Computer Science

Mobile: +46 70 767 33 15
Blog: http://www.thinkcode.se/blog
Twitter: @thomassundberg

Better software through faster feedback

Eric Kessler

unread,
Feb 2, 2018, 10:01:38 PM2/2/18
to Cukes


On Friday, February 2, 2018 at 7:18:01 AM UTC-5, Deena P wrote:
I have my framework integrated with JIRA, wheneven I execute scripts, it will check with JIRA for the testcase status, then will it run. If it's already passed, right now I am handling it with 


If you can check it's current status, could you instead not include the test in the run beforehand instead of trying to short circumvent it at run time?

 
throw new SkipException("\"Scenario: \\\"\" + scenario.getName() + \"\\\" is already passed in the previous test cycle\"");

But this fails the scenario in reports.

Instead I want to show this scenario as PASS in the report. Any solution?

Thanks


Eric K 

deena thayalan

unread,
Feb 3, 2018, 7:32:19 AM2/3/18
to cu...@googlegroups.com
Thanks for the response Thomas. 

"  I have my framework integrated with JIRA, wheneven I execute scripts, it
> will check with JIRA for the testcase status, then will it run. " - We check this condition for the same test cycle.

And I don't want to run the scenario is as I mentioned, it's getting re-run for same testing cycle. We are running a jenkins build, if there were some failed testcases due to services inconsistent, unexpected behavior or issues, we just want continue to the testing for only the failed testcases in the new build and so on.

Currently we are using JIRA for test report dashboard and above approach working fine for JIRA report, the only problem is Cucumber reports summary having the scenario as failed due to the SkipException (TestNG) or AssumeTrue method (Junit) though it hasn't run.

I am just checking if there is any option to force "pass", or skip the scenario without any errors in test summary.

Please enlighten me if you have any idea. Otherwise I will look for some other solution to achieve this requirement.

On Sat, Feb 3, 2018 at 12:42 AM, Thomas Sundberg <t...@kth.se> wrote:
On 2 February 2018 at 13:18, Deena P <deena...@gmail.com> wrote:
> I have my framework integrated with JIRA, wheneven I execute scripts, it
> will check with JIRA for the testcase status, then will it run. If it's
> already passed, right now I am handling it with
>
> throw new SkipException("\"Scenario: \\\"\" + scenario.getName() + \"\\\" is
> already passed in the previous test cycle\"");
>
>
> But this fails the scenario in reports.
>
> Instead I want to show this scenario as PASS in the report. Any solution?
>

Before we suggest any solution to this, could you please share why you
don't want to run a scenario that has passed again? It did pass the
last time so there should not be any reason why it shouldn't pass
again. Unless a silly mistake has been done. The only cost is a bit
longer execution cycle. Why do you think this is a bad idea?

Please enlighten me. I am curios.
Thomas


> 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.



--
Thomas Sundberg
M. Sc. in Computer Science

Mobile: +46 70 767 33 15
Blog: http://www.thinkcode.se/blog
Twitter: @thomassundberg

Better software through faster feedback
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/FkM5YRBi_bU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cukes+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Thanks,
Deena

Koen Prins

unread,
Feb 3, 2018, 9:52:34 AM2/3/18
to cu...@googlegroups.com
Ah, there is your problem, you are testing with underlying service inconsistencies. If the services are inconsistent, how can you trust your test results that rely on these services? Can't you mock these services and get mote reliable results?

Deena P

unread,
Feb 3, 2018, 10:39:25 AM2/3/18
to Cukes
Koen, I mention services inconsistency as an example, not all failing due to service inconsistency. If 10% testcases failed in test automation, only less than 5% failing due to services. But remaining are typical selenium/appium framework issues. The example I gave is common is any selenium/appium test automation if I am not wrong.

Thanks
Deena

> For more options, visit https://groups.google.com/d/optout.



--
Thomas Sundberg
M. Sc. in Computer Science

Mobile: +46 70 767 33 15
Blog: http://www.thinkcode.se/blog
Twitter: @thomassundberg

Better software through faster feedback
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/FkM5YRBi_bU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cukes+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Thanks,
Deena

--
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.
Reply all
Reply to author
Forward
0 new messages