SpecFlow+ LivingDoc 0.2.19 Released

SpecFlow+ LivingDoc 0.2.19 has been released and is available on the Visual Studio marketplace. This version includes the following changes:

  • Changing the build definition/branch selection or selecting a node in the feature tree updates the URL in the address bar
  • Opening a link to LivingDoc containing a feature/scenario now selects the corresponding drop-down entries and opens the feature tree
  • Opening LivingDoc using a URL that does not contain a definition/branch opens the latest selected build definition and most recently selected branch

Fix:

  • The bottom line of the feature tree is no longer cut off

SpecFlow+ LivingDoc 0.2.17 Released

The new LivingDoc version 0.2.17 is available and it contains the feature of linking feature/scenario tags to certain work items.

This prefix will indicate that the tag marked with it is a special tag that will be connected to the work item.

The way it works is as follows:

  • A prefix for the project should be chosen. This prefix will indicate that the tag marked with it is a special tag that will be connected to the work item.
  • Change the tags in the project’s feature files so that each one contains both the prefix and the id of the related work item (e.g.: if the prefix is @workItem and the id is 3212 the tag should be @workItem3212)
  • In the build, pipeline chooses the LD build step. There’s a new option for setting the prefix. Change it to whatever prefix is set in the project.
  • After a new build is run, the generated LivingDoc will display these connected tags bold, and clicking on them will pop up the related work item in a modal window.

Other things to know:

  • LD only accepts (and matches) a single prefix per project
  • In the project, the tag should consist only of the prefix and the work item number. No separator character is needed nor it is allowed.
  • In the build task where you can define the prefix, it is not obligatory to use ’@’ as a starting character of the prefix, LD will still recognize the prefix in the feature files
  • If there’s a tag in a feature file that is prefixed with this special work item prefix but has no work item number, something that cannot be parsed to a number or a non-existing work item id, the popup window will have no content but will show an error message (e.g. @workItem in itself as a tag would cause such an error message)

SpecFlow 3 VSIX Considerations

As announced here, we need to update the SpecFlow Visual Studio extension (VSIX) for SpecFlow 3. The updates mean the new extension will not be compatible with older versions of SpecFlow ( <2.3.2). We plan to update the SpecFlow Visual Studio extension with the SpecFlow 3-compatible version when SpecFlow 3 is officially released. Note that a preview version of SpecFlow 3 is currently available, more details can be found here.

By default, the extension updates automatically, which will break older projects using versions of SpecFlow prior to 2.3.2. An alternative approach would be to release a dedicated SpecFlow 3 extension. There would then be two separate extensions for SpecFlow, which would avoid the automatic update from breaking old projects. However, we ended up discounting this approach for a number of reasons that are summarised below. Each approach has disadvantages and could potentially cause projects to stop working.

Approach 1: Release a New SpecFlow 3 Extension

In this case, we would release a new VSIX for SpecFlow 3, and leave the current extension online for users of earlier versions.

Pros

  • Users of earlier versions do not have to do anything (i.e. disable automatic updates) to prevent their projects from breaking.

Cons

  • Having two separate versions of a SpecFlow 3 extension in the gallery will cause confusion. Some users will invariably install the wrong version, increasing the number of support issues. This will persist for as long as both extensions are available, i.e. way past the transition period where most users will have migrated from 2 to 3.
  • There will be conflicts if both extensions are installed. There is no way to guarantee that only one of the extensions is installed.
  • Users suddenly need another extension for what appears to be “no good reason”.
  • Punishes users who consistently update to new versions, as these are the ones who need to jump through hoops to use the new release.

Approach 2: Upgrade the Existing Extension

In this case, we would update the existing VSIX for compatibility with SpecFlow 3.

Pros

  • While there may be some short-term confusion and support requests relating to projects suddenly not working (automatic update), these will die down quickly. After ~6 months, the dust will probably have settled.
  • All users will have their extension automatically upgraded to be compatible with the latest version. This is how it has always been.

Cons

  • Requires users not interested in Specflow 3 to make changes to their setup to avoid breaking changes. However, this is a one-off and involves clicking a check box.
  • There will invariably be some users who need to continue using SpecFlow <2.3.2 for now, and who will forget that automatic updates need to be enabled when they make the switch to version 3. Again, the number should decrease as time goes on.

With that in mind, we feel that upgrading the existing extension is better approach. It will cause some teething problems for a few months while the switch is made. After a while, the dust will settle. Conversely, we feel that providing two separate extensions runs the risk of causing confusion due to multiple versions of the extension, and the confusion will persist indefinitely. It will not simply die down after a few months if there are two mutually exclusive extensions available for download.

Your thoughts?

If you think we have overlooked some important aspects or have have alternative suggestions on how to improve the upgrade experience, please share them in the discussion here.

If you have reasons for using older versions of SpecFlow and do not want to regularly upgrade, let us know your motivation too. Both approaches will make it difficult to work with older SpecFlow versions and SpecFlow 3 on the same machine; we are not sure to what extent this could be an issue.

