Hi,
I want to use [Binding] attribute for class in different project. In full framework there is a section in appConfig
But does this feature work in .core? my specflow.json looks like this
{
"language": {
"feature": "cs-CZ"
},
"stepAssemblies": [
{
"assembly": "e2eTests.Shared.dll"
}
]
}
It seems the element stepAssemblies is ignored.
Thanks
Here is the unit test with an example: https://github.com/techtalk/SpecFlow/blob/master/Tests/TechTalk.SpecFlow.RuntimeTests/Configuration/JsonConfigTests.cs#L341
Here is the unit test with an example: https://github.com/techtalk/SpecFlow/blob/master/Tests/TechTalk.SpecFlow.RuntimeTests/Configuration/JsonConfigTests.cs#L341
It is just test for json file structure. Seems in .core it is not implemented.
There shouldn't be a difference for .NET Framework and .NET Core in the implementation.
The test for it is here: https://github.com/techtalk/SpecFlow/blob/master/Tests/TechTalk.SpecFlow.Specs/Features/Execution/ExternalSteps.feature#L6
Yes, it is described in app.config style, but we are transforming this in the background to the specflow.json.
I have the same problem, i have defined stepAssemblies in specflow.json file but i still get "No matching step definition found for one or more steps"
When you execute the scenario or in VS?
When I execute scenario
馃 could you create a small project to reproduce the issue?
I'm trying but i in cs genrated from feature file i get:
We could not find a data exchange file at the path System.Configuration.ConfigurationErrorsException: SpecFlow configuration error ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
Please open an issue at https://github.com/techtalk/SpecFlow/issues/
Complete output:
System.Configuration.ConfigurationErrorsException: SpecFlow configuration error ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at System.Configuration.ConfigurationSection.DeserializeSection(XmlReader reader)
at TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler.CreateFromXml(String xmlContent)
at TechTalk.SpecFlow.Generator.Configuration.GeneratorConfigurationProvider.GetPlugins(SpecFlowConfigurationHolder configurationHolder)
--- End of inner exception stack trace ---
at TechTalk.SpecFlow.Generator.Configuration.GeneratorConfigurationProvider.GetPlugins(SpecFlowConfigurationHolder configurationHolder)
at TechTalk.SpecFlow.Generator.GeneratorContainerBuilder.LoadPlugins(ObjectContainer container, IGeneratorConfigurationProvider configurationProvider, SpecFlowConfigurationHolder configurationHolder)
at TechTalk.SpecFlow.Generator.GeneratorContainerBuilder.CreateContainer(SpecFlowConfigurationHolder configurationHolder, ProjectSettings projectSettings)
at TechTalk.SpecFlow.Generator.TestGeneratorFactory.CreateGenerator(ProjectSettings projectSettings)
at TechTalk.SpecFlow.VisualStudio.CodeBehindGenerator.Actions.GenerateTestFileAction.GenerateTestFile(GenerateTestFileParameters opts)
Command: c:\users\tokan1\appdata\local\microsoft\visualstudio\15.0_f56a7326\extensions\sszmbupi.gnp\TechTalk.SpecFlow.VisualStudio.CodeBehindGenerator.exe
Parameters: GenerateTestFile --featurefile C:\Users\tokan1\AppData\Local\Temp\tmp3326.tmp --outputdirectory C:\Users\tokan1\AppData\Local\Temp --projectsettingsfile C:\Users\tokan1\AppData\Local\Temp\tmp3316.tmp
Working Directory:
Ok i found why my code generation doesn't work:
When i deleted feature.cs this was added to .csproj:
<ItemGroup>
<SpecFlowFeatureFiles Remove="Features\SpecFlowFeature1.feature" />
</ItemGroup>
and this stops code generation for my feature files, I delete that and code genration works fine. Any idea why this happend? 馃槂
@Planche95 yes, see #1311. It's currently a manual step. We are working on a solution. This issue is the one thing that holds us currently from a final release of SpecFlow 3.
Yea, my bad i din't read article to the end 馃槥 i updated https://github.com/Planche95/Specflow-test with external project and "stepAssemblies" in json, it doesn't work
Weird, when I add "stepsAssemblies" Specflow Plugin can navigate to external steps with "Go to Definition", but it can't be found during execution.
Also Specflow Plugin doesn't really work well for me in terms of updating the feature file when a new steps are added, I have to restart visual studio to make it find new steps.
@SabotageAndi any updates?
No. I didn't had a look at it yet.
As I am working on #1311 I don't think I will have a look at it in the next week or two.
But that's the good thing about OSS. You could have a look at the source and find the issue on your own. ;-)
Here is a start point: https://github.com/techtalk/SpecFlow/blob/master/TechTalk.SpecFlow/Configuration/JsonConfig/JsonConfigurationLoader.cs#L86
It's where we read the json file.
Isnt problem that all [JsonProperty] are commented?
[DataMember] is for xml no? What deserializer specflow uses? Usualy it is case sensitive, you need to use jsonproperty or deserialiser who watches [DataMember] (which would be strange in json :-)
It's a duplicate of #1315, when I set "Copy to Output Directory" to "Copy Always" on this json file it works
closed because duplicate of #1315
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.
Most helpful comment
It's a duplicate of #1315, when I set "Copy to Output Directory" to "Copy Always" on this json file it works