Hindsight.Behave
0.2.0
A .NET package to provide support for downloading features from Behave for Jira
Install-Package Hindsight.Behave -Version 0.2.0
dotnet add package Hindsight.Behave --version 0.2.0
<PackageReference Include="Hindsight.Behave" Version="0.2.0" />
paket add Hindsight.Behave --version 0.2.0
More documentation here: http://help.hindsightsoftware.com/bdd-and-the-software-testing-team#test-automation and here: http://help.hindsightsoftware.com/bdd-and-the-software-testing-team/test-automation/specflow-for-visual-studio-and-net
Behave Pro can export the created Feature and Scenarios to any gherkin compatible test automation tool. For Visual Studio/.NET based projects we have a plugin for MSBuild that integrates into the build process. You can use the Behave assembly as an MSBuild task as part of your build process. We host our plugin on the NuGet gallery, and it is available through the NuGet Packet Manager Shell:
Install-Package Hindsight.Behave
Step by step
Short version of using this package:
- Install Visual Studio
- Create your project
- Install SpecFlow for Visual Studio (needed to automatically generate
*.cs
files from feature files) - Install the Hindsight.Behave, SpecFlow, SpecFlow.NUnit, NUnit, NUnit.Runners and NUnitTestAdapter into your solution via NuGet.
- Add the Behave task into your
.csproj
file. (See Using with MSBuild as a Task section below) - Click Build and the features will be downloaded
- Add the features folder into your project via Visual Studio
- Use the SpecFlow to autogenerate
.cs
files. - Run the tests.
Using with MSBuild as a Task
To use with NET Framework, modify your project file (the *.csproj
file) by adding the following:
<UsingTask TaskName="Behave" AssemblyFile="$(NuGetPackageRoot)\Hindsight.Behave.0.2.0\lib\net45\Behave.dll" />
<Target Name="BeforeBuild">
<Behave host="https://behave.pro" project="11500" username="..." password="..." directory="Features\" manual="true" verify="true" nunit="true" />
</Target>
You can change the ...\lib\net45\...
to a different framework version you want to use. The available versions are: net20
, net35
, net45
, net46
.
To use with NET Core, modify your project file by adding the following:
<UsingTask TaskName="Behave" AssemblyFile="$(NuGetPackageRoot)\hindsight.behave\0.2.0\lib\netstandard2.0\Behave.dll" />
<Target Name="BeforeBuilds" AfterTargets="Build">
<Behave host="https://behave.pro" project="11500" username="..." password="..." directory="Features\" manual="true" nunit="true" />
</Target>
Note: Depending on the project configuration, you will have to change the Target Name="BeforeBuilds"
Note: The $(NuGetPackageRoot)
points to the folder where your NuGet packages are stored.
The task has four required parameters, host , project , username and password . These 4 parameters are different depending on if you are using Jira Cloud or Server. You can retrieve the correct details the Jira project's admin area; 'Project Settings' > 'Behave Pro' > 'Generate config'.
Using within a script
If you do not want to use this package as a MSBuild task, you can use the Jira Connector within your own C# code to download features from Behave Pro:
using Hindsight.Behave;
public class Demo
{
public void Download()
{
JiraConnector jc = new JiraConnector("https://behave.pro");
jc.Fetch(
// The project id of the target project
project: "10100",
// The API Key username
username: "Cloud userId OR Jira Server Username",
// The API Key value
password: "Cloud API key OR Jira Server Password",
// Directory to extract features to (relative to script)
directory: "features",
// Boolean whether to include manual tests
manual: true,
// Boolean whether to verify the SSH certificate
verify: true,
// Boolean whether to return feature files that
// are compatible with NUnit.
isNUnit: true
);
}
}
Running the tests
This package won't run the tests for you, it will only download the feature files for you. To run the feature files, you will need to install SpecFlow for Visual Studio.
Step by step tutorial
For step by step tutorial go here
More documentation here: http://help.hindsightsoftware.com/bdd-and-the-software-testing-team#test-automation and here: http://help.hindsightsoftware.com/bdd-and-the-software-testing-team/test-automation/specflow-for-visual-studio-and-net
Behave Pro can export the created Feature and Scenarios to any gherkin compatible test automation tool. For Visual Studio/.NET based projects we have a plugin for MSBuild that integrates into the build process. You can use the Behave assembly as an MSBuild task as part of your build process. We host our plugin on the NuGet gallery, and it is available through the NuGet Packet Manager Shell:
Install-Package Hindsight.Behave
Step by step
Short version of using this package:
- Install Visual Studio
- Create your project
- Install SpecFlow for Visual Studio (needed to automatically generate
*.cs
files from feature files) - Install the Hindsight.Behave, SpecFlow, SpecFlow.NUnit, NUnit, NUnit.Runners and NUnitTestAdapter into your solution via NuGet.
- Add the Behave task into your
.csproj
file. (See Using with MSBuild as a Task section below) - Click Build and the features will be downloaded
- Add the features folder into your project via Visual Studio
- Use the SpecFlow to autogenerate
.cs
files. - Run the tests.
Using with MSBuild as a Task
To use with NET Framework, modify your project file (the *.csproj
file) by adding the following:
<UsingTask TaskName="Behave" AssemblyFile="$(NuGetPackageRoot)\Hindsight.Behave.0.2.0\lib\net45\Behave.dll" />
<Target Name="BeforeBuild">
<Behave host="https://behave.pro" project="11500" username="..." password="..." directory="Features\" manual="true" verify="true" nunit="true" />
</Target>
You can change the ...\lib\net45\...
to a different framework version you want to use. The available versions are: net20
, net35
, net45
, net46
.
To use with NET Core, modify your project file by adding the following:
<UsingTask TaskName="Behave" AssemblyFile="$(NuGetPackageRoot)\hindsight.behave\0.2.0\lib\netstandard2.0\Behave.dll" />
<Target Name="BeforeBuilds" AfterTargets="Build">
<Behave host="https://behave.pro" project="11500" username="..." password="..." directory="Features\" manual="true" nunit="true" />
</Target>
Note: Depending on the project configuration, you will have to change the Target Name="BeforeBuilds"
Note: The $(NuGetPackageRoot)
points to the folder where your NuGet packages are stored.
The task has four required parameters, host , project , username and password . These 4 parameters are different depending on if you are using Jira Cloud or Server. You can retrieve the correct details the Jira project's admin area; 'Project Settings' > 'Behave Pro' > 'Generate config'.
Using within a script
If you do not want to use this package as a MSBuild task, you can use the Jira Connector within your own C# code to download features from Behave Pro:
using Hindsight.Behave;
public class Demo
{
public void Download()
{
JiraConnector jc = new JiraConnector("https://behave.pro");
jc.Fetch(
// The project id of the target project
project: "10100",
// The API Key username
username: "Cloud userId OR Jira Server Username",
// The API Key value
password: "Cloud API key OR Jira Server Password",
// Directory to extract features to (relative to script)
directory: "features",
// Boolean whether to include manual tests
manual: true,
// Boolean whether to verify the SSH certificate
verify: true,
// Boolean whether to return feature files that
// are compatible with NUnit.
isNUnit: true
);
}
}
Running the tests
This package won't run the tests for you, it will only download the feature files for you. To run the feature files, you will need to install SpecFlow for Visual Studio.
Step by step tutorial
For step by step tutorial go here
Release Notes
Now compatible with NET Core! Added new releases for netstandard2.0, net35, net45, and net46.
Dependencies
This package has no dependencies.
Used By
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.