[SpecFlow] Allow multiple parameters to be used with External Data plugin
Currently, Externa Data can only be read 1 at at a time from testdata.json and only primitive values.
So this means if I have this in the testdata.json:
{
"Emails": {
"Standard with dots": "a.b@c.com",
"Standard": "a@b.com"
},
"Names": {
"Standard with dots": "Michael",
"Standard": "John"
}
}
When I try to add more than one @property to the top of a scenario, only the first is used, the others are ignored.
So I cannot do this:
@property:name=Names
@property:email=Emails
Scenario: Check if registration works
Given I have entered <name> and <email> to the registration form
In the step definition, I would expect the second parameter to match the value of the same key (so "a.b@c.com" corresponsd with "Michael" because their keys "Standard with dots" are the same) but instead, the second parameter (email) is "<email>". So I assume it doesn't work like this.
Request: Please allow us to use multiple parameters with the same key, or even better, allow us to use objects as table parameters. The latter would allow us to do this:
{
"Registrations": {
"Standard with dots": {
"Email": "a.b@c.com",
"Name": "Michael"
},
"Standard": {
"Email": "a@b.com",
"Name": "John"
}
}
}
And then somehow use the objects as tables(?) in features:
@property:table=Registrations
Scenario: Check if registration works
Given I have entered the following data to the registration form:
|Name|Email|
That would be the best solution, albeit I don't know if it's even possible. The reason I ask for this is beacuse we are fetching data from the server that would serve as test parameters. The data depends on what server or game we are testing. This might be an edge case, but it is important for us. Let's see if others find this feature useful as well.
Best regards,
Áron
-
I don't know if you know, but SpecFlow.ExternalData is open sourced at https://github.com/SpecFlowOSS/SpecFlow/tree/master/Plugins/SpecFlow.ExternalData
1 -
Any outlook on adding JSON support to the SpecFlow.ExternalData repo?
0 -
We (the SpecFlow team) don't have it on our roadmap.
But I am happy to review any pull requests that add functionality to our open source parts.
0
Please sign in to leave a comment.
Comments
3 comments