Reputation: 41
I have 2 Features 1. User Creation 2. User Enrollment both are separate and have multiple scenarios. 2nd Feature is dependent on 1st one, so when I run the 2nd Feature directly then how this feature checks the 1st Feature is already run and user created. I am using database in which creation status column (True/False) tells if user has been created or not. So, I want if i run the 2nd feature before that it runs the 1st feature for user creation.
Upvotes: 0
Views: 1602
Reputation: 21
I used reflection
You have to set the (private) field "testRunner" according to your needs of course.
Upvotes: 0
Reputation: 10209
In general, it is considered a very bad practice to have dependencies between tests and a specially features. Each test/scenario should have its own independent setup.
If your second feature depends on user creation, you could just add another step to you scenarios, e.g. "When such and such user is created."
If all scenarios under one feature share common content, you could move it up under a Background tag. For example:
Feature: User Enrollment
Background Given such and such user
Scenario When ... And ... Then...
Scenario When ... And ... Then...
Upvotes: 1