Serenity data driven scenarios with SerenityStories

585 views
Skip to first unread message

Francisco Dominguez

unread,
Apr 24, 2015, 12:33:03 PM4/24/15
to thucydid...@googlegroups.com
Hello,

I have been using serenity for a couple of weeks now. I am using it with the jbehave integration/plug-in.

I have several stories that have parameters in the stories but I wanted these parameters to be loaded from a file (or an external resource) it there a way to do that other then using SerenityParameterizedRunner. Using the SerenityParameterizedRunner seems to separate the test class from the *.story file since I need to call the steps in order in the test.

I see that jbehave allows for loading parameters from a external resource:

http://jbehave.org/reference/stable/parametrised-scenarios.html

But I was wondering how to accomplish this in the context of using serenity.

If anyone could provide me some guidance it would be much appreciated.

thanks in advance,
francisco

kxramas

unread,
Dec 6, 2016, 10:38:31 AM12/6/16
to Serenity BDD Users Group
Hello Francisco,

I am looking for solution to this, have you figured it out ?

Thanks,
Kavitha

Alan Graf

unread,
Jan 25, 2017, 9:07:09 AM1/25/17
to Serenity BDD Users Group
Same here

Alan Graf

unread,
Feb 9, 2017, 2:02:46 AM2/9/17
to Serenity BDD Users Group
I have found this tutorial, but still havent tried it in serenity.

If any1 figures oiut how to do it in serenity let me know pls:
http://stackoverflow.com/questions/35555017/how-to-use-jbehave-tabular-parameters-from-external-resource

Alan Graf

unread,
Feb 9, 2017, 2:15:51 AM2/9/17
to Serenity BDD Users Group
Wohoo, i figured it out and it is quite simple:

I did the following
1. Added additional dir to src/test/resources so now that folder contains 2 folders
- stories
   - sample.story
- tables
    - sample.table
------------------------------------

and then in the story just add like this:


Scenario: ORD-SEB-011 Search for a specific Order by MSISDN
Given the user is on the Search Batch page
When the user tries to search for batches with MSISDN '<msisdn>'
Then the user should see a single search result with params orderId '<order_id>', type '<order_type>'

Examples:
tables/sample.table


------
and sample table looks like this:

|order_id     |order_type              ||msisdn        |
|123            |TEST ORDER        |1234567890 |
Reply all
Reply to author
Forward
0 new messages