Link

Copy-TfsTestPlan

Clone a test plan and, optionally, its test suites and test cases.


Table of Contents

  1. Syntax
  2. Description
  3. Examples
  4. Parameters
  5. Inputs
  6. Outputs
  7. Related Links

Syntax

Copy-TfsTestPlan
    [-TestPlan] <object>
    [-NewName] <string>
    [-AreaPath <string>]
    [-CloneRequirements]
    [-Collection <object>]
    [-CopyAncestorHierarchy]
    [-DeepClone]
    [-Destination <object>]
    [-DestinationWorkItemType <string>]
    [-IterationPath <string>]
    [-Passthru <string>]
    [-Project <object>]
    [-Recurse]
    [-RelatedLinkComment <string>]
    [-Server <object>]
    [-SuiteIds <int[]>]

[Go to top]

Description

The Copy-TfsTestPlan copies (“clones”) a test plan to help duplicate test suites and/or test cases. Cloning is useful if you want to branch your application into two versions. After copying, the tests for the two versions can be changed without affecting each other. When you clone a test suite, the following objects are copied from the source test plan to the destination test plan: * Test cases (note: Each new test case retains its shared steps. A link is made between the source and new test cases. The new test cases do not have test runs, bugs, test results, and build information); * Shared steps referenced by cloned test cases; * Test suites (note: The following data is retained - Names and hierarchical structure of the test suites; Order of the test cases; Assigned testers; Configurations); * Action Recordings linked from a cloned test case; * Links and Attachments; * Test configuration. The items below are only copied when using -CloneRequirements: * Requirements-based suites; * Requirements work items (product backlog items or user stories); * Bug work items, when in a project that uses the Scrum process template or any other project in which the Bug work item type is in the Requirements work item category. In other projects, bugs are not cloned.

[Go to top]

Examples

Example 1

PS> Copy-TfsTestPlan -TestPlan "My test plan" -Project "SourceProject" -Destination "TargetProject" -NewName "My new test plan"

Parameters

-AreaPath

Specifies the area path where the test plan will be cloned into. When omitted, the test plan is cloned into the same area path of the original test plan.

Type string
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-CloneRequirements

Clones requirements referenced by the test plan.

Type SwitchParameter
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Collection (Aliases: Organization)

Specifies the URL to the Team Project Collection or Azure DevOps Organization to connect to, a TfsTeamProjectCollection object (Windows PowerShell only), or a VssConnection object. You can also connect to an Azure DevOps Services organizations by simply providing its name instead of the full URL. For more details, see the Get-TfsTeamProjectCollection cmdlet. When omitted, it defaults to the connection set by Connect-TfsTeamProjectCollection (if any).

Type object
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-CopyAncestorHierarchy

Copies ancestor hierarchy.

Type SwitchParameter
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-DeepClone

Clones all the referenced test cases. When omitted, only the test plan is cloned; the original test cases are only referenced in the new plan, not duplicated.

Type SwitchParameter
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Destination

Specifies the name of the team project where the test plan will be cloned into. When omitted, the test plan is cloned into the same team project of the original test plan.

Type object
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-DestinationWorkItemType

Specifies the name of the workitem type of the clone.

Type string
Position (Named)
Default Value Test Case
Accept pipeline input False
Accept wildcard characters False

-IterationPath

Specifies the iteration path where the test plan will be cloned into. When omitted, the test plan is cloned into the same iteration path of the original test plan.

Type string
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-NewName

Specifies the name of the new test plan.

Type string
Position 1
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Passthru

Returns the results of the command. By default, this cmdlet does not generate any output.

Type string
Position (Named)
Default Value None
Accept pipeline input False
Accept wildcard characters False

-Project

Specifies the name of the Team Project, its ID (a GUID), or a Microsoft.TeamFoundation.Core.WebApi.TeamProject object to connect to. When omitted, it defaults to the connection set by Connect-TfsTeamProject (if any). For more details, see the Get-TfsTeamProject cmdlet.

Type object
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Recurse

Clone all test suites recursively.

Type SwitchParameter
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-RelatedLinkComment

Specifies the comment of the Related link that is created ato point to the original test plan.

Type string
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Server

Specifies the URL to the Team Foundation Server to connect to, a TfsConfigurationServer object (Windows PowerShell only), or a VssConnection object. When omitted, it defaults to the connection set by Connect-TfsConfiguration (if any). For more details, see the Get-TfsConfigurationServer cmdlet.

Type object
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-SuiteIds

Clones only the specified suites.

Type int[]
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-TestPlan (Aliases: id)

Specifies the name of the test plan to clone.

Type object
Position 0
Default Value (N/A)
Accept pipeline input True (byvalue)
Accept wildcard characters False

Inputs

System.Object

Specifies the name of the test plan to clone.

Outputs

Microsoft.VisualStudio.Services.TestManagement.TestPlanning.WebApi.TestPlan