[JVM] Looping a Scenario for multiple inputs

61 views
Skip to first unread message

bibstha

unread,
Apr 27, 2012, 9:55:15 AM4/27/12
to cu...@googlegroups.com
Hi,

I want to test the following scenario for Multiple pages:

  Scenario: Price filter
    Given the User opens popular pages for search filter
    When the User selects the in Price filter
    Then the User can see the items filtered according to selected price
      And modifying the price filter would update the page according to new price values
      And clicking on Price Remove Filter will load original page

In the Given ..., I've mentioned "popular pages". The list of popular pages or URLs are stored in the database and they are around 50 URLS for which I want to run the Scenario.
The problem is I am confused where to put the loop. I can't put it in Given or When or Then because I want the loop to go through Given, When and Then completely and not just one method.

Any tips?

Andrew Premdas

unread,
Apr 28, 2012, 10:50:53 AM4/28/12
to cu...@googlegroups.com
Try,

Given there are popular pages 
# set up a hash/array of pages here in a variable


When I the price filter on these pages
 # use the array to loop over the pages, use the price filter, check the result and add that result to the pages hash/array

Then I should have no price filter errors on my pages
# use the array to loop again and collect any errors
# if there are errors report to stdout and fail
# else report success and pass

HTH

Andrew

 
-- There are two rules:
 
1) Please prefix the subject with [Ruby], [JVM] or [JS]. This allows people to filter messages.
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
 
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en



--
------------------------
Andrew Premdas
Reply all
Reply to author
Forward
0 new messages