Closed riaan53 closed 9 years ago
I understand the problem, but not sure background example tables are the way to go. Background steps get pre-pended to each scenarios steps, but I'd have to treat a background example table differently - duplicating each scenario for every line.
I'll give it some thought and see if I can come up with an alternative
Thank you! :)
How about annotating the scenarios
@roles=['user', 'admin', 'guest']
Then running the suite or feature multiple times either from the command line
['user', 'admin', 'guest'].forEach(function(role) {
scenarios(feature.scenarios, function(scenario) {
if (scenario.annotations.indexOf(role) {
steps(scenario.steps, function(step, done) {
yadda.run(step, done);
});
});
});
});
The same approach would work at feature level too.
Another alternative would be to run the test suite multiple times and specify the role as an environment variable, e.g.
ROLE=user npm test
ROLE=admin npm test
ROLE=guest npm test
@cressie176 Thank you! I think that might do the trick :)
Hi there,
I need to be able to run the a lot of features over different backgrounds.
Will it be possible to add Where table support for the background?
Simplified example:
At the moment I need to add the same data table to every scenario, which becomes a mess if that scenario already have a Where table, or create a duplicate feature for each.
Any suggestions?
Thanks!
Regards, Riaan