コンテンツにスキップ

スクリプティングオブジェクトモデル

外部プログラムの呼び出しのスクリプティングではスクリプト言語Luaが使用されます。

以下にオブジェクトモデル、すなわちZeta Test Managementが提供するオブジェクト、クラス、メソッドについて説明します。

Luaスクリプト内でこれらにアクセスできます。

systemオブジェクト

systemオブジェクトは現在のシステム、すなわちZeta Test Managementの現在のインスタンスを表し、以下の要素を提供します。

  • void log(string text)
  • string combine(string s1, string s2)
  • string baseFolderPath
  • runResult run(string commandLine, int successReturnCode = 0, int retryCount = 0, string logMode = null, bool waitForExit = true)

runResultオブジェクト

runResultオブジェクトはsystem.run呼び出しの結果を表し、以下の要素を提供します。

  • int exitCode
  • bool cancelled
  • string output
  • string error

exitCodeに「-2147483648」(C#のint.MinValueに相当)を指定すると、戻り値は検証されません。それ以外の場合は戻り値が検証され、呼び出されたプログラムの実際の戻り値が期待値と異なる場合はエラーメッセージが生成されます。

projectオブジェクト

projectオブジェクトは現在読み込まれているプロジェクトを表し、以下の要素を提供します。

  • —

userオブジェクト

userオブジェクトは現在ログインしているユーザーを表し、以下の要素を提供します。

  • —

testRunオブジェクト

testRunオブジェクトは現在のテスト実行を表し、以下の要素を提供します。

  • —

plannedTestCaseオブジェクト

plannedTestCaseオブジェクトは現在テスト対象の予定されたテストケースを表し、以下の要素を提供します。

  • testCase testCase

testCaseオブジェクト

testCaseオブジェクトは現在テスト対象のテストケースを表し、以下の要素を提供します。

  • —

plannedTestCaseVariantオブジェクト

plannedTestCaseVariantオブジェクトは現在テスト対象の予定されたテストケースのバリアントを表し、以下の要素を提供します。

  • —

resultItemオブジェクト

resultItemオブジェクトは現在の結果要素を表し、以下の要素を提供します。

  • public void addAttachment(string filePath, bool linkDynamically = false)
    添付ファイルをインポートする。
  • void addRemarks(object remarks)
    コメントをテキストとして添付します。複数回呼び出すことも可能です。
  • void setResult(string result)
    テストケースの結果(選択リスト)を、プロジェクト設定で定義された指定の値に設定します。
  • void setAttribute(string name, string value)
    カスタムフィールドに値を設定します。