totaltest / specflow.contrib.variants Goto Github PK
View Code? Open in Web Editor NEWSpecFlow plugin to allow variants of a test to be run using tags e.g. against different browsers
License: MIT License
SpecFlow plugin to allow variants of a test to be run using tags e.g. against different browsers
License: MIT License
Steps to reproduce
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();
}
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.
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.