Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update READMEs and project links #442

Merged
merged 2 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Allure.NUnit/Allure.NUnit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageId>Allure.NUnit</PackageId>
<AssemblyName>Allure.NUnit</AssemblyName>
<RootNamespace>NUnit.Allure</RootNamespace>
<PackageProjectUrl>https://www.nuget.org/packages/Allure.NUnit</PackageProjectUrl>
<PackageProjectUrl>https://allurereport.org/</PackageProjectUrl>
<PackageTags>allure nunit</PackageTags>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down
81 changes: 27 additions & 54 deletions Allure.NUnit/README.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,46 @@
# Allure NUnit adapter
NUnit adapter for Allure Framework

[![Nuget](https://img.shields.io/nuget/v/Allure.NUnit?style=flat)](https://www.nuget.org/packages/Allure.NUnit)
[![Nuget pre](https://img.shields.io/nuget/vpre/Allure.Nunit?style=flat)](https://www.nuget.org/packages/Allure.NUnit)

![Nuget downloads](https://img.shields.io/nuget/dt/allure.nunit?label=downloads&style=flat)

> An Allure adapter for [NUnit](https://nunit.org/).

[<img src="https://allurereport.org/public/img/allure-report.svg" height="85px" alt="Allure Report logo" align="right" />](https://allurereport.org "Allure Report")

![Allure report](https://raw.githubusercontent.com/unickq/allure-nunit/master/AllureScreen.png)


### [Code examples](https://github.com/allure-framework/allure-csharp/tree/main/Allure.NUnit.Examples):

```cs
[TestFixture(Author = "unickq", Description = "Examples")]
[AllureNUnit]
[AllureLink("https://github.com/allure-framework/allure-csharp")]
public class Tests
{
[OneTimeSetUp]
public void ClearResultsDir()
{
AllureLifecycle.Instance.CleanupResultDirectory();
}

[AllureStep("This method is just saying hello")]
private void SayHello()
{
Console.WriteLine("Hello!");
}

[Test]
[AllureTag("NUnit", "Debug")]
[AllureIssue("GitHub#1", "https://github.com/allure-framework/allure-csharp")]
[AllureSeverity(SeverityLevel.critical)]
[AllureFeature("Core")]
[AllureId(123)]
public void EvenTest([Range(0, 5)] int value)
{
// An attribute-based step
SayHello();

// A lambda step
AllureApi.Step(
"Validate calculations",
() =>
{
Assert.IsTrue(value % 2 == 0, $"Oh no :( {value} % 2 = {value % 2}");
}
);
}
}
```
- Learn more about Allure Report at [https://allurereport.org](https://allurereport.org)
- 📚 [Documentation](https://allurereport.org/docs/) – discover official documentation for Allure Report
- ❓ [Questions and Support](https://github.com/orgs/allure-framework/discussions/categories/questions-support) – get help from the team and community
- 📢 [Official announcements](https://github.com/orgs/allure-framework/discussions/categories/announcements) – stay updated with our latest news and updates
- 💬 [General Discussion](https://github.com/orgs/allure-framework/discussions/categories/general-discussion) – engage in casual conversations, share insights and ideas with the community
- 🖥️ [Live Demo](https://demo.allurereport.org/) — explore a live example of Allure Report in action

#### NUnit.Allure.Core.StepsHelper deprecation
---

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`.
## Quick start

### Installation and Usage
- Download from Nuget with all dependencies.
- 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 functions in `Allure.Net.Commons.AllureApi` if needed.
- Use the functions in `Allure.Net.Commons.AllureApi` if needed.

## Further readings

Learn more from [the documentation for Allure NUnit](https://allurereport.org/docs/nunit/).

Some examples are available [here](https://github.com/allure-framework/allure-csharp/tree/main/Allure.NUnit.Examples).

## Notes

### NUnit.Allure.Core.StepsHelper deprecation

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`.

#### For users of Mac with Apple silicon
### 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
4 changes: 2 additions & 2 deletions Allure.Net.Commons/Allure.Net.Commons.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<IsPackable>true</IsPackable>
<Authors>Alexander Bakanov, Nikolay Laptev</Authors>
<Authors>Alexander Bakanov, Nikolay Laptev, Maksim Stepanov</Authors>
<Product />
<Description>Provides common facilities to build allure integrations for .NET test frameworks</Description>
<PackageProjectUrl>https://www.nuget.org/packages/Allure.Net.Commons</PackageProjectUrl>
<PackageProjectUrl>https://allurereport.org/</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>allure</PackageTags>
<PackageIcon>Allure-Color.png</PackageIcon>
Expand Down
47 changes: 31 additions & 16 deletions Allure.Net.Commons/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
# Allure.Net.Commons [![](http://img.shields.io/nuget/vpre/Allure.Net.Commons.svg?style=flat)](https://www.nuget.org/packages/Allure.Net.Commons)
# Allure.Net.Commons
[![](http://img.shields.io/nuget/vpre/Allure.Net.Commons.svg?style=flat)](https://www.nuget.org/packages/Allure.Net.Commons)
.Net implementation of [Allure java-commons](https://github.com/allure-framework/allure-java/tree/master/allure-java-commons).

Use this library to create custom Allure adapters for .NET test frameworks.
> Allure.Net.Commons is a library for creating custom Allure adapters for .NET test frameworks.

Can be used by any project targeting a netstandard2.0 compatible framework
including .NET Framework 4.6.1+, .NET Core 2.0+, .NET 5.0+ and more. See the
full list [here](https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0#select-net-standard-version).
[<img src="https://allurereport.org/public/img/allure-report.svg" height="85px" alt="Allure Report logo" align="right" />](https://allurereport.org "Allure Report")

- Learn more about Allure Report at [https://allurereport.org](https://allurereport.org)
- 📚 [Documentation](https://allurereport.org/docs/) – discover official documentation for Allure Report
- ❓ [Questions and Support](https://github.com/orgs/allure-framework/discussions/categories/questions-support) – get help from the team and community
- 📢 [Official announcements](https://github.com/orgs/allure-framework/discussions/categories/announcements) – stay updated with our latest news and updates
- 💬 [General Discussion](https://github.com/orgs/allure-framework/discussions/categories/general-discussion) – engage in casual conversations, share insights and ideas with the community
- 🖥️ [Live Demo](https://demo.allurereport.org/) — explore a live example of Allure Report in action

---

The library can be used by any project targeting a netstandard2.0 compatible
framework including .NET Framework 4.6.1+, .NET Core 2.0+, .NET 5.0+ and more.
See the full list [here](https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0#select-net-standard-version).

## Note for users of Mac with Apple silicon

Expand All @@ -20,10 +32,10 @@ You may also install Rosetta via the CLI:
```

## Configuration
Allure lifecycle is configured via json file with default name `allureConfig.json`. NuGet package installs `allureConfig.Template.json` which you can use as an example. There are 2 ways to specify config file location:
- set ALLURE_CONFIG environment variable to the full path of json config file. This option is preferable for .net core projects which utilize nuget libraries directly from nuget packages folder. See this example of setting it via code: https://github.com/allure-framework/allure-csharp/blob/bdf11bd3e1f41fd1e4a8fd22fa465b90b68e9d3f/Allure.Commons.NetCore.Tests/AllureConfigTests.cs#L13-L15
Allure lifecycle is configured via a json file with the default name `allureConfig.json`. NuGet package installs `allureConfig.Template.json` which you can use as an example. There are 2 ways to specify config file location:
- set ALLURE_CONFIG environment variable to the full path of json config file. This option is preferable for .net core projects which utilize nuget libraries directly from nuget packages folder. See this example of setting it in the code: https://github.com/allure-framework/allure-csharp/blob/bdf11bd3e1f41fd1e4a8fd22fa465b90b68e9d3f/Allure.Commons.NetCore.Tests/AllureConfigTests.cs#L13-L15

- place `allureConfig.json` to the location of `Allure.Commons.dll`. This option can be used with .net classic projects which copy all referenced package libraries into binary folder. Do not forget to set 'Copy to Output Directory' property to 'Copy always' or 'Copy if newer' in your test project or set it in .csproj:
- place `allureConfig.json` to the location of `Allure.Net.Commons.dll`. This option can be used with .net classic projects which copy all referenced package libraries into binary folder. Do not forget to set 'Copy to Output Directory' property to 'Copy always' or 'Copy if newer' in your test project or set it in .csproj:
```xml
<ItemGroup>
<None Update="allureConfig.json">
Expand All @@ -45,7 +57,7 @@ Allure configuration section is used to setup output directory and link patterns
"allure": {
"directory": "allure-results", // optional, default value is "allure-results"
"title": "custom run title", // optional
"links": //optional
"links": //optional
[
"https://example.org/{link}",
"https://example.org/{issue}",
Expand All @@ -59,15 +71,14 @@ All link pattern placeholders will be replaced with URL value of corresponding l

`link(type: "issue", url: "BUG-01") => https://example.org/BUG-01`

## The end user API
## Runtime API

This API is designed for test authors. Use it to enhance the report created
from your tests.
Use this API it to enhance the report at runtime.

### The AllureApi facade

Use the `Allure.Net.Commons.AllureApi` class to access an end user's runtime
API.
Use the `Allure.Net.Commons.AllureApi` class to access the most commonly used
functions.

#### Metadata

Expand Down Expand Up @@ -118,10 +129,14 @@ API.
* AddAttachment - adds an attachment to the current step, fixture, or test.
* AddScreenDiff - adds needed artifacts to the current test case to be used with [screen-diff-plugin](https://github.com/allure-framework/allure2/tree/master/plugins/screen-diff-plugin)

### The ExtendedApi facade

Use this class to access some less commonly used functions.

#### Explicit step management

> [!NOTE]
> Use these functions only if lambda steps doesn't suit your needs.
> Use the functions below only if lambda steps doesn't suit your needs.

* `StartStep(string): void`
* `StartStep(string, Action<StepResult>): void`
Expand All @@ -147,7 +162,7 @@ API.
#### Explicit fixture management

> [!NOTE]
> Use these functions only if lambda fixtures doesn't suit your needs.
> Use the functions below only if lambda fixtures doesn't suit your needs.

* `StartBeforeFixture(string): void`
* `StartAfterFixture(string): void`
Expand Down
2 changes: 1 addition & 1 deletion Allure.SpecFlowPlugin/Allure.SpecFlowPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Authors>Alexander Bakanov</Authors>
<Product />
<Description>Generates Allure report result files for SpecFlow test run</Description>
<PackageProjectUrl>https://www.nuget.org/packages/Allure.SpecFlow</PackageProjectUrl>
<PackageProjectUrl>https://allurereport.org/</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>Allure-SF-Color.png</PackageIcon>
<PackageTags>specflow allure</PackageTags>
Expand Down
Loading