Pushing scenario changes to Test Cases
SpecSync can synchronize scenarios and scenario execution results with Azure DevOps Test Cases. The most commonly used command to achieve this is to upload (push) the scenario changes to Test Cases that is provided using the SpecSync push
command.
The SpecSync push command processed all scenarios in the local feature set (e.g. the features
folder of your project), detects if there were any change since the last synchronization and updates the Test Case if necessary.
You can find all available command line options for the push command in the push command line reference. The configuration options related to push are in the synchronization section of the configuration file.
The connection between the scenario and the Test Case in Azure DevOps is established with a test case link tag. By default the link tag uses the format @tc:1234
, but both the tc
prefix and the separator :
can be configured (with synchronization/tagPrefixSeparators
and synchronization/linkLabelSeparator
), so you can also have test case links that use different format, e.g. @TestCase=1234
. In the documentation we use the default test case link tag format.
Depending on the changes of the scenario, the push command performs different actions in Azure DevOps as the following table shows.
The scenario is new (not yet linked to a Test Case)
A new Test Case work item is created and the scenario is tagged with a link tag (e.g. @tc:1234
) to document the ID of the created Test Case.
The scenario is linked and up-to-date with the Test Case
No action is taken
The scenario has been changed since the last synchronization
The Test Case is updated with the changes. (No change in the feature file.)
The scenario has been synchronized, but since the last synchronization the Test Case has been updated.
The push command by default overwrites the changes of the Test Case fields that are maintained by SpecSync (e.g. title, steps, tags). The changes in other fields (e.g. description) are not changed.
The scenario has been removed
The SpecSync push command needs to modify the feature file when a new scenario is synchronized. The feature file change has to be preserved in the source control (commit & push), otherwise when other users perform a push, Test Case duplicates will be created.
When performing the push on a build pipeline, or in any other cases where local changes cannot be preserved, the push command has to be invoked with the --disableLocalChanges
switch. More information about using SpecSync in build pipelines can be found in the Use SpecSync from build or release pipeline guide.
You can perform the push operation with the --linkOnly
flag so that it only links new scenarios and does not update existing Test Cases.
SpecSync operations, including the push command supports "dry-run" mode using the --dryRun
command line option. In dry-run mode, no change is made neither to Azure DevOps nor to the feature files, so you can test the impact of an operation without making an actual change.
Test Case fields updated by the push command
The push command updates certain fields of the linked Azure DevOps Test Case to represent the scenario changes as the following table shows.
Title
Steps
Tags
Updated based on the scenario tags. (The tags placed on the feature block are also replicated in the Test Case.)
Parameter values
Links
State
Area and Iteration
Automation Status
Associated Automation
Attachments
Include synchronized Test Cases to Test Case hierarchies
SpecSync can also help you to organize the remote Test Cases into hierarchical structures. In Azure DevOps that means that it can create and maintain Test Suite hierarchies and include the Test Cases to these Test Suites according to the configured rules. The test results can also be published to such a synchronized hierarchy.
For details on how to include Test Cases to hierarchies, please check the Synchronizing Test Case hierarchies using Test Suites feature documentation.
The synchronized Test Cases can also be added to various Test Suites manually or by defining query-based or requirement-based suites in Azure DevOps.
Last updated
Was this helpful?