PlayNicely.SpecFlow.Executor 2.2.0-beta-465

This is a prerelease version of PlayNicely.SpecFlow.Executor.
There is a newer version of this package available.
See the version list below for details.
dotnet add package PlayNicely.SpecFlow.Executor --version 2.2.0-beta-465
                    
NuGet\Install-Package PlayNicely.SpecFlow.Executor -Version 2.2.0-beta-465
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PlayNicely.SpecFlow.Executor" Version="2.2.0-beta-465" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PlayNicely.SpecFlow.Executor" Version="2.2.0-beta-465" />
                    
Directory.Packages.props
<PackageReference Include="PlayNicely.SpecFlow.Executor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PlayNicely.SpecFlow.Executor --version 2.2.0-beta-465
                    
#r "nuget: PlayNicely.SpecFlow.Executor, 2.2.0-beta-465"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=PlayNicely.SpecFlow.Executor&version=2.2.0-beta-465&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=PlayNicely.SpecFlow.Executor&version=2.2.0-beta-465&prerelease
                    
Install as a Cake Tool

Play Nicely - SpecFlow Executor

The Play Nicely SpecFlow projects provide Gherkin language bindings for PlayNicely.Executor. These bindings allow you to require or uninstall commands, specify package sources and mappings, and set test case projects. These scenarios are designed to support building release tests for Play Nicely npm package projects.

Getting Started

To start using these bindings in a SpecFlow project, install this package, or one of the more specific packages, as a dependency. Then add or update the specflow.json so that the project picks up the bindings.

With this done, you can use the bindings to specify your scenarios.

Install the package

From the Package Manager Console:

Install-Package PlayNicely.SpecFlow.Executor -ProjectName "_your-specflow-project_"

ℹ️ Or use one of the more specific packages such as PlayNicely.SpecFlow.DotNet

Add or Update specflow.json

For SpecFlow to pick up the bindings from external assemblies, they have to be configured in the project's specflow.json file. If the project doesn't already have it, add the item to the root of your SpecFlow project.

Add the external assemblies to the file:

{
    "stepAssemblies": [
        { "assembly": "PlayNicely.SpecFlow.Executor" }
    ]
}

You can now use the step definitions and bindings from Play Nicely.

Working Examples

The PlayNicely.NpmNpx and PlayNicely.Sass projects contain real examples of how to set up your projects and configure test scenarios.

Creating Test Scenarios

This package provides step definitions and hooks to simplify scenario set up. Many scenarios require a test environment and, if a test fails, to output any data sent to stdout or stderr.

The test environment hook will run if you tag your features or scenarios with @test-environment. The order of these hooks are determined using the Order property on hook attributes, the values of these are defined in the SpecFlowConts.BindingOrder static class. You can use these to develop downstream hooks that rely on these concepts, e.g. if it needs a TestEnvironmentBuilder.

Step Definitions

This package provides the following step definitions for use in test scenarios.

Given
  • Given command (command) is installed Ensures that command is on the $PATH in the test environment.
  • Given command (command) is uninstalled If the command is found on the $PATH, its directory will be removed from the $PATH in the test environment. This simulates the command being unavailable (uninstalled). For a more complete description of how this works see this page.
When
  • When command (command line) is executed Executes process based on the command line provided. The command line is parsed based on the Linux shell rules, \ is the escape character and both " and ' are accepted as quotes.
Then
  • Then the command should [succeed|fail] Test whether the process exited successfully or not.
  • Then [directory|file|path] (relative/path) should exist Test to ensure a directory, file, or either exists relative to the test execution working directory.
  • Then [directory|file|path] (relative/path) should not exist Test to ensure a directory, file or either does not exist relative to the test execution working directory.
  • Then [stderr|stdout] should contain (text) Test that the standard error, or output, stream of the process contains text.
  • Then [stderr|stdout] should match (regex) Test the standard error, or output, stream of the process to ensure regex matches.

Hooks and Extensions

The EnvironmentBuilderHooks create a TestEnvironmentBuilder before each scenario and stores it in the ScenarioContext. This builder can be accessed using the extension method ScenarioContext.RequireEnvironmentBuilder() and other methods of the TestEnvironmentBuilderExtensions class.

