tcm: テスト計画、テスト スイート、テスト構成、および環境の一覧
tcm.exe を使用してコマンド ラインからテストを実行したり、テスト ケースを特定のテスト スイートにインポートしたりするには、テストを実行するのに必要な成果物の名前と ID が必要です。 次の tcm コマンドを使用して、コマンド ラインからテストの成果物のリストを取得できます。
tcm plans /list
tcm suites /list
tcm configs /list
tcm testenvironments /list
tcm.exe は、Visual Studio Ultimate がインストールされているコンピューターの <Drive:>\Program Files\Microsoft Visual Studio 10.0\Common7\IDE にあります。
tcm plans /list [/querytext:query] /collection:CollectionURL /teamproject:project [/login:username,[password]]
tcm suites /list [/planid: id | /querytext:query] /collection:CollectionURL /teamproject:project [/login:username,[password]]
tcm configs /list [/querytext:query] /collection:CollectionURL /teamproject:project [/login:username,[password]]
tcm testenvironments /list /collection:CollectionURL /teamproject:project [/login:username,[password]]
パラメーター
パラメーター |
説明 |
---|---|
/querytext:query |
テストの成果物を返すために使用するクエリを指定します。 |
/planid:id |
このテスト計画のテスト スイートのみが一覧表示されるように指定します。 |
/collection:CollectionURL |
チーム プロジェクト コレクションの URI を指定します。 URI の形式は http://ServerName:Port/VirtualDirectoryName/CollectionName です。 仮想ディレクトリを使用していない場合、URI の形式は次のようになります。 http://ServerName:Port/CollectionName |
/teamproject:project |
自動テストのインポート先となるテスト計画を含むチーム プロジェクトの名前です。 |
/login:username,[password] |
省略可能です。 Team Foundation Server のアプリケーション層サーバーにログオンしており、コマンド実行のためのアクセス許可を持つユーザーの名前とパスワードを指定します。 Windows の資格情報に適切なアクセス許可がない場合、基本認証を使用する場合、またはドメインに接続されていない場合はこのオプションを使用します。 |
/collection および /teamproject のパラメーターは、tcm.exe と同じディレクトリ (<Drive:>\Program Files\Microsoft Visual Studio 10.0\Common7\IDE) にある tcm.exe.config XML ファイルに追加できます。 このファイルに追加しておくと、tcm コマンドを実行するたびに、コマンド ラインでこれらのパラメーターを入力する必要がなくなります。 これらのキーとその値をファイルに追加するには、appSettings セクションで次のように指定します。
<appSettings>
<add key="TeamFoundationServer" value=""http://<ServerName:Port/VirtualDirectoryName/CollectionName>"/>
<add key ="TeamProject" value="DinnerNow"/>
</appSettings>
テスト項目の一覧表示
以下の各例は、Visual Studio コマンド プロンプトを起動していることを前提としています。
これを行うには、[スタート] ボタンをクリックし、[すべてのプログラム] をポイントします。次に [Microsoft Visual Studio 2010] をポイントし、[Visual Studio Tools] をポイントして、[Visual Studio コマンド プロンプト (2010)] をクリックします。
コマンド プロンプトで <drive>:\Program Files\Microsoft Visual Studio 10.0\VC フォルダーが開きます。
次のコマンドでは、DinnerNow チーム プロジェクトのテスト構成が一覧表示されます。
tcm configs /list /collection:http://<Team Foundation Server Name>:8080/tfs/<team project collection name>
/teamproject:DinnerNow
次のコマンドでは、DinnerNow チーム プロジェクトのテスト計画 Sprint 1 のみが一覧表示され、その ID を確認できます。
tcm plans /list /querytext:"SELECT * FROM TestPlans WHERE PlanName=’Sprint 1’" /collection:http://<Team Foundation Server Name>:8080/tfs/<team project collection name>
/teamproject:DinnerNow
次のコマンドでは、DinnerNow チーム プロジェクトの、ID が 3 のテスト計画にあるテスト スイートが一覧表示されます。
tcm suites /list /planid:3 /collection:http://<Team Foundation Server Name>:8080/tfs/<team project collection name>
/teamproject:DinnerNow