scenario.write not working

414 views
Skip to first unread message

Lewis O Brien

unread,
Sep 14, 2017, 3:18:39 AM9/14/17
to Serenity BDD Users Group
Hi.

Is scenario.write supported?

I have attempted to use this but all I see in the report is "message"

My steps:
@Before
public void keepScenario(Scenario scenario) {
    this.scenario = scenario;
}

@When("^I search for a return flight from (.*) to (.*)$")
public void searchesForReturnFlight(String origin, String destination) throws Exception {
    flyer.searches_for_return_flights(origin, destination);

    scenario.write("Test");
}

But the report just displays "message", as per attached screenshot.

serenity-cucumber 1.5.4
serenity-core 1.5.9

Thanks.

John Smart

unread,
Sep 14, 2017, 3:25:18 AM9/14/17
to Lewis O Brien, Serenity BDD Users Group
This is not currently supported. Where would you expect the written text to appear?

--
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.



--
___________________________________________________
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.
___________________________________________________

Lewis O Brien

unread,
Sep 14, 2017, 3:33:28 AM9/14/17
to Serenity BDD Users Group
I wasn't sure where. Somewhere in the report, likely as a new step.

I thought it was supported based on this

So there's no way to modify the report during test execution?

In summary my tests are creating flights. I would like the ticket number to be added to the report at a high level, e.g. next to the scenario name.

On Thursday, 14 September 2017 17:25:18 UTC+10, John Smart wrote:
This is not currently supported. Where would you expect the written text to appear?
On 14 September 2017 at 08:18, 'Lewis O Brien' via Serenity BDD Users Group <thucydid...@googlegroups.com> wrote:
Hi.

Is scenario.write supported?

I have attempted to use this but all I see in the report is "message"

My steps:
@Before
public void keepScenario(Scenario scenario) {
    this.scenario = scenario;
}

@When("^I search for a return flight from (.*) to (.*)$")
public void searchesForReturnFlight(String origin, String destination) throws Exception {
    flyer.searches_for_return_flights(origin, destination);

    scenario.write("Test");
}

But the report just displays "message", as per attached screenshot.

serenity-cucumber 1.5.4
serenity-core 1.5.9

Thanks.

--
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.

John Smart

unread,
Sep 14, 2017, 3:36:22 AM9/14/17
to Lewis O Brien, Serenity BDD Users Group
You can't modify the name of the scenario during the test execution. But you could write a step method that takes the message you want to write, e.g

@Step("the ticket number is {0}")
public void recordTicketNumber(String ticketNumber){}

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.
Reply all
Reply to author
Forward
0 new messages