-
Notifications
You must be signed in to change notification settings - Fork 67
Closed
Labels
task:improvementChange that improves some user experience but can't be considered a new featureChange that improves some user experience but can't be considered a new featuretheme:xunit
Description
Currently, in order to use allure-xunit one have to:
- Install the package
- Create
allureConfig.json - Replace all [Fact] and [Theory] attributes with [AllureXunit] and [AllureXunitTheory].
The goal of this issue is to get rid of the 3rd step.
Motivation
The end goal is to make allure-xunit usable out-of-box. A user should be able to generate the report by just installing the package (optionally, adding some configuration) and running the tests.
Negative implications of using [AllureXunit] and [AllureXunitTheory]
The need to replace attributes has two major negative implications:
- It's a time-consuming operation if a user has a fairly large number of tests.
- The [AllureXunit] and [AllureXunitTheory] attributes cannot be composed with other attributes derived from [Fact] or [Theory]. If a user decides to utilize such attributes from a 3rd party library, there will be no way to use allure-xunit at all.
Example
-
Current usage:
using Allure.Xunit.Attributes; using Xunit; public class TestClass { [AllureXunit] public void TestMethod() { } [AllureXunitTheory] [InlineData(1, "a")] [InlineData(2, "b")] public void ParameterizedTestMethod(int a, string b) { } }
-
Future usage:
using Xunit; public class TestClass { [Fact] public void TestMethod(){} [Theory] [InlineData(1, "a")] [InlineData(2, "b")] public void ParameterizedTestMethod(int a, string b) { } }
The same report should be created for both usages:
Backward compatibility
Allure-xunit must still recognize the [AllureXunit] and [AllureXunitTheory] attributes correctly and collect test results from the corresponding test methods.
Reactions are currently unavailable
Metadata
Metadata
Labels
task:improvementChange that improves some user experience but can't be considered a new featureChange that improves some user experience but can't be considered a new featuretheme:xunit
