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'm having a cucumber feature file, a test case linked with feature file and step classes, and further step classes. I'd like to exchange serenity session variable between the step classes.
StepClass1:
Object object1 = new Object(); // Pseudo code
@Before
public void setup() {
Serenity.setSessionVariable("object1").to(object1);
}
Unfortunately, the session variable "object1" is null when called in StepClass2. How can I solve this problem? And how can I control the order of step classes setups called?
I'm using serenity version 3.2.5.
Thanks and regards, André
The text was updated successfully, but these errors were encountered:
I found out that "serenity.maintain.session" needs to be set to true. Does this imply the session variable is known in all other running tests of the test suite, too?
It seems that the order I'm defining the "glue" in the test case is defining the order the step classes setups are called. Can you confirm my assumption?
TestClass:
@RunWith(CucumberWithSerenity.class)
@CucumberOptions(
features = "classpath:/features/MySerenity.feature",
glue = {"path.to.step.class.1",
"path.to.step.class.2",
"path.to.step.class.3"})
public class MySerenityTest extends BaseTest {
}
Hi there,
I'm having a cucumber feature file, a test case linked with feature file and step classes, and further step classes. I'd like to exchange serenity session variable between the step classes.
StepClass1:
StepClass2:
Unfortunately, the session variable "object1" is null when called in StepClass2. How can I solve this problem? And how can I control the order of step classes setups called?
I'm using serenity version 3.2.5.
Thanks and regards, André
The text was updated successfully, but these errors were encountered: