You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to share accessToken value across all my step definition class using pico-container
Please refer below two classes TestContextApI(responsible to share accessToken value) and AuthenticationTokenSteps(calling step)
In the below example cmnMethod.getAccessToken(); returns me accessToken which i am storing in textcontext.accessToken so that i can share the value across different stepdefs.
In order to achieve this i have created constructor below AuthenticationTokenSteps and passed TextContextAPI class.
When i run the test it complaint this class doesn't have an empty or a page enabled constructor", but if you see in my AuthenticationTokenSteps class i have defined the constructor.
public class TestContextAPI {
protected String accessToken = null;
}
public class AuthenticationTokenSteps {
TestContextAPI testContext;
public AuthenticationTokenSteps(TestContextAPI testContext) {
this.testContext = testContext;
}
I am able to achieve this with cucumber by implementing same logic but i am trying to do with serenity-bdd it is complaining "this class doesn't have an empty or a page enabled constructor"
I tried to implement very simple class to retrieve token and want to share across different scenarios
public class AuthenticationTokenSteps {
}
This is my contextclass
public class TestContextAPI {
}
I dont know why it is complaining this class doesn't have an empty or a page enabled constructor. i have specified the constructor.
Please suggest how can i achieve this.
The text was updated successfully, but these errors were encountered: