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

Step display text customisation #411

Closed
adamralph opened this issue Dec 10, 2017 · 4 comments
Closed

Step display text customisation #411

adamralph opened this issue Dec 10, 2017 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@adamralph
Copy link
Owner

adamralph commented Dec 10, 2017

Outcome of #409.

@adamralph adamralph added the enhancement New feature or request label Dec 10, 2017
@adamralph adamralph added this to the 2.3.1 milestone Dec 10, 2017
@adamralph adamralph self-assigned this Dec 10, 2017
@adamralph adamralph changed the title Step name customisation Step display name customisation Dec 10, 2017
@adamralph adamralph changed the title Step display name customisation Step display text customisation Dec 23, 2017
@adamralph
Copy link
Owner Author

@eyalsk I just pushed 2.3.1 beta 1, which contains this feature.

Could you please give it a try? https://www.nuget.org/packages/Xbehave/2.3.1-beta0001-build733

You should be able to achieve what you want by doing something like this:

[assembly: BackgroundSuffixes]
public sealed class BackgroundSuffixesAttribute : Attribute, IFilter<IStepDefinition>
{
    public IEnumerable<IStepDefinition> Filter(IEnumerable<IStepDefinition> steps) =>
        steps.Select(step => step.DisplayText((string stepText, bool isBackgroundStep) =>
            stepText + (isBackgroundStep ? " (Background)" : null)));
}

@iam3yal
Copy link

iam3yal commented Dec 23, 2017

@adamralph Excellent, thank you for these changes. 😉

@iam3yal
Copy link

iam3yal commented Dec 23, 2017

@adamralph I've tested it just now and so far it looks good.

@adamralph adamralph modified the milestones: 2.3.1, 2.4.0 Feb 23, 2018
@adamralph adamralph modified the milestones: 2.4.0, 2.3.1 Mar 15, 2018
@adamralph
Copy link
Owner Author

Released in 2.3.1 - https://twitter.com/adamralph/status/998611366817746944

Thanks @eyalsk. Look out for your name in the release notes! https://github.com/xbehave/xbehave.net/releases/tag/2.3.1 🏆

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