1
votes

I'm using Specflow Scenario Outline to run a list of different urls using Examples. However when checking Test Explorer the naming convention for each example is taking the last word after the full stop. I've tried finding something to do with formatting but run in to a dead end and couldn't find anything in here that matches my particular problem.

For example www.test.co.uk is showing as just 'uk in TestFeature'

Unfortunately in my test the URL is the unique value so when it comes to reporting it is clear what urls have been tested in the scenario...otherwise I would've used the Client name.

Packages in Solution include: NUnit, Specflow, SpecRun

Scenario Outline example below:

Scenario Outline: The login page for a given client is displayed when navigated to it
When I load the URL '<URL>'
Then The login page is displayed for client '<Client>'
Examples:
| URL                     | Client    |
| http://www.test1.co.uk  | Someone1  |
| http://www.test2.co.uk  | Someone2  |
| http://www.test3.co.uk  | Someone3  |
| http://www.test4.co.uk  | Someone4  |
| http://www.test5.co.uk  | Someone5  |
| http://www.test6.co.uk  | Someone6  |
| http://www.test7.co.uk  | Someone7  |
| http://www.test8.co.uk  | Someone8  |
| http://www.test9.co.uk  | Someone9  |
| http://www.test10.co.uk | Someone10 |

Test Explorer:

Test Explorer View

If anymore info is required let me know. I'm using Visual Studio 2017 as my IDE and SpecFlow 2.4.1, SpecRun 1.8.5.

1
You should add the Specflow and VisualStudio version you use. When i paste your example in VS2017 i see "TheLoginPageForAGivenClientIsDisplayedWhenNavigatedToIt_HttpWww_Test1_Co_Uk" as the name used.Jeroen Heier
@jeroenHeir Thanks - updated. Looks like your example is formatting the fullstops as underscores...Do you know how to modify this as that might be my solution?Scott
See this page: can change the configuration.Jeroen Heier
Thanks. Unfortunately it did not resolve the issue - I updated my app.config to include <trace stepDefinitionSkeletonStyle="MethodNameUnderscores" />, then recreated the step definitions and a new dummy scenario but the naming of my examples still persisted. Can you advise what default style you have in your app.config? Also what test runner are you using?Scott
I am not using any config at all; the naming convention mentioned earlier is the default. I am using C#, .NetCore 2.2, Specflow.Tools.MsBuild.Generation (3.0.155-beta), VS2017 and the Specflow for VS2017 extension 2018.1.15.7173 (add an additional extension gallery under options): myget.org/F/specflow-vsix/vsix ). See also hereJeroen Heier

1 Answers

0
votes

We (as in SpecFlow+ Team) have a bug in the escaping of scenario names when they contain a dot. We still need to fix it.

What I would suggest you, (and is the quickest workaround at the moment), is to add a column add the start and use it to describe the single example in this row.

SpecFlow is using the first column of a scenario outline column for the naming. If you only have urls, the scenario names aren't that good to read. And the urls are an "implementation" detail.
Perhaps the client name is better suited to be included in the scenario name.


Full disclosure: I am one of the SpecFlow & SpecFlow+ developers.