I see from #2111271: Add handling for fields with arrays (was: Creating Addressfields), and from reading the code, that we try to handle fields with "sub field" arrays intelligently. IE when expandEntityFields encounters a field where $value is an array with named keys, we try to set the field accordingly.

What I don't understand is how that translates into Gherkin, in writing the actual test. So how would I go about using an addressfield or similar with tabular data? I'm looking for something like this:

Given I am viewing a Profile:
| name | ohthehugemanatee |
|address | array("street" => "123 Main st.", "state" => "VA", "zip" => "12345") |

Any help is appreciated.

Comments

nielsonm’s picture

Assigned: Unassigned » nielsonm
nielsonm’s picture

Status: Active » Fixed

@ohthehugemanatee,

Instead of having an array in the feature. It would probably be better to create a custom step definition to parse the address into the field. This keeps the feature cleaner and allows the step definition to be reused easily. Here's a short into to writing custom step definitions - http://knplabs.com/blog/2011/12/05/behat-like-a-boss-wirting-custom-steps

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.