0
votes

In SpecFlow I have several scenario outlines. I've added a "scenario" column to my examples table with a description of each example so that in the Test Explorer the test name is a combination of the Scenario Outline name plus the description (rather than "Scenario Outline Name Variant #"). I've ran into a situation where the description for one of my outlines is apparently really long and the Test Explorer won't populate it. Instead just getting the Variant # naming convention.

Is there a character limit in Test Explorer for names? I'm assuming it is a Test Explorer problem since SpecFlow doesn't have its own Test Explorer. I'm on SpecFlow v3 and VS 2019 btw.

1

1 Answers

0
votes

Through some trouble-shooting, I found out if you have three or more in a row descriptions that are "similar" in wording in the beginning of the description then the Test Explorer will go to Variant #. If you put some variation in the beginning of the description (like change one character), Test Explorer will generate all of the names.

My existing descriptions

Equals 'BlobBlob' With Name 'BlobBlob' and Amount Less Than CutOff Amount
Equals 'BlobBlob' With Name 'BlobBlob' and Amount Equal To CutOff Amount
Equals 'BlobBlob' With Name 'BlobBlob' and Amount Greater Than CutOff Amount

And if you can afford to do so, change it just a tad (You only have to change one in a group of three)

Equals 'BlobBlob**a**' With Name 'BlobBlob**a**' and Amount Equal To CutOff Amount
Equals 'BlobBlob' With Name 'BlobBlob' and Amount Greater Than CutOff Amount
Equals 'BlobBlob' With Name 'BlobBlob' and Amount Greater Than CutOff Amount

Technically it isn't a solution but it serves as a good workaround. The fact that a person is able to do this and still pass their tests is a +1 that their code is testable.