SpecFlow 3 with .NET Core Support: Public Preview now Available

The first public preview of SpecFlow with support for .NET Core is now available. If you want to try out the new version, please read the following information carefully. There are a number of steps that are necessary before you can use the public preview.

Please report any issues you experience here.

IMPORTANT! If you do not plan on updating to SpecFlow 3 soon, please read this announcement for all current users.

Requirements

.NET 4.7.1 is required. Please ensure you have installed the 4.7.1 framework.

Installing the Preview Visual Studio Extension

SpecFlow 3 requires an update to the Visual Studio extension for SpecFlow. During the preview period, you will need to connect to the following feed to download the preview version of the extension:

https://www.myget.org/F/specflow-vsix/vsix/

To do so:

  1. Select Tools | Options in Visual Studio.
  2. Locate Environment in the list, and select the Extensions and Updates sub-item.
  3. Click on Add to add a new feed.
  4. Give the new source a Name (e.g. “SpecFlow 3 preview”) and enter the source (“https://www.myget.org/F/specflow-vsix/vsix/”).
  5. Select Tools | Extensions and Updates. You should see an update listed on the left.
  6. Click on Updates to update the new extension.

Once a stable version of SpecFlow 3 has been released, the new version of the extension will go live for all users, and you can revert to the standard feed.

Supported Frameworks and Runners

The preview version supports the following test frameworks and runners:

  • SpecFlow+ Runner 3.0 or higher
  • NUnit 3.10 or higher
  • MSTest V2 1.3.2 or higher
  • xUnit 2.4.0 or higher

Installing NuGet Packages and Configuring a Unit Test Provider

The unit test provider is no longer configured in your app.config file. Instead, the unit test provider is now configured using plugins for the desired test frameworks. You will therefore need to add one of the following NuGet packages to your project to configure the unit test provider:

  • SpecRun.Runner
  • SpecFlow.xUnit
  • SpecFlow.MsTest
  • SpecFlow.NUnit

Note: Make sure you do not add more than one of the unit test plugins to your project. If you do, an error message will be displayed.

  1. Right-click on your project, and select Manage NuGet Packages.
  2. Enable the Include prerelease option and search for “SpecFlow”.
  3. Install/update the following packages:
    • SpecFlow
    • SpecFlow.Tools.MsBuild.Generation
    • One of the unit test provider packages (see above).
  4. Install the test runner for your unit test provider (e.g. xunit.runner.visualstudio).

Configuration

Much of the configuration has been moved from the app.config file to other locations. When using .NET Core, you can no longer use the app.config file. You need to set general configuration options in the new specflow.json configuration file. This file is optional when using the Full Framework.

The structure of the .json configuration file reflects the structure of the old app.config. Some examples can be found here.

{
    "language":
    {
        "feature": "de-AT"
    }
}

In the above example, the feature file language is set to “de-AT”. This corresponds to the following entry in the app.config file:

<language feature="de-AT" />

If you are using the Full Framework, some settings are still available in the app.config file. However, much has changed, so please read the details below for information on how to configure SpecFlow 3.

Generating Code-behind Files

specflow.exe has been removed. Please use the SpecFlow.Tools.MsBuild.Generation NuGet package to generate the code-behind files, see https://specflow.org/documentation/Generate-Tests-from-MsBuild/

When using .NET Core or the new project format, it should be enough to simply add the package to your project.

Important Step when Adding Feature Files

When adding a new feature file, several lines are added to your project file including references to the feature file. This is currently necessary for backwards compatibility with older versions. You will need to remove these lines from the project file manually whenever you add a new feature:

To remove these lines:

  1. Right-click on your project in the Solution Explorer and select Edit XYZ.csproj (where “XYZ” is the name of your project).
  2. Delete all elements with references to feature files (see screenshot above).
  3. Build the project again.

Sample Projects

Update .NET Core versions of the example projects are located here:

https://github.com/techtalk/SpecFlow-Examples/tree/feature/netcore-examples/NETCore%20Examples

No Reports Available

Reports have been removed from the main code base and reports are not available in SpecFlow 3.0. For more details, please refer to this GitHub issue.

SpecFlow+ Runner Restrictions

  • When using SpecFlow+ Runner, AppDomain separation is unavailable for .NET Core.
  • There is currently no support for the SpecFlow+ Runner server, meaning that adaptive test scheduling is unavailable.
  • Reports are currently unavailable for .NET Core. Let us know if this is a showstopper for you.

VS Integration Breaking Changes – Affects ALL users!

The upcoming SpecFlow 3 release will require an update to the Visual Studio extension for SpecFlow. Because the extension is normally updated automatically whenever a new version is released, this change has the potential to affect all users, not just those that upgrade to version 3! Please read the following information in detail.

What will break?

The new extension will not be compatible with versions of SpecFlow earlier than 2.3.2. If you are using an earlier version of SpecFlow, you should make sure that you have disabled automatic updates for the SpecFlow extension in Visual Studio. To do so:

  1. Select Tools | Extensions and Updates from the menu in Visual Studio.
  2. Enter “SpecFlow’ in the search field to restrict the entries in the list.
  3. Click on the “SpecFlow for Visual Studio” entry and disable the Automatically update this extension check box.
  4. This will prevent newer versions of the extension from being installed automatically. Once you are ready to upgrade to SpecFlow 3, you can enable this option again.

What limitations are there?

Because the Visual Studio extension can only be installed once per Visual Studio installation, you will not be able to mix SpecFlow 3 projects with projects that use a version of SpecFlow prior to 2.3.2.

How will the update be handled?

Our intention is to release a preview version of the Visual Studio extension that will not trigger automatic updates in Visual Studio for the duration of the preview period. If you want to try out the preview version of SpecFlow 3, you will need to add the feed to Visual Studio manually to install the new version of the extension. We will provide additional details on how to do this once the preview is available.

Once SpecFlow 3 has been officially released, we will update the live Visual Studio extension with the new version. This will cause your extension to automatically update if you have not disabled automatic updates (see above). From this point on, users of older versions of SpecFlow will need to download and install the compatible version of the Visual Studio extension manually and ensure that automatic updates are disabled.

I see a potential pitfall. What should I do?

If you see any potential pitfalls in this approach, please, let us know now! If you have suggestions for how to make this process easier, we would like to hear them! You can contact us at support@specflow.org.

SpecFlow+ LivingDoc New Version and Action Required to Use it

SpecFlow+ LivingDoc has been updated and is now available on the Visual Studio marketplace.

The new version of LivingDoc contains the following new features and bug fixes:

  • Show builds for other branches than master (dropdown menu to select branch)
  • Store the selected build definition/branch per user (instead of per project as before)
  • If there is no successful build on the selected definition/branch yet, we show a message
  • “Queue build” button uses the selected branch, latest commit and current build definition version

Furthermore in the next hours every collection administrator will receive an e-mail with a notification. Because of the changes in this update, LivingDoc needs additional permissions to access your project/repository.

Your notification will look similar to this one.

You will be unable to use the new features until you grant the required permission to LivingDoc!

SpecFlow+ LivingDoc Updated to 0.2.6

SpecFlow+ LivingDoc has been updated to 0.2.6 and is now available on the Visual Studio marketplace.

New features and UI Improvements

  • When searching, nodes in the tree are only displayed if they contain the search term directly, or if a child node contains the search term. Nodes with no hits are now hidden.
  • Indirect matches are now more visible in the tree
  • The last successful build and its date are displayed when viewing the documentation. If a build has failed since the last successful build, or a build is currently in progress, this information is also displayed.
  • ISO format is used for the date of builds

Bug Fixes

  • Fixed strange search results when doing a full search for ‘0’ (zero)
  • Fixed issue with the currently selected node being displayed in the tree even if it does not match the search criteria
  • Fixed a latency issue resulting in missing build info

SpecFlow+ LivingDoc 0.2.2 Released

SpecFlow+ LivingDoc 0.2.2 has been released and is available on the Visual Studio marketplace. This version includes a number of QOL improvements for managing builds:

New features

  • You can now select a project language in the build task itself. The previous fallback was to use English as the language of the feature files. This would cause problems in projects using other languages, if only the folder containing the repository was selected as the source, meaning the language settings in the app.config file were ignored.
  • The build selector is now more streamlined, making it easier to locate the desired build:
    • Builds are sorted alphabetically
    • Only those builds that contain the LivingDoc step are displayed (TFS 2018 and VSTS only!)

Bug Fixes

  • Fixed “The attribute “Update” in element None/Compile is unrecognized” errors
  • Fixed “Not all required parameter are set” when the project path parameter ends with “\”
  • Fixed “System.NullReferenceException” when the project contains empty feature files
  • Fixed issue where Scenario Outline parameters in Table headers are not replaced

End of Visual Studio 2013 Support Imminent

We will remove support for Visual Studio 2013 with the upcoming release of SpecFlow 3 (due to be released soon). Downloads for the Visual Studio extension account for only a fraction of 1% of all downloads (a ratio of roughly 400:1), so we want to invest our time and resources elsewhere. For this reason, we will no longer support Visual Studio 2013 with SpecFlow 3, meaning there will be no more updates of the VS 2013 integration.

If you are still using Visual Studio 2013 and will want to upgrade to SpecFlow 3, we suggest that you start mapping out your upgrade path so you are prepared for the new release in time.

SpecFlow+ Runner 1.8 Released

SpecFlow+ Runner 1.8 has been released and is available for download from NuGet. The main changes in this version are:

  • Support for SpecFlow 2.4
  • Change to the behaviour of the test adapter for compatibility with Visual Studio 15.8

This version also includes a number of smaller bug fixes.