Specflow: [Help want] How to disable trace output in Specflow 3.0.225

Created on 12 Sep 2019  Â·  7Comments  Â·  Source: SpecFlowOSS/SpecFlow

SpecFlow Version:

  • [x] 3.0
  • [ ] 2.4
  • [ ] 2.3
  • [ ] 2.2
  • [ ] 2.1
  • [ ] 2.0
  • [ ] 1.9

Used Test Runner

  • [ ] SpecFlow+Runner
  • [ ] MSTest
  • [x] NUnit
  • [ ] Xunit


Version number:

Project Format of the SpecFlow project

  • [x] Classic project format using packages.config
  • [ ] Classic project format using <PackageReference> tags
  • [ ] Sdk-style project format

.feature.cs files are generated using

  • [x] SpecFlow.Tools.MsBuild.Generation NuGet package
  • [ ] SpecFlowSingleFileGenerator custom tool

Visual Studio Version

  • [x] VS 2019
  • [ ] VS 2017
  • [ ] VS 2015

Enable SpecFlowSingleFileGenerator Custom Tool option in Visual Studio extension settings

  • [ ] Enabled
  • [x] Disabled

Are the latest Visual Studio updates installed?

  • [x] Yes
  • [ ] No, I use Visual Studio version <Major>.<Minor>.<Patch>

.NET Framework:

  • [x] >= .NET 4.5
  • [ ] before .NET 4.5
  • [ ] .NET Core 2.0
  • [ ] .NET Core 2.1
  • [ ] .NET Core 2.2
  • [ ] .NET Core 3.0

Test Execution Method:

  • [ ] Visual Studio Test Explorer
  • [ ] TFS/VSTS/Azure DevOps – Task – PLEASE SPECIFY THE NAME OF THE TASK
  • [x] Command line – PLEASE SPECIFY THE FULL COMMAND LINE

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


Repro Project

# specflow.json
{
  "plugins": [
    {"name":  "Allure", "type": "Runtime" }
  ],
  "stepAssemblies": [
    { "assembly": "Allure.SpecFlowPlugin" }
  ],
  "trace": {
    "listener": "TechTalk.SpecFlow.Tracing.NullListener, TechTalk.SpecFlow"
  }
}

Issue Description

Tracking output still show in output, may I ask how could I disable trace output

Runtime up-for-grabs NUnit Question

Most helpful comment

@xuanzhaopeng any updates on this?

All 7 comments

Which trace output do you mean?

Hey @SabotageAndi , the trace output when I run test from console line, I saw
"Given ..."
"When ...." in terminal.

Do you think is it possible to fully disable it? in specflow 2.4, I set trace listener to NullListener , then there is no output for this trace. But in specflow 3(latest version), I cannot disable the trace in the terminal.

Thanks a lot for your help

Perhaps we broke it with SpecFlow 3. There were a lot of changes necessary with the container creation/registration.
The code is here: https://github.com/techtalk/SpecFlow/blob/master/TechTalk.SpecFlow/Infrastructure/ContainerBuilder.cs

Perhaps we resolve an ITraceListener before we register the one from the config.
I would suggest you send first a PR with a failing scenario/test. Perhaps you find also the issue.

For sure, I will make a PR for unit test at first to ensure I could reproduce it

@xuanzhaopeng any updates on this?

Closed because of inactivity

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings