Pico Container to share Step state in Cucumber | Simplified
Hello Everyone,
Welcome Once again to our BDD Cucumber series and Today We are going to discuss Pico Container Step by Step to share state of One Scenario to Next.
1. What is Pico Container?
A: It is one Dependency for Cucumber to achieve Constructor Dependency Injection
Let us understand the use case where we need to use Pico Container:
1. In Cucumber one scenario consists of multiple Gherkin Steps and corresponding to these steps we have java code.
2. Steps are dependent on previous steps
3. If all steps are part of one step def class there is no issue in sharing the state of previous step to next step that is easily achievable using Instance variables of class
4. What if steps belong to different step def classes? In such cases we can't straight away share the data of one step with next step.
5. So, in above case we would need Pico Container to share the state from one step in one class with next step in different class.
Let us understand from practical demonstration.
Regards,
PrinceAutomationDestination
Пікірлер: 9
Good Explanation. Keep it up! Thanks for the video.
@PrinceAutomationDestination
Ай бұрын
Welcome
Very nicely explained about dependency injection with giving proper examples. Love your content Prince!!! Keep going..
@PrinceAutomationDestination
3 күн бұрын
Thanks 🙏🏼
new stuff. extraordinary content. thanks for providing most demanded info across community
@PrinceAutomationDestination
2 ай бұрын
Sure Karthick
But will it help in parallel execution, which I believe might fail when we pass data between steps?
@PrinceAutomationDestination
2 ай бұрын
As per my understanding It wont have impact during parallel execution because i am using it in my framework and it works fine but still i will check and get back to you you
@akashmurumkar
2 ай бұрын
@@PrinceAutomationDestination thank you.. I will be waiting for your reply 👍🏻😎