Sharing data between Cucumber Rest Assured feature files and step definitions but they are related

29 views Asked by At

I am working on Rest Assured and Cucumber project. I have the following problem. I have feature file Cart Management in it there are following APIs: Create cart, Get Cart, Add items to cart. For better readability, I made a new feature file with a new step definitions class in which I will test Modify items in cart, Change items in cart. And here comes my problem! I'm struggling with dependency injection to share the data between step definitions classes, because the tests are connected. I call cart id which I need in other tests. Then I want to create feature file orders, which will take me cart id and others which I call after almost any forward scenarios. When I try to do it cart id is null . And three with pico container again my shared data is null. Please help! Also, can I execute feature files separately or there is no way because they are dependent on my item id, cart id and they are null?

0

There are 0 answers