--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-users+unsubscribe@googlegroups.com.
To post to this group, send email to thucydides-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks, John. I've already integrated Spring and injected a Steps object with @Autowired instead of using @Steps. In this case, Report didn't display each steps when an error occurred. For example,
class TestDefinition {
@Autowired
private TestSteps testSteps;
@When("...")
public when() {
testSteps.step1();
testSteps.step2(); // <- Exceptions?
}
}
class TestSteps extends ScenarioSteps {
@Step
public step1() {
// call REST API with RestAssured
}
@Step
public step2() {
// call REST API with RestAssured
}
}
If exception occurred testSteps.step2() in when(), Report will not display result of testSteps.step1(). Just I want to know the result of sub steps.
___________________________________________________
Sorry, I misunderstood
@Autowired and @Steps are not interchangable, but you can use @Autowired inside a steps library if you set up the Spring configuration appropriately.
--
___________________________________________________
John Smart | Wakaleo Consulting | +44 7398 832273
Making smart teams collaborate better
http://johnfergusonsmart.com | john....@wakaleo.com
___________________________________________________
We love breaking down silos and helping smart teams collaborate better! Ask about our tailored on-site workshops in Agile Product Planning, BDD Requirements Discovery, BDD, TDD and Clean Coding, and Advanced BDD Test Automation.
Need some help with Serenity BDD? Check out our Serenity BDD training and support packages here.
___________________________________________________
I found the example here.
It have to annotate with @ContextConfiguration both parent and nested Steps.
Thanks,
Kyoungwook
___________________________________________________
Serenity will honour the Spring @Autowired annotation - check the documentation regarding Spring integration.
On 3 April 2017 at 08:13, Kyoungwook Park <siri...@gmail.com> wrote:
Hi, all.AFAIK, we can automatically inject steps class with @Steps. I want to inject some other dependencies for each Steps object. I was wondering if there's a way to do it, or I can pass a dependency with constructors in Steps class. The final goal is to inject dependency like @Autowired like Spring.Any ideas?
--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-use...@googlegroups.com.
To post to this group, send email to thucydid...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.