Virus
Virus

Reputation: 3415

External data source with specflow

I find entering the data in the feature file of specflow very painful specially when it is repetitive and large data. Can we use an external data source like spreadsheet to enter this data and then use this external datasource in the feature file?

Upvotes: 1

Views: 1141

Answers (1)

AlSki
AlSki

Reputation: 6961

It's theoretically possible, but probably so much effort that you wouldn't want to do it.

The problem is that the feature file is simply a human readable form. When it is saved in Visual Studio it is parsed and converted into the feature.cs file and that is the one that is compiled and used for testing.

So your process would become

  • edit spreadsheet
  • export to feature file
  • get specflow's VS plugin to convert to feature.cs
  • run msbuild
  • run tests via Nunit or similar

I wouldn't do this. Instead I'd focus on getting my tests to be better examples. It sounds like you are to trying to exhaustively cover every possibility. Don't come up with examples to cover every possible case, but instead cover as much logic as possible with fewer tests.

Upvotes: 1

Related Questions