Git Product home page Git Product logo

specflow.contrib.variants's People

Contributors

dependabot[bot] avatar totaltest avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

specflow.contrib.variants's Issues

Tables in scenario steps cause code generator to emit repeated table header rows rather than content rows

Steps to reproduce

  • Create a feature containing a scenario with a table
  • Build the project
  • Inspect the generated code

Expected
The generated code builds a table with one header and a row for each input content row

Actual
The generated code builds a table with one header but repeats the header for each input data row rather than using the values in the content row

Example:

Scenario: Add some numbers
    Given these numbers:
        | left | right |
        | 1    | 1     |
        | 2    | 2      |
    When added
    Then the result is:
        | answer |
        | 2       |
        | 4       |

produces:

[Xunit.FactAttribute(DisplayName="Add some numbers")]
        [Xunit.TraitAttribute("FeatureTitle", "Data Store operations")]
        [Xunit.TraitAttribute("Description", "Add some numbers")]
        public virtual void AddSomeNumbers()
        {
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Add some numbers", null, ((string[])(null)));
            this.ScenarioInitialize(scenarioInfo);
            this.ScenarioStart();
            TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] {
                        "left",
                        "right"});
            table9.AddRow(new string[] {
                        "left",
                        "right"});
            table9.AddRow(new string[] {
                        "left",
                        "right"});
            testRunner.Given("these numbers:", ((string)(null)), table9, "Given ");
            testRunner.When("added", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
            TechTalk.SpecFlow.Table table10 = new TechTalk.SpecFlow.Table(new string[] {
                        "answer"});
            table10.AddRow(new string[] {
                        "answer"});
            table10.AddRow(new string[] {
                        "answer"});
            testRunner.Then("the result is:", ((string)(null)), table10, "Then ");
            this.ScenarioCleanup();
        }

Could not load TechTalk.SpecFlow.Generator

We wanted to use your plugin together with xunit, playwright and net6 and the scenario generation for multiple tests works well, but as soon as I run a test, I get this error when I start the virtual service.

One or more errors occurred. (Unable to load one or more of the requested types.
Could not load file or assembly 'TechTalk.SpecFlow.Generator, Version=3.9.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41'. The system cannot find the file specified.

I can not seam to find this nuget or a class of it anywhere. I also found some issues on SO that mention to rebuild and reinstall the nuget but all of that did not help. Does someone else also have this issue and could point me to a solution? It feels like some nuspec is configured wrong... If I uninstall the dependency to
SpecFlow.Contrib.Variants the test cases dont work anymore but the I do not the the exception above.

featureContext returns null value for variant

Hi there,

I am trying to use this to get a variant of a feature tag on one of my specflow tests but it keeps giving me null.

Using SpecFlow.NUnit 3.5.5 and SpecFlow.Contribs.Variants 3.5.5

I have an example feature like

@Variant:Android_HighSpec
@Variant:iOS_HighSpec
@Variant:Mac_HighSpec
@Variant:Windows_HighSpec
Feature: Adding Numbers

Scenario: Add two numbers
Given I have the calculator open
When I add 2 + 3
Then the result is 5

Then in my FeatureHooks I have something like...

[BeforeFeature(Order = 0)]
public static void BeforeFeature(FeatureContext featureContext, IObjectContainer container)
{
// hooks code i want to run...
featureContext.TryGetValue("Variant", out string variant);
}

variant always returns null though no matter what :(

I have set my specflow.json accordingly too.

I just tested same setup but with scenarioContext instead of featureContext and scenarioContext correctly got the variant value, but featureContext does not.

using .net core 3.1

Variant not displayed in test explorer VS Mac 2022

Hi,
So, I have been trying to figure out what is going on and where the problem lies.
I updated my projects to net7 and lates VS Mac and updated all nugets to the latest net7 compatible.
After that I found that my UI project tests no longer displayed the variant in the explorer.

Please see my old stack question for some screen shots.

It appears the "old" way I note in my stack post (adding a scenarios table) works still, but the variant plugin does not.

Is this an issue with your code or something the VS people removed?

Thanks for any info.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.