On 8 January 2016 at 23:33, Mahesh Kumar Somaraju
<
mahesh...@gmail.com> wrote:
> Hi All,
>
> I did search for this topic in Google and understand the current Cucumber
> doesn't support calling scenario in a different feature file from a
> scenario. However I just wanted to give a check in the forum if there is any
> alternative solution to call other Scenarios.
>
If you mean that you would like to use a scenario from another
scenario like this
In one feature file:
Given I want to calll login scenario
In another feature file
.
.
.
Scenario: login
Given ...
When ...
Then ...
Then it is not possible. There is no way to call a scenarion from
another scenario like the attempt above.
>
> The reason for this is the scenarios so huge and its tedious job to maintain
> them all in one single feature file and most of the times we need to reuse
> the existing scenario part of other scenarios. I don't want to create a
> duplicate of same steps in all feature files.
>
Steps are global. Meaning that as long as they are in the same
classpath as the feature, all steps in all step files will be found
and the unique step that matches will be executed.
This means that you are able to divide your step definition classes in
logical chunks.
All steps can reach and use support classes. These support classes is
one way to push complexity from the step definitions and make the
steps small.
By your description, I get the feeling that you need to find common
abstractions and use them instead of trying to use an other scenario
from a scenario.
HTH
Thomas
>
> Please help me here.
>
>
> Thanks,
> Mahesh
>
>
>
> --
> 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://thomassundberg.wordpress.com/
Twitter: @thomassundberg
Better software through faster feedback