by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Andreas Willich
    @SabotageAndi
    what do you mean with that? you have 2 custom plugin projects in a solution? or that one specflow project uses 2 custom plugins
    Sonu Davidson
    @sonudavidson
    One specflow project uses 2 custom plugins
    Andreas Willich
    @SabotageAndi
    that is possible
    you have to be careful which stuff you are registering
    if you register different implementations for the same interface, the last registration will win
    Sonu Davidson
    @sonudavidson
    oh, okay..
    Do you have an example somewhere that I could use as a reference?
    Göran Halvarsson
    @GoranHalvarsson

    Hello there
    I just started with SpecFlow
    When generating the steps class I get obsolete warning:
    ScenarioContext.Current.Pending();
    Where it suggests that I should get the ScenarioContext via injection

    So why does it generate obsolete code?

    Make no sence...
    Andreas Willich
    @SabotageAndi
    @GoranHalvarsson because we didn't updated the generator of this code yet. see techtalk/SpecFlow#1490
    Göran Halvarsson
    @GoranHalvarsson
    Thanks for answering, keep up the good work
    Prab
    @TotalTest

    Hi, I'm currently making use of the SpecFlow.Autofac plugin. It look like the ContainerBuilder is created/ended per scenario, but I feel like there are things should be allowed to have a lifetime of the entire test run.

    For example a logger, or a HttpClient (so to avoid socket exhaustion) for example. I think I've got a way of doing this which is to create a seperate container builder BeforeTestRun and registering a singleinstance there, then resolving within the ScenarioDependencies method so the same instance is used for each scenario. And finally disposing the seperate container in the AfterTestRun hook.

    One of the things I'm trying to do is use a logger throughout the entire test run, I don't think this is unusual and creating/registering a new logger for each scenario seems overkill. I also wanted to hook into ITraceListener and use a custom listener.

    This probably isn't specific to the Autofac plugin but would anyone have an example, or idea of how to achieve this? Maybe it's a core specflow issue as the ITraceListener is registered per scenario? Apologies if I've assumed certain things that are incorrect.

    Andreas Willich
    @SabotageAndi
    As far as I remember overwriting ITraceListener doesn't work currently, because we are resolving internally an instance before the plugins can register a different instance
    and in every container (testrun, testthread, feature, scenario) it is registered
    Prab
    @TotalTest

    Ah ok, yes I think the issue is tracked here
    SpecFlowOSS/SpecFlow#1590

    Hope there's a solution for this soon.

    Göran Halvarsson
    @GoranHalvarsson
    Hey good people
    I have the specflow v 3, now how do I generate reports, in previous versions. You could generate reports with specflow.exe
    So what do I do that now?
    Göran Halvarsson
    @GoranHalvarsson
    Any suggestion
    Andreas Willich
    @SabotageAndi
    @GoranHalvarsson You could have a look at the reporting in the SpecFlow+Runner
    Prab
    @TotalTest

    Hi team, I've created a specflow plugin and was hoping to push to nuget.org
    However I get a id conflict error, I can't see any other package with the same name so I'm guessing it's because my package starts with 'SpecFlow.'?

    Am I able to get permission to use this? My propose package name is 'SpecFlow.Variants'

    Andreas Willich
    @SabotageAndi
    We reserved the Id's some time ago: https://specflow.org/2017/nuget-packages-reserved-id-naming-conventions/
    If you name the package SpecFlow.Contrib.Variants you should be able to upload
    Prab
    @TotalTest
    Excellent, thanks Andreas
    Andreas Willich
    @SabotageAndi
    @TotalTest I saw that you also wrote us an email. I will ignore it now. Ok?
    We have a docu page with plugins: https://specflow.org/documentation/Available-Plugins/
    You could add your plugin to it
    Prab
    @TotalTest
    Yep please ignore that. Thanks I will look at doing that.
    Daniel Labudek
    @dlabudek_gitlab
    Hi, how can I change[NUnit.Framework.TestFixtureAttribute()] in *feature.cs?
    What should I add to
    Initialize(GeneratorPluginEvents generatorPluginEvents, GeneratorPluginParameters generatorPluginParameters,
    UnitTestProviderConfiguration unitTestProviderConfiguration)
    Unfortunatelly there is no real documentation that will help me. Thanks.
    goblinmaks
    @goblinmaks
    @dlabudek_gitlab for this case you should rewrite your-own NUnit3TestGeneratorProvider. What of reason to change TestFixtureAttribute() for your case ?
    Daniel Labudek
    @dlabudek_gitlab
    I'm running test in parallel and TestFixtureAttribute should allow me to control what tests can be run with each other in parallel. Right know tests in different feature files can be run in parallel but this is not enough. I want to allow only test in different folders to run in parallel.
    Daniel Labudek
    @dlabudek_gitlab
    I find out that TestFixtureAttribute is set in public void SetTestClass(). SO I should probably override this method, but how can I do it? I do not understand the plugin logic.
    Prab
    @TotalTest

    Hi Team, I'm trying to upgrade my custom plugin to SpecFlow 3. I have followed the examples project and article found here: https://specflow.org/2019/updating-plugins-for-specflow-3/

    I have it mostly done but run into a problem when I add a dependency to my plugin project. I've added Newtonsoft.Json or System.Text.Json, the project build and packs ok.

    But when I add my plugin via nuget to a different project I get the following error for System.Text.Json (the same happens if I use Newtonsoft instead).

    [SpecFlow] System.IO.FileNotFoundException: Could not load file or assembly 'System.Text.Json, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
    File name: 'System.Text.Json, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
    at SpecFlow.Contrib.Variants.VariantsPlugin.CustomizeDependencies(Object sender, CustomizeDependenciesEventArgs eventArgs)
    at TechTalk.SpecFlow.Generator.Plugins.GeneratorPluginEvents.RaiseCustomizeDependencies(ObjectContainer container, SpecFlowProjectConfiguration specFlowProjectConfiguration)
    at TechTalk.SpecFlow.Generator.GeneratorContainerBuilder.CreateContainer(SpecFlowConfigurationHolder configurationHolder, ProjectSettings projectSettings, IEnumerable`1 generatorPlugins)
    at SpecFlow.Tools.MsBuild.Generation.GenerateFeatureFileCodeBehindTask.Execute()

    Visual studio is reporting the file SpecFlow.Tools.MsBuild.Generator.Generation.targets line 93 is there the error originates.

    Any help would be greatly appreciated.

    Andreas Willich
    @SabotageAndi
    @TotalTest did you pack the dependency into the nuget package of your plugin?
    Prab
    @TotalTest

    Hi Andreas, I did yes and have tried many things with no luck. I have published a pre release version on nuget if you wanted to take a look:
    https://www.nuget.org/packages/SpecFlow.Contrib.Variants/3.0.0-pre

    Thanks

    Andreas Willich
    @SabotageAndi
    @TotalTest the newtonsoft.json assembly is not part of the nuget package
    image.png
    for generator plugins you have to ship it within the package
    but you don't need the dependency on the package itself
    Prab
    @TotalTest

    How do I include that? It doesn't seem that the Newtonsoft.Json dll is in the \bin\Debug\netstandard2.0 directory (once built) so it can't be copied to the build directory, like the customplugin dll can.

    So essentially the below doesn't seem to work for standard (final two lines):

    <files>
    <file src="build\**\*" target="build"/>
    <file src="bin\$config$\net471\SpecFlow.Contrib.Variants.SpecFlowPlugin.*" target="build\net471"/>
    <file src="bin\$config$\netstandard2.0\SpecFlow.Contrib.Variants.SpecFlowPlugin.dll" target="build\netstandard2.0"/>
    <file src="bin\$config$\netstandard2.0\SpecFlow.Contrib.Variants.SpecFlowPlugin.pdb" target="build\netstandard2.0"/>

    <file src="bin\$config$\net471\Newtonsoft.Json.*" target="build\net471"/>
    <file src="bin\$config$\netstandard2.0\Newtonsoft.Json.dll" target="build\netstandard2.0"/>
    </files>

    Prab
    @TotalTest

    I managed to figure it out, for standard there is a .deps file in the built output, include this file in the package. For framework just include the dependant dll

    <file src="bin\$config$\net471\Newtonsoft.Json.*" target="build\net471"/>

    <file src="bin\$config$\netstandard2.0\SpecFlow.Contrib.Variants.SpecFlowPlugin.*" target="build\netstandard2.0"/>

    Josh Keegan
    @JoshKeegan
    Hi, the official specflow plugins are versioned along with specflow itself, e.g. both specflow and specflow.xunit are currently on 3.1.89.
    Is there a reason for this & should unofficial packages do the same, or depend on a range of specflow versions?
    Andreas Willich
    @SabotageAndi
    @JoshKeegan The reason is, that we publish all packages at once, also when there were no changes in them. It would be too much confusing having multiple packages which have a different latest version.
    Andreas Willich
    @SabotageAndi

    What "unofficial" packages do with their version is up to them. We don't have here any suggestions.
    I would suggest, that you limit your dependency on the supported Major.Minor version number. Reason is, that when we change the plugin interface, we increase the minor version.

    There are some plugins out on nuget, that only have SpecFlow >=1.9 as dependency. The user can add these nuget packages, but they will not work, because the plugin interface changed a lot since 1.9. https://www.nuget.org/packages/Baseclass.Contrib.SpecFlow.Selenium.NUnit/1.3.2-tn40support2 is an example for it.

    Josh Keegan
    @JoshKeegan
    Thanks Adreas, that makes sense :)
    Gemma Buckley
    @midgetgem
    Hi, I have a custom generator plugin, added to my C# project with a package reference, but how do I configure the plugin? I want to add an entry that will be picked up when GeneratorPluginParameters is passed into the IGeneratorPlugin Initialize method. Should I be adding an entry to the app.config, or the specflow.json file? Thanks in advance
    drosenba
    @drosenba
    I asked on Stakcoverflow: https://stackoverflow.com/questions/61258555/how-to-create-a-plugin-for-specflow-feature-level-templates , but did not get any response. Maybe this is a better channel to look for some guidance/direction. Also, is it yet possible to create plugins for SpecFlow.NetCore? The docs say "Runtime plugins need to target .NET Framework 4.5 and .NET Standard 2.0."
    drosenba
    @drosenba
    It's not even clear to me whether I need to create a Generator plugin or a Runtime plugin (or both). There is no description as to the purpose of these plugin types.
    Vamsi TP
    @vamsitp
    @SabotageAndi - Is there a sample that shows the usage of a generator-plugin once it's packaged as a Nuget? Do we just need to add a nuget reference to the generator-plugin in the actual test-project, or do we have a way to specify what generators to use within the nuget? Will all the classes that implement the IGeneratorPlugin interface automatically kick in?
    Andreas Willich
    @SabotageAndi
    @vamsitp there is no ordering or additional configuration. You add the NuGet PackageReference to the test project and that was ist. all IGeneratorPlugin implementations with the marker attribute are called
    Pavel Anihimovsky
    @pavelanihimovsky
    Hi, I'm working on runtime plugin for tool that allows to collect information about test executions (https://github.com/aquality-automation/aquality-tracking) and I faced with an issue. The issue relates to Scenario Outline. I have to create separate test for each Example in this tool. If I use scenarioContext.ScenarioInfo.Title I get the same name for all tests of Scenario Outline, but I want to get something like this as name of test in this tool Feature name: Scenario name: {example_number}. Please let me know is it possible to get Examples of Scenario Outline in runtime and how or something else that can help me with this?