Skip to content
This repository has been archived by the owner on Jun 12, 2021. It is now read-only.

Optional omission of arguments from scenario names in test output #37

Closed
adamralph opened this issue Mar 27, 2013 · 3 comments
Closed
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@adamralph
Copy link
Owner

Proposed by @jamesfoster.

The example values should normally be included in the step descriptions, e.g.

[Scenario]
[Example("Dr. Bill")]
[Example("Dr. Bob")]
public static void UserPostsToHisOwnBlog(string userName)
{
    "Given I am logged in as {0}"
        .Given(() => Site.Login(userName, "oranges"));

However, some people may choose not to do this and rely on the test output to show example values so we should default to preserving this behaviour.

The new optional feature can be enabled by applying

[OmitArgumentsFromScenarioNames(true)]

at the method (scenario), class (feature) or assembly (product) level.

adamralph added a commit that referenced this issue Mar 27, 2013
…-output

#37 Remove example values from test output
adamralph added a commit that referenced this issue Mar 31, 2013
@ghost ghost assigned adamralph May 30, 2013
@adamralph
Copy link
Owner Author

@jamesfoster I've added the attribute we discussed to control this feature (see updated issue description)

Another reason for having this switched off by default is that if you have a step failure in VS using TD.NET or any other runner which only shows failures in the output, all you get is the name of the test that failed in the output window. This means that if say, a When or Then fails, even if your Given step shows the example value in it's text using "Given foo is {0}", you can't see this in the output window so you have no idea which example failed.

I guess if you are using another test runner which shows all the tests in a GUI next to each other this may be mitigated. I use TD.NET and for this reason I probably won't use this feature, but it's there for you to optionally switch on if you want it 😉.

Something that is on the radar for either version 1.0 or 2.0 is to thoroughly re-work the test output towards something like that which is produced from Cucumber, i.e. features, scenarios and examples as first class citizens instead of being shoe-horned in to xUnit's test class and test method schema. When that happens this is bound to be revisited.

I'l push out a new beta shortly.

adamralph added a commit that referenced this issue May 30, 2013
#37 added OmitArgumentsFromScenarioNamesAttribute
@jamesfoster
Copy link

Excellent.

This will definitely help eliminate my horizontal scrollbar ;)

On Thu, May 30, 2013 at 7:18 AM, Adam Ralph [email protected]:

@jamesfoster https://github.com/jamesfoster I've added the attribute we
discussed to control this feature (see updated issue description)

Another reason for having this switched off by default is that if you have
a step failure in VS using TD.NET or any other runner which only shows
failures in the output, all you get is the name of the test that failed in
the output window. This means that if say, a When or Then fails, even if
your Given step shows the example value in it's text using "Given foo is
{0}", you can't see this in the output window so you have no idea which
example failed.

I guess if you are using another test runner which shows all the tests in
a GUI next to each other this may be mitigated. I use TD.NET and for this
reason I probably won't use this feature, but it's there for you to
optionally switch on if you want it ;-).

Something that is on the radar for either version 1.0 or 2.0 is to
thoroughly re-work the test output towards something like that which is
produced from Cucumber, i.e. features and scenarios and examples as first
class citizens instead of being shoe-horned in to xUnit's test class and
test method schema. When that happens this is bound to be revisited and
will probably be superseded.

I'l push out a new beta shortly.


Reply to this email directly or view it on GitHubhttps://github.com//issues/37#issuecomment-18663484
.

@adamralph
Copy link
Owner Author

Latest changes pushed out as beta https://nuget.org/packages/Xbehave/0.15.0-beta04

@adamralph adamralph changed the title Optional ommission of arguments from scenario names in test output Optional omission of arguments from scenario names in test output Oct 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants