SpecSync Documentation
Getting StartedConfigurationGuidesDownloads
Azure DevOps
Azure DevOps
  • Introduction to SpecSync for Azure DevOps
  • Getting started
    • Getting started using SpecFlow
    • Getting started using Cucumber or other Gherkin-based BDD tool
  • Installation & Setup
    • Install as .NET tool
    • Install as .NET Console App
    • Install as native binaries for Linux or macOS
    • Install as Docker image
    • Setup and Configure
  • Features
    • Push features
      • Pushing scenario changes to Test Cases
      • Configuring the format of the synchronized test cases
      • Synchronizing Scenario Outlines
      • Add new Test Cases to an Area or an Iteration
      • Mark Test Cases as Automated
      • Setting Test Case state on change
      • Update Test Case fields
      • Attach files to Test Cases using tags
      • Customization: Setting Test Case fields with default values
      • Customization: Update custom Test Case fields on push
      • Customization: Ignoring marked Test Case steps
      • Customization: Ignoring Test Case Tags
      • Customization: Ignore non-supported local tags
      • Customization: Mapping tags
      • Customization: Synchronizing scenarios from feature branches
      • Customization: Reset Test Case state after change
      • Customization: Automatically link changed Test Cases
      • Customization: Synchronize linked artifact titles
      • Customization: Add Test Cases to Suites
      • Customization: Do not synchronize title
    • Pull features
      • Pulling Test Case changes to local scenarios
    • Common synchronization features
      • Configuration key
      • Remote scope
      • Linking Work Items using tags
      • Synchronizing Test Case hierarchies using Test Suites
      • Include synchronized Test Cases to a Test Suite (deprecated)
      • Excluding scenarios from synchronization
      • Synchronization conflict resolution
      • Re-link scenarios to new Test Cases
    • Test result publishing features
      • Publishing test result files
      • Support for Azure DevOps Test Plan / Test Suite based test execution
      • Customization: Publishing test results to multiple Test Suites
    • General features
      • Azure DevOps authentication options
      • Configuration file
      • Hierarchical configuration files
      • Local test case conditions
      • Configuration wizards
      • SpecSync plugins
    • Customizations
    • Plugin list
  • Licensing
  • Guides
    • What is my Azure DevOps project URL?
    • How to define the local feature-set to be synchronized
    • Filters and scopes
    • How to synchronize automated test cases
    • How to use SpecSync from build or release pipeline
    • How to publish test results from pipelines using the VSTest task
    • How to use the SpecSync Azure DevOps pipeline tasks
    • How to link GitHub pull requests
    • How to upgrade to a newer version of SpecSync
    • How to attach files to test results
    • Using SpecSync with SpecFlow+
    • Using SpecSync with Cucumber
    • Using SpecSync with Cypress
    • Using SpecSync with Postman
    • Using SpecSync with TestNG
    • Using SpecSync on macOS or Linux
    • Using SpecSync inside a Docker container
    • How to handle Test Cases of multiple parallel application releases
    • Migrating from SpecSync v3 to v5
    • Migrating from SpecSync v2 to v3
    • Migrating from SpecSync v1 to v2
  • Changelog
  • Release Model and Roadmap
  • Downloads
  • Reference
    • Command line reference
      • init
      • upgrade
      • push
      • pull
      • publish-test-results
      • re-link
      • version
    • Configuration reference
      • toolSettings
      • local
      • remote
      • knownRemotes
      • synchronization
        • push
        • pull
        • automation
        • state
        • areaPath
        • iterationPath
        • links
        • attachments
        • format
        • fieldUpdates
      • hierarchies
      • publishTestResults
      • specFlow
      • reqnroll
      • customizations
    • Compatibility
    • Older versions
  • Contact
    • SpecSync Support
    • Troubleshooting
    • FAQ
  • Project Website
Powered by GitBook
On this page
  • Exclude scenario outline wrapper method
  • Exclude wrapper methods in local test execution
  • Exclude wrapper methods in Azure DevOps build or release pipeline
  • Use TestCase Data for Scenario Outline examples for legacy MsTest V1 projects

Was this helpful?

  1. Features
  2. Test result publishing features

Support for Azure DevOps Test Plan / Test Suite based test execution

PreviousPublishing test result filesNextCustomization: Publishing test results to multiple Test Suites

Last updated 3 months ago

Was this helpful?

The SpecSync publish-test-results command provides a general-purpose solution for publishing test results to Azure DevOps as described in the page. That works with many BDD tools and platforms.

For MsTest-based SpecFlow or Reqnroll scenarios, you can also execute and publish the test results using the Test Suite based execution feature of Azure DevOps. That kind of execution can be invoked from build or releases pipelines using the Visual Studio Test (VSTest) task.

The test execution uses the Associated Automation field of the Test Cases in the Suite: it invokes the test method specified in the field from the compiled test assembly of the current build. The results are attached to the Test Case.

specsync.json
{
  ...
  "synchronization": {
    ...
    "automation": {
      "enabled": true,
      "testExecutionStrategy": "testSuiteBasedExecutionWithScenarioOutlineWrappers"
    },
    ...
  },
  ...
}

The testExecutionStrategy setting can also be set to testSuiteBasedExecution, but that setting is currently not supported for scenario outlines by Azure DevOps and SpecFlow.

Unfortunately this test execution method have a couple of limitations and drawbacks:

  • The method can only be used for SpecFlow or Reqnroll-based .NET projects.

  • Officially (by Azure DevOps) the support is only provided for MsTest-based SpecFlow or Reqnroll projects only, but it seems to be working with NUnit and xUnit as well. SpecFlow+ Runner is not supported.

  • To be able to execute scenario outlines this way, SpecSync needs to generate a special wrapper method for the scenario outlines. This requires a SpecFlow plugin to be configured and the special wrapper method needs to be excluded manually on every local test run.

Exclude scenario outline wrapper method

Exclude wrapper methods in local test execution

Exclude wrapper methods in Azure DevOps build or release pipeline

When the tests are run in Azure DevOps build from assembly (so not through the test cases), the generated wrapper methods have the be filtered out as well. This can be achieved by entering the TestCategory!=SpecSyncWrapper expression as "Test Filter criteria".

Use TestCase Data for Scenario Outline examples for legacy MsTest V1 projects

Note: this option is only available for legacy MsTest V1 based projects that use SpecFlow v2.3 or v2.4.

The legacy MsTest (V1) framework can be configured by adding a reference to the "Microsoft.VisualStudio.QualityTools.UnitTestFramework" assembly to your project. The MsTest-related NuGet packages (MSTest.TestFramework, MSTest.TestAdapter) cannot be used!

The "Use TestCase Data" mode connects to the TFS TestCase during execution of Scenario Outlines to retrieve the examples. In this setup, the generated Scenario Outline Wrapper is not executable locally.

In order to configure SpecSync to use this option, you need to do the following steps:

  1. Make sure your project uses MsTest V1 (has a reference to the "Microsoft.VisualStudio.QualityTools.UnitTestFramework" assembly and does not use MsTest through NuGet). Using this option with MsTest V2 will lead to an error, like "The unit test adapter failed to connect to the data source or to read the data. [...] Unable to find the requested .Net Framework Data Provider. It may not be installed."

  2. Make sure your project uses SpecFlow v2.3 or v2.4

  3. Setup SpecSync to use testSuiteBasedExecutionWithScenarioOutlineWrappers automation strategy and the SpecSync SpecFlow plugin like it is described above.

  4. Set specflow/scenarioOutlineAutomationWrappers in the configuration file to useTestCaseData.

  5. In the VsTest task of the build pipeline, browse the added Test or Run Settings file at the "Settings file" setting.

SpecSync can configure the Associated Automation field with the test method generated by SpecFlow or Reqnroll for the scenario. For that you have to enable and you have to specify the testSuiteBasedExecutionWithScenarioOutlineWrappers value for the setting. The following example shows such a configuration.

You can find more information about setting up the SpecFlow plugin in the page. The section contains information about how to exclude the wrapper method in local or assembly based pipeline executions.

Especially because of the problem with the scenario outline wrapper methods, using this approach is not recommended. If you have questions or need help to setup this model, please . You can also consider the SpecSync that provide a more flexible solution.

For each Scenario Outline, there will be an additional wrapper test generated that will be used by the automated test case. Running these tests locally is unnecessary, therefore it is recommended to filter them out from local execution. This can be done for example by entering the -Trait:SpecSyncWrapper filter criteria to the search box of the "Test Explorer" window. (See more in .)

Add a Test Settings file (.testsettings) to your project (without any special configuration) or a file with ForcedLegacyMode set to true. You can download a sample Test Setting file from .

marking Test Cases as automated
synchronization/automation/testExecutionStrategy configuration
contact support
Test result publishing features
SpecFlow configuration
Run Settings
here
Publishing test result files
Exclude scenario outline wrapper method
Setup and Configure
A VSTest task that is configured to run tests from the "BDD Scenarios" suite
Filtering out wrapper tests from local execution
Filter out scenario outline wrapper test methods in Azure DevOps build