The ExecutionResultHooks checks to see if a scenario failed, and if it did, outputs any ExecutionResult stdout and stderr streams. Steps can Collect the result using the extension method ScenarioContext.CollectResult(result) of the ExecutionResultExtensions class (this collection is already done for Play Nicely defined steps). This class provides extensions for accessing the execution result, including results that include a context.

The DisposableExtensions allow scenarios to create disposable resources and have them disposed after the scenario finishes. Use the ScenarioContext.MarkForDisposal(disposable) method for this purpose.

Constants

The SpecFlowConsts class defines constants for tags and binding order.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on PlayNicely.SpecFlow.Executor:

Package Downloads
PlayNicely.SpecFlow.DotNet

SpecFlow bindings that allow you to run tests by executing dotnet commands against a pre-configured test environment and test case project.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.3.2-beta-550 97 10/4/2024
2.3.2-beta-543 107 9/28/2024
2.3.2-beta-535 104 9/28/2024
2.3.2-beta-529 99 9/23/2024
2.3.2-beta-518 119 9/21/2024
2.3.2-beta-511 101 9/20/2024
2.3.2-beta-509 99 9/20/2024
2.3.2-beta-507 88 9/20/2024
2.3.2-beta-505 102 9/19/2024
2.3.2-beta-501 113 9/18/2024
2.3.2-beta-499 112 9/18/2024
2.3.2-beta-496 91 9/18/2024
2.3.2-beta-494 106 9/18/2024
2.3.2-beta-492 114 9/18/2024
2.3.1 147 9/17/2024
2.3.1-beta-487 99 9/17/2024
2.3.0 141 9/14/2024
2.3.0-beta-479 102 9/14/2024
2.3.0-beta-472 119 9/14/2024
2.2.0-beta-465 114 9/7/2024
2.1.1 133 6/1/2024
2.1.1-beta-450 110 7/14/2024
2.1.1-beta-442 109 7/12/2024
2.1.1-beta-432 95 7/11/2024
2.1.1-beta-418 103 6/1/2024
2.1.1-beta-398 92 6/1/2024
2.1.0 153 5/8/2024
2.1.0-beta-393 86 5/31/2024
2.1.0-beta-382 133 5/21/2024
2.1.0-beta-370 125 5/8/2024
2.1.0-beta-355 133 5/7/2024
2.0.0 157 5/6/2024
2.0.0-beta-349 130 5/7/2024
2.0.0-beta-346 139 5/7/2024
2.0.0-beta-340 122 5/7/2024
2.0.0-beta-323 113 5/6/2024
1.3.0 141 4/26/2024
1.3.0-beta-312 108 4/26/2024
1.2.0 165 4/14/2024
1.2.0-beta-299 125 4/14/2024
1.2.0-beta-296 138 4/14/2024
1.1.1 183 4/11/2024
1.1.1-beta-287 129 4/11/2024
1.1.1-beta-282 143 4/11/2024
1.1.1-beta-280 138 4/10/2024
1.1.1-beta-278 107 4/10/2024
1.1.1-beta-276 128 4/10/2024
1.1.1-beta-274 128 4/9/2024
1.1.1-beta-272 128 4/9/2024
1.1.0 149 3/21/2024
1.1.0-beta-266 131 3/21/2024
1.1.0-beta-260 122 3/21/2024
1.0.1 184 3/10/2024
1.0.1-prerelease-20240301-0... 134 3/1/2024
1.0.1-beta-227 124 3/10/2024
1.0.1-beta-221 123 3/9/2024
1.0.1-beta-214 124 3/9/2024
1.0.1-beta-208 122 3/1/2024
1.0.1-beta-206 119 3/1/2024
1.0.0 201 2/29/2024
1.0.0-prerelease-20240229-1... 116 2/29/2024
1.0.0-prerelease-20240228-0... 111 2/28/2024
1.0.0-prerelease-20240226-1... 115 2/26/2024
1.0.0-prerelease-20240225-0... 109 2/25/2024
1.0.0-prerelease-20240225-0... 137 2/25/2024