jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JBehave
  • JBEHAVE-130

Table examples include

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.3
  • Component/s: Core
  • Labels:
    None

Description

Antony and other Fitnesse / Concordion users would like something along these lines:

Given a user Fred Bloggs with username fbloggs and password Pa55word
When fbloggs logs in with password Pa55word
Then the page should say "Welcome, Fred Bloggs!"

Other examples include:

name | username | password | attempted | message
--------------------------------------------------------------------------------------------------
Jane Brown | jbrown | F*bble | F*bble | Welcome, Jane Brown
Terri Smith | tsmith | W*bble | w*bble | Incorrect username or password
Terri Smith | tsmith | W*bble | W*bble | Welcome, Terri Smith
Fred Bloggs | fbloggs | Pa55word | Password | Incorrect username or password

where the table headings are the same as the parameters in the various steps.
–

Reckon this could be done, either by using paranamer or by catching the parameter names in the steps (which we don't do at the moment). Shouldn't be too hard. Will look at it over the weekend.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Mauro Talevi added a comment - 04/Sep/08 4:22 AM

Perhaps we could have table parser, referenced to by annotation, whereby each row of table represents a re-run of the same scenario with different parameters.

Show
Mauro Talevi added a comment - 04/Sep/08 4:22 AM Perhaps we could have table parser, referenced to by annotation, whereby each row of table represents a re-run of the same scenario with different parameters.
Hide
Permalink
Mauro Talevi added a comment - 22/Feb/09 11:57 AM

Bumping out of 2.2 release until consensus is reached on how to approach problem.

Show
Mauro Talevi added a comment - 22/Feb/09 11:57 AM Bumping out of 2.2 release until consensus is reached on how to approach problem.
Hide
Permalink
Mauro Talevi added a comment - 29/Aug/09 5:38 PM

After pairing at Agile2009 with Paul, we introduced a new optional table section in the scenario which includes all the replaceable values of a scenario template. E.g.:

Given some stocks of <prices> and a <threshold>
When one of these stocks is traded at <price>
Then the trader is alerted with <status>

Examples:

prices threshold price status
0.5,1.0 15.0 5.0 OFF
0.5,1.0 15.0 11.0 OFF
0.5,1.0 15.0 16.0 ON

The presence of the Examples: keyword (which must be found after the steps at the end of the parseable portion of each scenario) triggers the execution of the scenario for as many times as the number of table data lines (i.e. excluding the first header line).

Note that the presence of <> is purely conventional, as it signals to the scenario writer that the parameter value will be picked up from the table. The parameters are injected via @Named annotations, e.g.:

@Given("some stocks of <prices> and a <threshold>")
public void pricesWithThreshold(@Named("prices") List<Double> prices, @Named("threshold") double threshold) {
// ...
}

and it's the value of the @Named annotation that is used to read the value from the table.

Next step, is to have a similar mechanism at play using paranamer instead of annotations, so to offer developers the choice between the annotation-based and convention-based approaches.

Show
Mauro Talevi added a comment - 29/Aug/09 5:38 PM After pairing at Agile2009 with Paul, we introduced a new optional table section in the scenario which includes all the replaceable values of a scenario template. E.g.: Given some stocks of <prices> and a <threshold> When one of these stocks is traded at <price> Then the trader is alerted with <status> Examples:
prices threshold price status
0.5,1.0 15.0 5.0 OFF
0.5,1.0 15.0 11.0 OFF
0.5,1.0 15.0 16.0 ON
The presence of the Examples: keyword (which must be found after the steps at the end of the parseable portion of each scenario) triggers the execution of the scenario for as many times as the number of table data lines (i.e. excluding the first header line). Note that the presence of <> is purely conventional, as it signals to the scenario writer that the parameter value will be picked up from the table. The parameters are injected via @Named annotations, e.g.: @Given("some stocks of <prices> and a <threshold>") public void pricesWithThreshold(@Named("prices") List<Double> prices, @Named("threshold") double threshold) { // ... } and it's the value of the @Named annotation that is used to read the value from the table. Next step, is to have a similar mechanism at play using paranamer instead of annotations, so to offer developers the choice between the annotation-based and convention-based approaches.
Hide
Permalink
Mauro Talevi added a comment - 05/Sep/09 10:14 AM

Renamed feature to reflect the fact that all scenario execution are driven by the examples table, rather than only "other" examples.

Show
Mauro Talevi added a comment - 05/Sep/09 10:14 AM Renamed feature to reflect the fact that all scenario execution are driven by the examples table, rather than only "other" examples.

People

  • Assignee:
    Mauro Talevi
    Reporter:
    Elizabeth Keogh
Vote (0)
Watch (0)

Dates

  • Created:
    04/Sep/08 3:10 AM
    Updated:
    06/Sep/09 6:53 PM
    Resolved:
    06/Sep/09 6:53 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.