SpecFlowOSS / SpecFlow

#1 .NET BDD Framework. SpecFlow automates your testing & works with your existing code. Find Bugs before they happen. Behavior Driven Development helps developers, testers, and business representatives to get a better understanding of their collaboration
https://www.specflow.org/
Other
2.23k stars 752 forks source link

LivingDoc: Binding not found in assembly (NET 6) #2591

Open ebwinters opened 2 years ago

ebwinters commented 2 years ago

SpecFlow Version

3.9.57

Which test runner are you using?

xUnit

Test Runner Version Number

SpecFlow.xUnit: Version="3.9.58"

.NET Implementation

.NET 5.0

Project Format of the SpecFlow project

Sdk-style project format

.feature.cs files are generated using

SpecFlow.Tools.MsBuild.Generation NuGet package

Test Execution Method

Command line – PLEASE SPECIFY THE FULL COMMAND LINE

SpecFlow Section in app.config or content of specflow.json

{
  "$schema": "https://specflow.org/specflow-config.json",
  "livingDocGenerator": {
    "enabled": true,
    "filePath": "TestExecution.json"
  }
}

Issue Description

I am running livingdoc (most up to date version) in command line to generate html using the following: ~/.dotnet/tools/livingdoc test-assembly /package/unarchive/integrationtests.dll --test-execution-json TestExecution.json --output report.html --title Test

I have verified that:

  1. The tests run and pass (producing specflow output, showing bindings exists) using the exact test assembly specified above
  2. The TestExecutionJson file is generated in the directory where the livingdoc command is executed HOWEVER, when I try to generate living doc, I get 3 warnings:
  3. Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
  4. Warning: No bindings found in assembly '/package/unarchive/integrationtests.dll'
  5. In the html document that is generated, which has greyed out features, but all of the correct feature data showing it read the test assembly or the json file correctly, has at the top: Warning: The given test results could not be fully matched to the feature files. Please make sure that the correct locations were defined.

I cannot figure out why this is happening. I want to see test results with my features, but it will not work. I have read the documentation many times over.

Steps to Reproduce

COMMAND LINE: dotnet test "/package/unarchive/integrationtests.dll" --logger "console;verbosity=detailed"

Link to Repro Project

No response

goblinmaks commented 2 years ago

Hi @ebwinters, Why you close this issue ? Same issue reproduced for me. Do you have any workaround for it ? image

Thanks,

SabotageAndi commented 2 years ago

See my comment here: https://github.com/SpecFlowOSS/SpecFlow/issues/2521#issuecomment-976419929

It's not a real issue. Only the warning is annoying.

ebwinters commented 2 years ago

@goblinmaks my features files were in the wrong place. I was creating a ZIP on windows and running on linux, so the unarchive had paths like /home/package\x\y\z. This issue was irrelevant to Specflow

goblinmaks commented 2 years ago

@SabotageAndi Ok, but I want to get unused step definitions with livingdoc cli tool livingdoc --version Framework: .NET 5.0.16 3.9.57+gcf5c4dd9b9

livingdoc test-assembly .\TA.UI.ATO.Features.dll --binding-assemblies .\TA.UI.Steps.dll all my project use net6 and get error, when I back my projects to net5 it works and generate report correctly

image

djvandijk commented 2 years ago

See my comment here: #2521 (comment)

It's not a real issue. Only the warning is annoying.

It IS an issue. Can confirm we run into the same issue. When using a .NET6 test assembly livingdoc cannot find the bindings. The report gets generated, but without the 'Unused Step Definitions' analytics. There it states again 'No step definitions were found in the provided assemblies'. That's a real shame since finding unused steps is one of the main reason why I'm currently looking into livingdoc.

SabotageAndi commented 2 years ago

@djvandijk Thanks for the info. Latest the next version to support the next version of SpecFlow will fix this issue.

goblinmaks commented 1 year ago

@SabotageAndi what of planned date to release new version of livingdoc will be released ? Thanks,

SabotageAndi commented 1 year ago

@goblinmaks No date planned. When we are finished, we release it.

jrpc12 commented 1 year ago

Just to confirm that is a real issue and is not isolated,

This happens to me, I wonder if you guys have replicated, I have two separated projects with NET 6.0

livingdoc test-assembly project1.dll -t TestExecution.json throws the same error and not livingdoc.html generated

image image

my second project also with NET 6.0 throws only the warning and after that generate the livingdoc.html

image

the only differences I can says is the in the project where the error occurs, I have more nuget packages, but after includ in the project2 where livingdoc work, the html still generated but not in the first project, something is causing the error but I'm not sure the entire reason is NET 6.0 since both project use it.

filip-spasovski commented 1 year ago

I'm getting a similar error and a warning. I use the following command

livingdoc feature-folder C:\GitRepos\SolutionFolder\SpecFlowProjectFolder --binding-assemblies C:\GitRepos\SolutionFolder\SpecFlowProjectFolder\bin\Release\net48\SpecFlowProject.dll -t C:\GitRepos\SolutionFolder\SpecFlowProjectFolder\bin\Release\net48\TestExecution.json --output C:\GitRepos\SolutionFolder\SpecFlowProjectFolder\TestResults\ReportTests.html

I get the following errors

image

P.S. When I use it without the --binding-assemblies then the report is generated but I'm missing the Unused Step Definitions.

NikkTod commented 1 year ago

Hello @SabotageAndi, any idea if the team will have time to fix this one, showing the unused steps is important for a clean house :)

SabotageAndi commented 1 year ago

@NikkTod I don't work for Tricentis since March and so I don't work on SpecFlow anymore. I have no idea when somebody will do anything on SpecFlow.

goblinmaks commented 1 year ago

@SpecFlowOSS @gasparnagy @Socolin Please leave any comment in case if anybody have any information about update. Thanks,

Socolin commented 1 year ago

I'm only maintaining the rider plugin on my free time for a while now. I don't know anything about the state of SpecFlow project, it seems nobody is working actively on it right now. I'm also waiting after a new release.

If someone have some info I'm interested in them.

gasparnagy commented 1 year ago

Same here. Last year I helped Tricentis in the SpecFlow maintenance, but my contract was not renewed for this year and I haven't got any feedback from them about the plans.

mikeblakeuk commented 10 months ago

@SabotageAndi et al Any news on this now .net 5.0 is basically dead?

SabotageAndi commented 10 months ago

@mikeblakeuk I am not involved with SpecFlow and Tricentis in any way at the moment. I left Tricentis in February.

It all depends on what @gasparnagy achieves with Tricentis. Status Issue for that is here: https://github.com/SpecFlowOSS/SpecFlow/issues/2719