Synchronize Scenarios

Applies to TestComplete 14.0, last modified on January 23, 2019

About synchronization

When you import BDD scenarios from HipTest to your TestComplete project, the latter copies feature files from a HipTest project to your computer, and the projects become bound to each other. You may want to synchronize feature files in bound projects, that is, you may want the changes made to HipTest scenarios to become available to automation engineers in your TestComplete project. And, vice versa, the changes made to feature files by automation engineers in TestComplete become available to your teammates who are working on scenarios in HipTest.

HipTest to TestComplete sync

You can obtain files from HipTest automatically or manually. If you choose automatic synchronization, you can also select the moment when it should occur: when you open your project in TestComplete, or when you run a BDD test in TestComplete, or in both these cases.

Option 1 – Automatic sync

You can command TestComplete to obtain feature files automatically every time you run BDD scenarios from TestComplete, or when you open your test project in TestComplete, or in both these cases. The first approach is helpful if your team changes scenarios in HipTest frequently. The second approach is helpful when the scenarios are not changed so frequently, but you want to keep track of changes. You enable these types of synchronization in your project properties in TestComplete:

  1. Open the project property editor. To do this:

    • Right-click the project node in the Project Explorer panel and select Edit > Properties from the context menu.

      – or –

      Double-click the project node to open the project editor, and then go to the Properties tab.

    • Select the Synchronize feature files on project opening and Synchronize feature files before test run check boxes:

      Enable automatic synchronization with HipTest in project properties

      Click the image to enlarge it.

      Select File > Save from the main menu to save the changes.

    You can select only one of these check boxes or both. By default, in new projects, these settings are on.

    The Synchronize test cases before test run setting also works with Synchronize test run. See below for details.

When to disable auto sync

In some cases, you may want to disable automatic synchronization. This might happen if your team is actively changing scenarios in HipTest, and you need to continue working on and running previous scenario versions. In this case, you can disable both settings and synchronize projects manually when it is needed. See below.

Option 2 – Manual sync

You can synchronize your TestComplete with HipTest at any time manually. To do this, simply right-click the project node in the Project Explorer and select Update from HipTest from the context menu:

Manual synchronization with HipTest

Note

In HipTest, BDD scenarios can differ from one test run to another. When synchronizing, TestComplete gets the scenario versions that belong to the test run that is set by the HipTest > Test run property of your TestComplete project.

You cannot synchronize with archived test runs.

TestComplete to HipTest sync

You can change imported feature files in TestComplete. When you save your changes, TestComplete will automatically forward them to HipTest. This behavior cannot be disabled. Let us repeat that this works only if your TestComplete project is bound to a HipTest project.

Limitations

Some changes are not allowed in bound TestComplete projects:

  • You cannot rename an imported feature file. When you try doing this in the Project Explorer, TestComplete will display an error message.

    Note that TestComplete renames a feature file automatically, if you change the first line of the feature description (that is, if you change the text in the first line after the Feature: keyword). TestComplete will display an error message when you attempt to save the changes.

  • It is not allowed to create and delete feature files in bound projects in TestComplete. When you select “Add > New Item” or “Remove” from the context menu of the Project Explorer, you will get an error message. You can only change scenarios and feature descriptions in these files. If you need to append a new feature file or delete some feature file, do this in HipTest.

  • It is not allowed to save feature files that have no scenarios defined in them.

Note

The HipTest > Test run project property does not work for the “TestComplete to HipTest” synchronization. This sync type updates feature files in the Scenarios collection in HipTest, not in test runs. If you want your changes to go to some test run as well, select this test run in the Test run project property and also enable the Synchronize scenarios in the HipTest test run property.

What files are updated

  • TestComplete synchronizes only those feature files that were changed. That is, it will download only those HipTest feature files, in which it detects changes relative to the file versions in your test project. If some feature file was not changed, it will not be downloaded. The same happens with backward synchronization: if some feature file was not changed on the TestComplete side, it will not be uploaded to HipTest.

  • TestComplete tracks the following changes in feature files:

    • Changes in feature and scenario descriptions and tags.

    • Changes in test steps (their order, descriptions, and so on).

    • Changes in the structure of folders and feature files, that is, if you re-organized features among folders in HipTest, created new folders or removed some existing folders, TestComplete will make the appropriate changes to the folder and feature file structure in its project.

    • If you deleted some features, scenarios, or test steps, TestComplete will also delete them in imported feature files.

      The script code you created for deleted test steps and scenarios will not be deleted. It will remain in the TestComplete project.

  • If some feature file was changed both in your project and in HipTest, TestComplete will keep the version you have in your project.

  • Note also that TestComplete synchronizes entire files. It doesn’t merge the changes. It selects one of two file versions: either the version stored in HipTest, or the version stored in your project.

  • In HipTest, BDD scenarios can differ from one test run to another. When synchronizing, TestComplete uses the scenario versions that belong to the test run that is set by the HipTest > Test run property of your TestComplete project.

    You cannot synchronize with archived test runs.

Sync test runs

As we have said above, in HipTest, scenario versions may differ from one test run to another. If you want a test run to use the latest scenario version, you call the Synchronize command for it in HipTest:

The Synchronize command in HipTest

Click the image to enlarge it.

To implement this behavior in TestComplete, select the Synchronize scenarios in the HipTest test run check box in project properties in TestComplete. This option works only if you synchronize scenarios before test runs:

  • When you command TestComplete to launch a BDD scenario, it checks the Synchronize test cases before test run setting of your project.

  • If this setting is on, and if Synchronize HipTest test run is on, then …

  • … before synchronizing scenarios, TestComplete calls HipTest’s Synchronize command for the test run you are using (this is the test run that the Test run project property specifies).

  • After this synchronization is over, TestComplete starts synchronizing feature files in the project with feature files from HipTest.

  • And, after this synchronization is done, it launches the test.

Sync test results

TestComplete can also post results of BDD scenarios to HipTest. See Upload Results.

See Also

HipTest Integration
Bind TestComplete Project to HipTest Project
Import HipTest Scenarios
Upload Results

Highlight search results