Details
-
Type: Improvement
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 2.2
-
Fix Version/s: 2.5
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
We have run into some difficulty declaring steps that have similar wording such that the matching was incorrect for some of our scenarios. For example:
We have a line from one of scenarios that looks like this:
And the table.testtable with test_1_id of foo has exactly one test_2_id of bar
We want this line to match on the following step:
@Given("the $tableName with $whereColumnName of $whereColumnValue has exactly one $selectColumnName of $selectColumnValue")
But instead the match is always occuring on this step:
@Given("the $tableName with $whereColumnName of $whereColumnValue has $selectColumnName of $selectColumnValue")
where $selectColumnName gets interpreted as "exactly one test_2_id"
Can we have an annotation that indicates the order by which the matching occurs? That way, the first step in our example would always get compared first to our example input line instead of step two. For example something like this:
@Order(1)
@Given("the $tableName with $whereColumnName of $whereColumnValue has exactly one $selectColumnName of $selectColumnValue")
@Order(2)
@Given("the $tableName with $whereColumnName of $whereColumnValue has $selectColumnName of $selectColumnValue")
Activity
Field | Original Value | New Value |
---|---|---|
Fix Version/s | 2.3 [ 14941 ] | |
Fix Version/s | 2.2 [ 14670 ] |
Fix Version/s | 2.3 [ 14941 ] | |
Fix Version/s | 2.4 [ 15664 ] |
Fix Version/s | 2.5 [ 15850 ] | |
Fix Version/s | 2.4 [ 15664 ] |
Issue Type | Bug [ 1 ] | Improvement [ 4 ] |
Assignee | Mauro Talevi [ maurotalevi ] |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |
I'm not sure that we'd gain much by adding an @Order annotation.
Couldn't you just add a qualifier in the second Given step: e.g. adding "at least one" to match the "exactly one" of the other step, and thus distinguishing the two steps?