Created
March 17, 2013 17:41
-
-
Save robsquires/5182695 to your computer and use it in GitHub Desktop.
For the given gherkin feature the standard step definitions are matching not problem. However, the @Transform is not being matched. Is the syntax correct?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for the given scenario: | |
Scenario: I can drill down by product line | |
Given I have searched for "light sources" | |
And I have selected the category "led" | |
When I select the product line "Track 3" | |
Then I should see products: | |
| name | | |
| Test Product 3 | | |
| Test Product 5 | | |
this is being matched: | |
/** | |
* @When /^I select the (category) "([^"]*)"$/ | |
* @When /^I select the (product line) "([^"]*)"$/ | |
* @Given /^I have selected the (category) "([^"]*)"$/ | |
*/ | |
public function filterByThe($filter, $value){) | |
BUT this is not being matched: | |
/** | |
* @Transform /product line "([^"]*)"/ | |
*/ | |
public function lookupProductLine($name){} |
You're right, I misunderstood exactly that. I've changed this to:
/**
* @When /^I select the (product line "([^"]*)")$/
*/
public function selectTheProductLine(ProductLine $productLine){)
/**
* @When /^I select the (category "([^"]*)")$/
* @Given /^I have selected the (category "([^"]*)")$/
*/
public function filterByTheCategory(Category $category){)
...and works like a charm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's how transformations get applied:
category
,product line
+led
,Track 3
in your case)Obviously, your
product line "([^"]*)"
transformation doesn't match any ofcategory
,product line
,led
orTrack 3
strings.Key misunderstanding of yours here is that this feature is called "Argument transformations", not "Step transformations" ;)