Forum Discussion

naveens33_'s avatar
naveens33_
Contributor
3 years ago
Solved

How to create dependency between BDD scenarios

I want my scenario should run only when the other scenario result gets passed.

For example,

In below case,  I want to make a dependency between Scenario A and B. Such that If the Scenario A get failed then Scenario B should not run rather it has to be skipped.

Note: At the same time the dependency is only between A and B so, C should run. 

 

How can we make in TestComplete. Any hope.

 

Feature: Description of the new feature1

Scenario: Scenario A
Given some precondition
When an action is performed
Then validate a condition

Scenario: Scenario B
Given some precondition
When an action is performed
Then validate a condition

Scenario: Scenario C
Given some precondition
When an action is performed
Then validate a condition

 

 

  • Hi,

     

    To my knowledge, pure BDD by design does not support dependencies.

    As a kind of workaround you may try the following:

    -- (Optionally) move dependent scenario(s) to separate file(s);

    -- Organize test items in the Execution Plan according to the required dependencies. E.g. like this:

    | Item for Scenario A

    | |- Item for Scenario B

    | Item for Scenario C

     

    -- And then set 'Stop current item' option for the On Error column in the Execution Plan editor.

     

4 Replies

  • Hi Naveen,

     

    I hope you are keeping well.

     

    In Test Complete you can use the "Treat each example in Scenario Outline as a separate test case " this can be configured in

    Tools -> Current Project Properties -> BDD and enable the following

     

    For more details here is the documentation on the properties; 

    https://support.smartbear.com/testcomplete/docs/working-with/managing-projects/properties/bdd/general.html

     

    Please let me know if this resolves your query or if you have any additional questions.

     

    Thanks,

    Shane

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    To my knowledge, pure BDD by design does not support dependencies.

    As a kind of workaround you may try the following:

    -- (Optionally) move dependent scenario(s) to separate file(s);

    -- Organize test items in the Execution Plan according to the required dependencies. E.g. like this:

    | Item for Scenario A

    | |- Item for Scenario B

    | Item for Scenario C

     

    -- And then set 'Stop current item' option for the On Error column in the Execution Plan editor.