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.

Changes
Actions

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

SpecSync does not delete the related Test Case. If SpecSync is configured to include the Test Cases to a Test Suite (recommended), the Test Case will be tagged with specsync:removed. You can review the Test Cases of this tag and delete them manually. (The tag is removed from the Test Case if the scenario is restored.)

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.

Updated Test Case field
Updated with

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 a Test Suite

Azure DevOps provides different features (e.g. to be able to record test results) for Test Cases that are included in Test Suites.

The Test Cases can be automatically sycnhronized with a single static Test Suite by defining it as "remote scope". This is recommended, because with that SpecSync can detect is a scenario has been removed. See Include synchronized Test Cases to a Test Suite for details.

Alternatively or in addition to that, you can configure additional Test Suites where the Test Cases should be included based on various conditions. See Customization: Add Test Cases to Suites for details.

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?