specflowxunit.nettest-runner

Why would anybody want to use different test runner with Specflow?


I am setting up UI tests ecosystem integrated with Azure DevOps test plans. I am reading about Specflow v3 and it states that one can use different unit test frameworks with it, xUnit for example: https://specflow.org/documentation/Unit-Test-Providers/

Why would anybody want to do this? To have assertion methods from xUnit? I can't grasp the idea what benefits it would give also I don't get what unit tests frameworks have to do with ui test framework.


Solution

  • You can use SpecFlow to tests everything to want. Yes, it is often used for UI tests with Selenium, but this is not the only use case. SpecFlow is a tool to automate BDD scenarios.

    This is our description of SpecFlow:

    Use SpecFlow to define, manage and automatically execute human-readable acceptance tests in .NET projects. Writing easily understandable tests is a cornerstone of the BDD paradigm and also helps build up a living documentation of your system.

    We support different unit test runner (xUnit, MSTest, NUnit and our own SpecFlow+Runner), because everyone of them has it's advantage and disadvantages. So our users have options what they want to use. Often it is a personal preference what you use. Some prefer xUnit, some NUnit.


    Full disclosure: I am one of the maintainers of SpecFlow