Skip to content

Commit

Permalink
Allure.SpecFlow improvements (#462)
Browse files Browse the repository at this point in the history
* Implement failed/broken in allure-specflow (#399)

* Add Gherkin descriptions to allure-specflow test results (#429)

* Use the common skip reason for test plans

* Fix fixture/step status reporting

* Fix Allure.SpecFlow tests to produce failed steps

* Format Allure.Features.Steps

* Rename allure-specflow projects and fix tests.

Tests of the Release version of Allure.SpecFlow incorrectly invoked
the Debug configuration of samples.

* Fix workflows and labeler to reflect allure-specflow projects rename

* Fix Allure SpecFlow entry in root README

* Update adapters table in README

  - Change examples with documentation
  - Remove preview status badges

* Update Xunit and NUnit readmes

  - Add namespace change note to Allure.NUnit
  - Fix [AllureNUnit]'s namespace
  - Add header and supported TFMs to Allure.Xunit
  - Fix supported SpecFlow versions

* Add deprecation and removal notes to README

* Fix README grammar. Add FAQ to Xunit

* Move comments out from README json block

* Fix grammar in commons README

* Small fixed in Xunit README
  • Loading branch information
delatrie authored Mar 28, 2024
1 parent bf869a2 commit fab3267
Show file tree
Hide file tree
Showing 49 changed files with 807 additions and 502 deletions.
6 changes: 3 additions & 3 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
"theme:specflow":
- changed-files:
- any-glob-to-any-file:
- "Allure.Features/**"
- "Allure.SpecFlowPlugin/**"
- "Allure.SpecFlowPlugin.Tests/**"
- "Allure.SpecFlow/**"
- "Allure.SpecFlow.Tests/**"
- "Allure.SpecFlow.Tests.Samples/**"
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ jobs:
dotnet test Allure.Net.Commons.Tests/Allure.Net.Commons.Tests.csproj\
--no-build\
--configuration ${{ env.BUILD_CONFIGURATION }}
dotnet test Allure.SpecFlowPlugin.Tests/Allure.SpecFlowPlugin.Tests.csproj\
dotnet test Allure.SpecFlow.Tests/Allure.SpecFlow.Tests.csproj\
--no-build\
--configuration ${{ env.BUILD_CONFIGURATION }}
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ jobs:
cat ./Allure.NUnit/Schemas/allureConfig.schema.json
sed -i -e '/"$ref"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.Xunit/Schemas/allureConfig.schema.json
cat ./Allure.Xunit/Schemas/allureConfig.schema.json
sed -i -e '/"$ref"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.SpecFlowPlugin/Schemas/allureConfig.schema.json
cat ./Allure.SpecFlowPlugin/Schemas/allureConfig.schema.json
sed -i -e '/"$ref"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.SpecFlow/Schemas/allureConfig.schema.json
cat ./Allure.SpecFlow/Schemas/allureConfig.schema.json
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.Net.Commons/allureConfig.Template.json
cat ./Allure.Net.Commons/allureConfig.Template.json
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.NUnit.Examples/allureConfig.json
cat ./Allure.NUnit.Examples/allureConfig.json
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.Xunit.Examples/allureConfig.json
cat ./Allure.Xunit.Examples/allureConfig.json
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.SpecFlowPlugin/allureConfig.Template.json
cat ./Allure.SpecFlowPlugin/allureConfig.Template.json
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.Features/allureConfig.json
cat ./Allure.Features/allureConfig.json
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.SpecFlowPlugin.Tests/allureConfig.json
cat ./Allure.SpecFlowPlugin.Tests/allureConfig.json
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.SpecFlow/allureConfig.Template.json
cat ./Allure.SpecFlow/allureConfig.Template.json
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.SpecFlow.Tests.Samples/allureConfig.json
cat ./Allure.SpecFlow.Tests.Samples/allureConfig.json
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.SpecFlow.Tests/allureConfig.json
cat ./Allure.SpecFlow.Tests/allureConfig.json
- name: "Update release notes link"
run: |
sed -i -e '/<PackageReleaseNotes>/,/<\/PackageReleaseNotes>/ s|/allure-csharp/releases/tag/.*\.|/allure-csharp/releases/tag/${{ inputs.nextVersion }}.|g' ./Directory.Build.props
Expand Down
118 changes: 0 additions & 118 deletions Allure.Features/Steps.cs

This file was deleted.

69 changes: 61 additions & 8 deletions Allure.NUnit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
## Quick start

- Install the Allure.NUnit package.
- Configure allureConfig.json.
- Apply the `[AllureNUnit]` attribute to test fixtures.
- Use other attributes in `NUnit.Allure.Attributes` if needed.
- Use the functions in `Allure.Net.Commons.AllureApi` if needed.
- Configure it via allureConfig.json.
- Apply the `[Allure.NUnit.AllureNUnit]` attribute to test fixtures.
- Use other attributes from `Allure.NUnit.Attributes` if needed.
- Use the functions from `Allure.Net.Commons.AllureApi` if needed.

## Further readings

Expand All @@ -34,13 +34,66 @@ Some examples are available [here](https://github.com/allure-framework/allure-cs

## Notes

### NUnit.Allure.Core.StepsHelper deprecation
### Namespace changed to Allure.NUnit

The new `Allure.Net.Commons.AllureApi` facade class was designed specificially
for test authors to enhance the Allure report. Prefer using functions in this
class over the ones from `NUnit.Allure.Core.StepsHelper`.
Starting from 2.12.0, the namespace `NUnit.Allure` is deprecated. The API in
that namespace still works, but it will be removed in the future. Please use
`Allure.NUnit` instead.

> The `[NUnit.Allure.Core.AllureNUnit]` attribute should be replaced with
> `[Allure.NUnit.AllureNUnit]`:
```c#
using Allure.NUnit; // <- Note the namespace
using NUnit.Framework;

[AllureNUnit]
class MyTests
{
[Test]
public void TestMethod()
{
/* ... */
}
}
```

### Deprecations and removals in 2.12.0

The following user API methods are now deprecated:

- In `NUnit.Allure.Core.AllureExtensions`:
- All overloads of `WrapInStep` - use `Allure.Net.Commons.AllureApi.Step`
instead.
- `WrapSetUpTearDownParams` - had no effect; can safely be replaced with
the direct call of the provided delegate.
- `NUnit.Allure.Core.AllureNUnitAttribute` - use
`Allure.NUnit.AllureNUnitAttribute` instead.
- Other classes and methods in `NUnit.Allure` - change the namespace to
`Allure.NUnit`.

The following previously deprecated user API classes and methods were removed:

- In `NUnit.Allure.Core.AllureExtensions`:
- `AddScreenDiff` - use `Allure.Net.Commons.AllureApi.AddScreenDiff`
instead.
- `NUnit.Allure.Core.AllureNUnitAttribute`'s constructor overload that takes
`bool wrapIntoStep` - the `wrapIntoStep` parameter had no effect and can be
safely removed now.
- In `NUnit.Allure.Core.AllureNUnitHelper`:
- `WrapInStep` - use `Allure.Net.Commons.AllureApi.Step` instead.
- `NUnit.Allure.Core.StepsHelper` - use functions from
`Allure.Net.Commons.AllureApi` and `Allure.Net.Commons.ExtendedApi` instead.
- In `Allure.Net.Commons.AllureLifecycle`:
- `AddAttachment` - use `Allure.Net.Commons.AllureApi.AddAttachment`
instead.
- `AddScreenDiff` - use `Allure.Net.Commons.AllureApi.AddScreenDiff`
instead.
- `Allure.Net.Commons.Steps.CoreStepsHelper` - use functions from
`Allure.Net.Commons.AllureApi` and `Allure.Net.Commons.ExtendedApi` instead.

### For users of Mac with Apple silicon

If you're developing on a Mac machine with Apple silicon, make sure you have
Rosetta installed. Follow this article for the instructions:
https://support.apple.com/en-us/HT211861
Expand Down
Loading

0 comments on commit fab3267

Please sign in to comment.