Skip to content

Generated cucumber json missing the uri property#609#618

Merged
ericcmmi merged 5 commits intopicklesdoc:mainfrom
CoverGo:Generated-Cucumber-JSON-missing-the-uri-property#609
Sep 22, 2021
Merged

Generated cucumber json missing the uri property#609#618
ericcmmi merged 5 commits intopicklesdoc:mainfrom
CoverGo:Generated-Cucumber-JSON-missing-the-uri-property#609

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Sep 20, 2021

I'm looking for a way how to pass SpecFlow test results into Jira BDD plugins like Behave.Pro
Pickles support Cucumber JSON format, but an outdated version. I failed to use the current report, it is not recognized by Jira plugin Behave.Pro and Cucumber for Jira.

So I decided to update pickles to do the job. There are some other options but I believe Pickles fits perfectly.

This PR updates the Cucumber JSON report to comply with the schema and make it usable with Behave.Pro

Features
Cucumber JSON report

  • add feature uri field
  • add feature and step id field
  • add step hidden field
  • update test result representation according to schema

Command line runner

  • add command-line parameter feature-base-uri to set the base Uri for features in the Cucumber JSON report
  • make project packable as dotnet tool. I use it to consume pickles in CI and local development.

Refactoring to launch tests on .Net core

My dev environment is .Net5 on MacOS and Rider, so I made my changes on top of the latest unreleased main branch with .Net core support. Thanks a lot for it, @x97mdr!

There are a lot of changes to file names, paths, and filesystem handling in tests.
Mostly it is about avoiding usage of Windows-specific file paths and building the file paths in a platform-independent way.
There was a need for few packages updates to work on macOS, leading to additional code changes as well.

I'm able to build and test Pickles using:

dotnet build -c Debug
dotnet test -c Debug --no-build

The Release configuration does not build as it includes ASP.NET project.
Test summary:
2021-09-20_13-51-19

One test is red because of the OpenXML package error. I tried to solve it with no success, but believe it is platform-specific.
The contribution guide is Windows and Visual-Studio specific, so I did not follow it in some places. Please let me know if I should change smth in the PR.

Andrey Leskov added 4 commits September 20, 2021 13:35
Update filesystem abstraction nuget package System.IO
Make related changes to tests: 
use IDirectoryInfo instead of DirectoryInfoBase, 
IFileSystemInfo instead of FileSystemInfoBase,
IFileInfo instead of FileInfoBase


Update DocumentFormat.OpenXML package, but still have xml-related error on MacOS during unit tests 
Use filesystem to build paths 
Do not use Windows-specific filepaths like "c:\file"
Use Environment.NewLine instead of \r\n

Update NFluent to compare strings thinking less of different line endings on different platforms

picklesdoc#609
Produce test result value according to
https://github.com/cucumber/cucumber-json-schema

Update existing cucumber tests to run on non-windows platform
picklesdoc#609
Add feature base uri parameter to command line
@ghost ghost marked this pull request as ready for review September 21, 2021 03:42
Update csproj to not use deprecated fields
@ericcmmi
Copy link
Copy Markdown
Member

Whoa, thanks @andrey-covergo! I had just started working on getting the solution to be able to dev in Mac so your timing is perfect! I've been using Visual Studio for Mac but it's giving me some errors so I'm going to download Rider. If I like that better than Visual Studio Mac I'll go ahead and buy it. Give me a little time to review and I'll get this pulled in. Again, thank you!

@ghost
Copy link
Copy Markdown
Author

ghost commented Sep 22, 2021

@ericcallsynx you are welcome, pickles is an amazing tool crafted with love. It is my pleasure to contribute. This PR is ide-agnostic, everything should work with any IDE like VS, VS Code, VS for Mac, Rider on the respective platform. What kind of errors do you get from VS for Mac?

@ericcmmi
Copy link
Copy Markdown
Member

Approving the PR into this branch and will work on the outstanding unit test failure

@ericcmmi ericcmmi merged commit 83fb8f3 into picklesdoc:main Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant