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

Failed results generates "passed" statuses #307

Open
alfeigo opened this issue Nov 30, 2022 · 3 comments
Open

Failed results generates "passed" statuses #307

alfeigo opened this issue Nov 30, 2022 · 3 comments
Assignees

Comments

@alfeigo
Copy link

alfeigo commented Nov 30, 2022

Just tried to use https://github.com/allure-framework/allure-csharp/tree/main/Allure.SpecFlowPlugin

Scenario:
#language: ru
@123456 @tms:42 @link:http://example.org

Функция: Просто тест что все вместе работает
Сценарий: Очень простой сценарий
Дано Давайте что-то откроем

Step:

[Given(@"Давайте что-то откроем")]
public async void Givensomething()
{
    Response = await Client.GetAsync(_endpoint);
    Assert.Equal((HttpStatusCode.OK), Response.StatusCode);

}

Looks at the test output:
Xunit.Sdk.EqualException
Assert.Equal() Failure
Expected: OK
Actual: Unauthorized
at net_api_cukes.UsersResourceSteps.Givensomething() in

And data of resulting json:

{
"uuid": "9c83ed2f1a854e5f879883e797bf23ca",
"historyId": "Очень простой сценарий",
"fullName": "Очень простой сценарий",
"labels": [
{
"name": "thread",
"value": ".NET Long Running Task"
},
{
"name": "host",
"value": "0000NBB007WQ6M0"
},
{
"name": "feature",
"value": "Просто тест что все вместе работает"
},
{
"name": "tag",
"value": "123456"
},
{
"name": "tag",
"value": "tms:42"
},
{
"name": "tag",
"value": "link:http://example.org"
}
],
"links": [],
"name": "Очень простой сценарий",
"status": "passed",
"statusDetails": {
"known": false,
"muted": false,
"flaky": false
},
"stage": "finished",
"steps": [
{
"name": "Дано Давайте что-то откроем",
"status": "passed",
"statusDetails": {
"known": false,
"muted": false,
"flaky": false
},
"stage": "finished",
"steps": [],
"attachments": [],
"parameters": [],
"start": 1669807961943,
"stop": 1669807961984
}
],
"attachments": [],
"parameters": [],
"start": 1669807961939,
"stop": 1669807962109
}

@neparij neparij self-assigned this Dec 12, 2022
@undron
Copy link
Contributor

undron commented Dec 27, 2022

The issue is in methods:
NUnit.Allure.Core.Steps.AllureStepAspect.WrapSync<T> and NUnit.Allure.Core.Steps.AllureStepAspect.WrapAsync<T>
@neparij why should it return default(T); in case of exception?

@neparij
Copy link
Contributor

neparij commented Dec 30, 2022

@undron, thanks for attention, but there is something different happens.
Example contains Xunit + SpecFlow adapter.
I'll check this as soon as possible.

FYI, @undron — WrapSync and WrapAsync handler is throwing exceptions now and should be catched with continuation task (commit)

2.9.4-preview.1 package

@undron
Copy link
Contributor

undron commented Dec 30, 2022

@undron, thanks for attention, but there is something different happens. Example contains Xunit + SpecFlow adapter. I'll check this as soon as possible.
Oh, sorry, just faced with same issue in NUnit adapter, was very frustrating...
WrapSync and WrapAsync handler is throwing exceptions now and should be catched with continuation task
Thanks! I will check it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants