allure-framework / allure-framework/allure-csharp

Console logs from OneTimeSetup methods are not displayed in the report

Open
#519 0 comments 0 reactions 0 assignees View on GitHub
task:improvement theme:nunit
Dominant language
C#
Stars
125
Forks
76
Avg merge
1d 2h
Merged PRs (30d)
18

Description

[//]: # (
. Note: for support questions, please create a discussion at https://github.com/orgs/allure-framework/discussions.
. This repository's issues are reserved for feature requests and bug reports.
.
. Make sure you have a clear name for your issue. The name should start with a capital
. letter and no dot is required in the end of the sentence. An example of good issue names:
.
. - The report is broken in IE11
. - Add an ability to disable default plugins
. - Support emoji in test descriptions
)

#### I'm submitting a ...
- [x] bug report
- [x] feature request
- [ ] support request => Please do not submit support request here, see note at the top of this template.

#### What is the current behavior?
Logs from OneTimeSetup methods are not displayed in the report
Logs from SetUp methods are displayed in the test body not setup section

#### If the current behavior is a bug, please provide the steps to reproduce and, if possible, a minimal demo of the problem
```
[AllureNUnit]
[TestFixture]
public class Test1
{
[OneTimeSetUp]
[AllureBefore]
public void SetupClass()
{
Console.WriteLine("One Time Setup");
Step1();
}

[SetUp]
[AllureBefore]
public void SetupTest()
{
Console.WriteLine("Test Setup");
}

[Test]
public void Test()
{
Console.WriteLine("Test log");
Step1();
}

[AllureStep]
public void Step1()
{
Console.WriteLine("Step Log");
}
}
```

#### What is the expected behavior?
Logs from OneTimeSetup should be displayed
Logs from Setup should be displayed in the setup sections

#### What is the motivation / use case for changing the behavior?
There are tools (ex RestAssured) that log valuable information(headers, response content) in case of failures/exceptions or we use to log errors in Setup methods. This information is lost in the case of OneTimeSetup

#### Please tell us about your environment:

- OS Linux/Windows/Mac OS
- .NET framework .NET 8
- Allure version: 2.27.0
- Test framework: nunit@4.1.0
- Allure adapter: allure-nunit@2.12.0

#### Other information
image

[//]: # (
. e.g. detailed explanation, stacktraces, related issues, suggestions
. how to fix, links for us to have more context, eg. Stack Overflow, Gitter etc
)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the NUnit example with the OneTimeSetUp, SetUp, AllureBefore, and AllureStep attributes on .NET 8. Compare where console output from class setup, test setup, and the test body appears in the report. Done means OneTimeSetUp logs are retained and setup logs appear in the setup section.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.