Compare and merge operations for test artifacts

In projects that are enabled for configuration management, you can compare your current configuration with another configuration. You can also compare test artifacts within the same configuration. For artifact types that show differences in the compare session, you can open a detailed comparison editor to view differences between two versions of a test artifact.

In all projects, you can compare and merge supported test artifacts if you and another team member edit a test artifact at the same time and encounter a save conflict. In that case, if you save your changes after the other person, you must either cancel your changes or merge your changes with the other team member's version of the test artifact. For more information about save conflicts, see Save conflicts for test artifacts.

Comparisons of configurations

If you develop in multiple components, you can compare test artifacts within the same configuration to see the changes and differences between them.

If you develop in multiple, parallel streams, or want to review an artifact's history, you can compare test artifacts to see the changes and differences between configurations.

When you compare configurations, you start with a summary of the changes between configurations, which shows the high-level nature of the changes. Next, you can navigate to detailed comparisons of test artifacts. You can also merge changes from one configuration into another.

The following test artifacts support compare and merge operations for configurations:

  • Keywords
  • Results
  • Test cases
  • Test case execution records
  • Test environments
  • Test plans
  • Test scripts
  • Test suites
  • Test suite execution records

Detailed comparisons of test artifacts

You can use the Comparison editor to review the differences between two versions of the same test artifact. You can manually edit or automatically merge changes from the comparison to the target test artifact by using the Comparison editor.

Remember: You can use the Browse <test artifact> option and compare your test artifact from the current configuration with a test artifact in another configuration or compare two different test artifacts within the same configuration.

You can also directly compare a test case result from the Test Case Results editor. Select a test case result and in the upper right, click the Compare with a different test case result icon Compare. In the Compare with window, select the test case result that you want to compare.

The Comparison editor shows the target test artifact in the To column, and a comparison test artifact in the From column. Each test artifact is labeled with the artifact name. The left sidebar shows the test artifact sections in a table-of-contents format. Differences are indicated by a summary of compound artifact changes.

In the left sidebar, you can identify whether a section was added, removed, or changed. For more information about the decorations that are used to identify changes, see Markup for comparing configuration in the QM application.

The following sections provide details when differences occur in content:

Summary sections

Summary sections include information such as the title, owner, state, and other artifact heading information.

List-based sections

List-based sections include lists of test cases in a test plan or test scripts in a test case. This dedicated comparison mode shows a more compact view of only the differences between the two artifacts. The following image shows a list-based comparison of test cases:
A list-based section during a comparison session.

Rich-text sections

You can isolate changes by using the rich-text sections that show the textual differences that are annotated in the content.

Comparisons of manual scripts

You can compare manual script content, including manual script steps. When differences exist between two versions of a manual script, a high-level view of the step changes is displayed. The same common colors and decorations indicate a changed step, added step, removed step, or moved step. For changed steps, the following additional decorations indicate what has changed:

  • A - Attachments
  • C - Comments
  • D - Description
  • E - Expected result
  • R - Requirements linked to a step
  • T - Step type (execution step or report step)
  • V - Assisted data entry, or Verification field of a test step

The following image shows a detailed comparison of manual test scripts:

A manual script in the Comparison editor.

Merge operations

You can merge content from a static baseline to a stream to incorporate changes that are made in another version or variant of your test assets.

Custom merges

When you start to merge differences from a baseline into a stream, you are brought by default to a custom merge where you can review changes in detail and accept them. You might perform a custom merge if you want to skip a few merges or if you want to merge conflicting changes manually.

During a custom merge, you can automatically accept all differences that exist only in the source configuration by clicking the Accept all non-conflicting <artifacts> icon. Artifacts are marked with a merge status so that you can quickly find which artifacts contain conflicting changes. The following image shows a custom merge between two test artifacts:

An aggregate configuration comparison.

As an alternative to accepting all non-conflicting changes for an artifact type in aggregate, you can select a subset of artifacts. Click the action menu and choose one of the following actions for the subset:

  • Replace with source: Automatically replaces content of the selected artifacts under the Target heading with the content of the artifact versions under the Source heading.
  • Manually merge: For a single selected artifact, opens a detailed comparison of content between the target and source versions. You can manually edit content in artifact sections or use actions to automatically merge sections.
  • Keep target version: Preserves the content in selected artifacts and removes the difference indicators.

The following image shows the actions that you can select for the subset of artifacts:

Detail of the Merge editor with the Action drop-down menu open. The menu shows the three actions for a subset of artifacts.

During a custom merge operation, permissions and locking are automatically checked for each artifact that is being merged. If you do not have the appropriate permission for a particular artifact type, the merge fails and an error is displayed with more information about the permission required. When you accept a change that brings in additional changes, for example, when you accept a test plan that includes a new test case, all artifact permissions are calculated. Using the example of a new test case in a test plan, you might have Modify permission for test plans. But, you might not have Create permission for a test case, which would cause the merge of the test plan to fail. The following image shows a merge process, where specific permissions are required to complete the merge operations:

A custom merge section with a message indicates that the user requires additional permissions to save a test script.

Manual merges

During a custom merge, you select an artifact and choose the Manually Merge action. An editor opens where you can compare and merge section content of the source and target versions of an individual test artifact. You can use the navigational and action icons that are displayed in each section. The following image shows an example of a manual merge process:

The merge icons.
  • To accept all content from the source artifact sections that do not conflict with the target sections, in the editor title bar, click Accept all non conflicting sections.
  • To quickly navigate through the applicable sections with differences in a test artifact, click the Next Change and Previous Change icons.
  • To indicate that you are done with a section, click the Mark Section as Merged icon, which is useful for progress tracking. The section is decorated to indicate that a merge was completed.
  • For supported sections, to move the differences from one section into another, click the Accept Section icon.
  • For supported sections, to automatically merge content where changes were made in non-overlapping sections, click the Merge Section icon.

Merges that restore artifacts from a baseline

Project administrators can assign additional permissions to users so that they can perform a restore operation. You want might want to perform a restore operation to replace the content of artifacts in the current configuration with the versions from another. Restore operations also bypass any individual test artifact permission checks.

Restore From Baseline is a project-level permission that is administered in the Configuration Management section of the Permissions page. If enabled for your role, you are prompted to either accept all changes or accept individual changes in a custom merge. If you choose Restore From Baseline, you can review and then commit the changes.