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" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hindsight.Behave --version 0.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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:

  1. Install Visual Studio
  2. Create your project
  3. Install SpecFlow for Visual Studio (needed to automatically generate *.cs files from feature files)
  4. Install the Hindsight.Behave, SpecFlow, SpecFlow.NUnit, NUnit, NUnit.Runners and NUnitTestAdapter into your solution via NuGet.
  5. Add the Behave task into your .csproj file. (See Using with MSBuild as a Task section below)
  6. Click Build and the features will be downloaded
  7. Add the features folder into your project via Visual Studio
  8. Use the SpecFlow to autogenerate .cs files.
  9. 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=&quot;BeforeBuilds&quot;

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:

  1. Install Visual Studio
  2. Create your project
  3. Install SpecFlow for Visual Studio (needed to automatically generate *.cs files from feature files)
  4. Install the Hindsight.Behave, SpecFlow, SpecFlow.NUnit, NUnit, NUnit.Runners and NUnitTestAdapter into your solution via NuGet.
  5. Add the Behave task into your .csproj file. (See Using with MSBuild as a Task section below)
  6. Click Build and the features will be downloaded
  7. Add the features folder into your project via Visual Studio
  8. Use the SpecFlow to autogenerate .cs files.
  9. 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=&quot;BeforeBuilds&quot;

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.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.2.0 1,070 5/4/2018
0.1.8 1,919 10/8/2014
0.1.5 623 8/2/2013
0.1.4 416 8/2/2013
0.1.3 608 1/29/2013
0.1.2 483 1/29/2013
0.1.1 465 12/11/2012
0.1.0 473 12/11/2012