Skip to content

Commit

Permalink
document data table interface
Browse files Browse the repository at this point in the history
closes #427
resolves #326
  • Loading branch information
charlierudolph committed Oct 12, 2015
1 parent d8b0ae7 commit 9959ca9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,19 @@ this.Then('I should see "$title" as the page title', function (title, callback)

`'I have $count "$string"'` would translate to `/^I have (.*) "([^"]*)"$/`.

##### Data Table

When steps have a data table, they are passed an object with methods that can be used to access the data.

- with column headers
- `hashes`: returns an array of objects where each row is converted to an object (column header is the key)
- `rows`: returns the table as a 2-D array, without the first row
- without column headers
- `raw`: returns the table as a 2-D array
- `rowsHash`: returns an object where each row corresponds to an entry (first column is the key, second column is the value)

See this [feature](/features/data_tables.feature) for examples

##### Timeouts

By default, asynchronous hooks and steps timeout after 5000 milliseconds.
Expand Down
2 changes: 1 addition & 1 deletion features/data_tables.feature
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Feature: Data Tables
When I run cucumber.js with `--strict`
Then it passes

Scenario: rowHash
Scenario: rowsHash
Given a file named "features/passing_steps.feature" with:
"""
Feature: a feature
Expand Down

0 comments on commit 9959ca9

Please sign in to comment.