Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in feature.cs file generation : The name 'featureTags' does not exist in the current context #2569

Closed
DomZZ opened this issue Mar 12, 2022 · 9 comments

Comments

@DomZZ
Copy link

DomZZ commented Mar 12, 2022

SpecFlow Version

3.9.58

Which test runner are you using?

NUnit

Test Runner Version Number

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

Visual Studio Test Explorer

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

{
"$schema": "https://specflow.org/specflow-config.json",
"generator": {
"addNonParallelizableMarkerForTags": [ "nonparallelizable" ]
},
"runtime": {
"missingOrPendingStepsOutcome": "Error"
},
"stepAssemblies": [
{
"assembly": "ALOP"
}
]
}

Issue Description

Many errors in feature.cs files :

`private string[] _featureTags = new string[] { "bdes"};
string[] tagsOfScenario = ((string[])(null));
System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary();
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("BDES-011B _ Validation saisie des données par gestionnaire", null, tagsOfScenario, argumentsOfScenario, featureTags);
this.ScenarioInitialize(scenarioInfo);

if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags)))`

In method you use featureTags but variable is named _featureTags ...

Steps to Reproduce

Use SpecFlow last SpecFLow nuget packages
Compile solution
You should see that all feature.cs files have errors

Link to Repro Project

No response

@DomZZ DomZZ added the Bug label Mar 12, 2022
@DomZZ DomZZ changed the title error in feature file generation : The name 'featureTags' does not exist in the current context error in feature.cs file generation : The name 'featureTags' does not exist in the current context Mar 12, 2022
@bollhals
Copy link
Contributor

Do you have any additional plugins?

The correct name is featureTags after #2410. So the methods are correct, but the field is wrong, I suspect there is an additional plugin that messes with it.

@SabotageAndi
Copy link
Contributor

@DomZZ I created multiple new projects in the last days and they all worked. So it has to be something with your setup of the one project.
Please create a new project and take over one configuration at a time from your original project until you find out what is causing this issue.

@DomZZ
Copy link
Author

DomZZ commented Mar 14, 2022

It is exactly like you said, I've removed LivingDoc nuget package and all feature files are ok now, and even when I add again this nuget package it still works ...

@DomZZ DomZZ closed this as completed Mar 14, 2022
@utherkrandt
Copy link

I had the same problem.
The plugin used is SpecFlow.Actions.Selenium.
The bug appears when I use the multiple browser

Steps to Reproduce
Use SpecFlow.MsTest 3.9.58 and SpecFlow.Actions.Selenium 0.1.283
Add specflow.actions.json
Add specflow.actions.chrome.json

Compile solution
You should see that all feature.cs files have errors

@utherkrandt
Copy link

No problem with SpecFlow.xUnit(3.9.58)

@SabotageAndi SabotageAndi reopened this Mar 21, 2022
@SabotageAndi
Copy link
Contributor

Yeah, I found the issue last week, but then got sick. There is a problem in the SpecFlow.Actions.Configuration package with the code generation. I will try to get an updated version up on NuGet.org in the next days.

@LukemansfieldPAX
Copy link

I appear to be getting the same issue "The name 'TagHelper' does not exist in the current context" since updating SpecFlow to version 3.9.58.

@SabotageAndi
Copy link
Contributor

@LukemansfieldPAX the problem is in the SpecFlow.Actions.Configuration package.
If you update all SpecFlow packages to the latest version, it should work again.
If not, please post your combination of SpecFlow packages (+ version number).

@DomZZ DomZZ closed this as completed Apr 27, 2022
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants