Denis Koreyba
Denis Koreyba

Reputation: 3718

How to use Allure attributes with SpecFlow?

Test report framework Allure allows to use the next test attributes:

  1. AllureDescriptionAttribute
  2. AllureFeaturesAttribute
  3. AllureSeverityAttribute
  4. AllureStoriesAttribute
  5. AllureTitleAttribute

I want to know if it's possible to use them with SpecFlow (+MsTest).

Actually I already know how to use the AllureSeverityAttribute attribute. To use it it's needed to change allureConfig.json file by adding:

"specflow": {
"labels": {
  "owner": "^author:?(.+)",
  "severity": "^(normal|blocker|critical|minor|trivial)"
}

And then on a scenario you can add a tag like "@blocker" or "@minor" etc.

But I also really want to use AllureDescriptionAttribute.

I also don't understand how AllureDescriptionAttribute works as when I add a specific tag to my scenario it doesn't add AllureDescriptionAttribute to the .feature.cs file.

Upvotes: 0

Views: 1049

Answers (1)

Ukrainis
Ukrainis

Reputation: 534

About Story, if you will add @Story:dfs, then you will see additional level of filtering in behaviors in Allure report.
About your last question. Nothing is added in generated feature files. How Allure works, AllureLifeCycle is used. In this class all is added, all information is gathered from Scenario (ScenarioContext, tags, etc.) and it creates results, which are understood by Allure command line tools. You also can edit current Test information, using this class, in your code (I am using it to attach links, screenshots, logs).
If you want to get more understand-ability in how Allure works, I would recommend watch it's code in their repository.

Upvotes: 1

Related Questions