Rubyの魔神 このページをアンテナに追加 RSSフィード

   「Ruby」は宝石の魔神のイメージ(The Jinn of the Ruby)
[DMY] [VB] [VB6] [Python] [C#] [Android] [電子工作] [個人メモ] [仕事メモ] [アイデア] [TstLink] [CE] [LTSA]
[自動化] [Qt] [OCaml] [3Dプリンタ] [TOOLS] [RAA] [Forge]
  [機能別索引] [逆引きRuby] [マニュアル] [るびま] [標準ライブラリ] [るりまサーチ] [Try! Ruby] [PRaggerまとめ] [ピジョン・ブラッド]
   [Rubyコーディング規約] [プログラミングのオキテ] [Rubyist SNS] [TOOLBIS]
   [RubyネットワークProg] [druby] [コードなにがし] [RDocテンプレ] [Ruby/Tkサンプル]
   [WAVE] [Xperia] [github] [twitterなど] [EA] [マクロ]

2008-12-08

TestLink1.8RC1のXMLRPCを解析2

TestLink1.8RC1のXMLRPCを解析2 - Rubyの魔神 を含むブックマーク はてなブックマーク - TestLink1.8RC1のXMLRPCを解析2 - Rubyの魔神 TestLink1.8RC1のXMLRPCを解析2 - Rubyの魔神 のブックマークコメント

http://ruby.g.hatena.ne.jp/garyo/20081118/p1こちらの続き

簡単にまとめてみる

関数名引数戻り値機能コメント
tl.getProjects{"devKey"=>devKey}テストプロジェクト情報テストプロジェクト情報を得る
tl.getProjectTestPlans{"devKey"=>devKey,"testprojectid"=>1}テスト計画情報テストプロジェクトIDを与えるとテスト計画情報を得る
tl.getBuildsForTestPlan{"devKey"=>@devKey,"testplanid"=>3}ビルド情報テスト計画IDを与えると、ビルド情報を得る
tl.getTestSuitesForTestPlan{"devKey"=>@devKey,"testplanid"=>3}テストスイート情報テスト計画IDを与えると、テストスイート情報を得る
tl.getTestCasesForTestSuite{"devKey"=>@devKey,"testsuiteid"=>4}テストケース情報テストスイートIDを与えると、テストケース情報を得る
tl.getTestCasesForTestPlan{"devKey"=>@devKey,"testplanid"=>3}テストケース情報テスト計画IDを与えると、テストケース情報を得る細かなオプション引数あり
tl.getTestCaseIDByName{"devKey"=>@devKey,"testcasename"=>"Mantis"} テストケーステストケース名を与えると、テストケース情報を得る
tl.reportTCResult{"devKey"=>@devKey,"testcaseid"=>25, "testplanid"=>3,"status"=>"f","buildid"=>1} (テスト結果を反映)テストケースID,テスト計画ID,ビルドID,テスト結果を与えると、テスト結果をTestLinkに反映する
tl.createBuild{"devKey"=>@devKey,"testplanid"=>3, "buildname"=>"TestBuild","buildnotes"=>"note"} ビルドIDを返すテスト計画ID,ビルド名、コメントを与えると、新しいビルドIDを返す
tl.createTestCase未実装
tl.createTestProject引数不明










getProjectTestPlansを試す

    args = {"devKey"=>@devKey,"testprojectid"=>1}     
		ret = @server.call("tl.getProjectTestPlans",args)
    p ret
    ret[0].each{|proj,val|
      val.each{|key,val|
        puts "#{key}:#{val}\n"
      }
      puts "---"
    }

こんな感じで返る。

[{"3"=>{"name"=>"test plan", "notes"=>"

note

", "id"=>"3", "testproject_id"=>"1", "active"=>"1"}}]

name:test plan

notes:

note

id:3

testproject_id:1

active:1

---

テストプロジェクトIDを渡すとアクティブなテスト計画が返ってくるようだ。

getBuildsForTestPlanを試す

    args = {"devKey"=>@devKey,"testplanid"=>3}     
		ret = @server.call("tl.getBuildsForTestPlan",args)
    p ret
    ret[0].each{|key,val|
        puts "#{key}:#{val}\n"
    }
    puts "---"

[{"name"=>"build1", "notes"=>"", "id"=>"1", "is_open"=>"1", "testplan_id"=>"3", "active"=>"1"}]

name:build1

notes:

id:1

is_open:1

testplan_id:3

active:1

---

こんな感じ。テスト計画IDを与えると、ビルドを返す。

getTestSuitesForTestPlanを試す

    args = {"devKey"=>@devKey,"testplanid"=>3}     
		ret = @server.call("tl.getTestSuitesForTestPlan",args)
    p ret
    ret[0].each{|key,val|
        puts "#{key}:#{val}\n"
    }
    puts "---"

[{"name"=>"???????", "id"=>"4"}]

name:???????

id:4

---

こんな感じ。テスト計画IDを与えると、テストスイート名とIDを返す。

でも文字コード指定をしても日本語がうまく表示されないみたい。

getTestCasesForTestSuiteを試す

    args = {"devKey"=>@devKey,"testsuiteid"=>4}     
		ret = @server.call("tl.getTestCasesForTestSuite",args)
    p ret
    ret.each{|c|
    	c.each{|key,val|
        puts "#{key}:#{val}\n"
    	}
    }
    puts "---"

[{"name"=>"????????", "id"=>"5", "node_type_id"=>"3", "parent_id"=>"4", "node_order"=>"0"}, {"name"=>"????", "id"=>"7", "node_type_id"=>"3", "parent_id"=>"4", "node_order"=>"0"}, {"name"=>"??????????", "id"=>"9", "node_type_id"=>"3", "parent_id"=>"4", "node_order"=>"0"}, {"name"=>"?????????", "id"=>"11", "node_type_id"=>"3", "parent_id"=>"4", "node_order"=>"0"}, {"name"=>"??????????????", "id"=>"13", "node_type_id"=>"3", "parent_id"=>"4", "node_order"=>"0"}, {"name"=>"????", "id"=>"15", "node_type_id"=>"3", "parent_id"=>"4", "node_order"=>"0"}, {"name"=>"???????", "id"=>"17", "node_type_id"=>"3", "parent_id"=>"4", "node_order"=>"0"}, {"name"=>"???????????????", "id"=>"19", "node_type_id"=>"3", "parent_id"=>"4", "node_order"=>"0"}, {"name"=>"?????????", "id"=>"21", "node_type_id"=>"3", "parent_id"=>"4", "node_order"=>"0"}, {"name"=>"?????????", "id"=>"23", "node_type_id"=>"3", "parent_id"=>"4", "node_order"=>"0"}, {"name"=>"????????(Mantis)", "id"=>"25", "node_type_id"=>"3", "parent_id"=>"4", "node_order"=>"0"}, {"name"=>"?????", "id"=>"27", "node_type_id"=>"3", "parent_id"=>"4", "node_order"=>"0"}, {"name"=>"?????", "id"=>"29", "node_type_id"=>"3", "parent_id"=>"4", "node_order"=>"0"}, {"name"=>"???????", "id"=>"31", "node_type_id"=>"3", "parent_id"=>"4", "node_order"=>"0"}, {"name"=>"?????", "id"=>"33", "node_type_id"=>"3", "parent_id"=>"4", "node_order"=>"0"}]

name:????????

id:5

node_type_id:3

parent_id:4

node_order:0

name:????

id:7

node_type_id:3

parent_id:4

node_order:0

name:??????????

id:9

node_type_id:3

parent_id:4

node_order:0

name:?????????

id:11

node_type_id:3

parent_id:4

node_order:0

name:??????????????

id:13

node_type_id:3

parent_id:4

node_order:0

name:????

id:15

node_type_id:3

parent_id:4

node_order:0

name:???????

id:17

node_type_id:3

parent_id:4

node_order:0

name:???????????????

id:19

node_type_id:3

parent_id:4

node_order:0

name:?????????

id:21

node_type_id:3

parent_id:4

node_order:0

name:?????????

id:23

node_type_id:3

parent_id:4

node_order:0

name:????????(Mantis)

id:25

node_type_id:3

parent_id:4

node_order:0

name:?????

id:27

node_type_id:3

parent_id:4

node_order:0

name:?????

id:29

node_type_id:3

parent_id:4

node_order:0

name:???????

id:31

node_type_id:3

parent_id:4

node_order:0

name:?????

id:33

node_type_id:3

parent_id:4

node_order:0

---

テストスイートIDを渡すと中のテストケースIDを返す

getTestCasesForTestPlanを試す

    args = {"devKey"=>@devKey,"testplanid"=>3}     
		ret = @server.call("tl.getTestCasesForTestPlan",args)
    p ret
    ret.each{|key1,val1|
    	val1.each{|key,val|
        puts "#{key}:#{val}\n"
    	}
      puts "--"
    }
    puts "---"

{"33"=>{"exec_status"=>"n", "status"=>"", "name"=>"?????", "assigner_id"=>"", "urgency"=>"2", "exec_id"=>"", "type"=>"", "exec_on_tplan"=>"", "executed"=>"", "external_id"=>"15", "z"=>"0", "tc_id"=>"33", "version"=>"1", "tcversion_id"=>"34", "execution_order"=>"150", "user_id"=>"", "feature_id"=>"15", "tcversion_number"=>"", "testsuite_id"=>"4", "active"=>"1"}, "11"=>{"exec_status"=>"n", "status"=>"", "name"=>"?????????", "assigner_id"=>"", "urgency"=>"2", "exec_id"=>"", "type"=>"", "exec_on_tplan"=>"", "executed"=>"", "external_id"=>"4", "z"=>"0", "tc_id"=>"11", "version"=>"1", "tcversion_id"=>"12", "execution_order"=>"40", "user_id"=>"", "feature_id"=>"4", "tcversion_number"=>"", "testsuite_id"=>"4", "active"=>"1"}, "23"=>{"exec_status"=>"n", "status"=>"", "name"=>"?????????", "assigner_id"=>"", "urgency"=>"2", "exec_id"=>"", "type"=>"", "exec_on_tplan"=>"", "executed"=>"", "external_id"=>"10", "z"=>"0", "tc_id"=>"23", "version"=>"1", "tcversion_id"=>"24", "execution_order"=>"100", "user_id"=>"", "feature_id"=>"10", "tcversion_number"=>"", "testsuite_id"=>"4", "active"=>"1"}, "7"=>{"exec_status"=>"n", "status"=>"", "name"=>"????", "assigner_id"=>"", "urgency"=>"2", "exec_id"=>"", "type"=>"", "exec_on_tplan"=>"", "executed"=>"", "external_id"=>"2", "z"=>"0", "tc_id"=>"7", "version"=>"1", "tcversion_id"=>"8", "execution_order"=>"20", "user_id"=>"", "feature_id"=>"2", "tcversion_number"=>"", "testsuite_id"=>"4", "active"=>"1"}, "13"=>{"exec_status"=>"n", "status"=>"", "name"=>"??????????????", "assigner_id"=>"", "urgency"=>"2", "exec_id"=>"", "type"=>"", "exec_on_tplan"=>"", "executed"=>"", "external_id"=>"5", "z"=>"0", "tc_id"=>"13", "version"=>"1", "tcversion_id"=>"14", "execution_order"=>"50", "user_id"=>"", "feature_id"=>"5", "tcversion_number"=>"", "testsuite_id"=>"4", "active"=>"1"}, "25"=>{"exec_status"=>"n", "status"=>"", "name"=>"????????(Mantis)", "assigner_id"=>"", "urgency"=>"2", "exec_id"=>"", "type"=>"", "exec_on_tplan"=>"", "executed"=>"", "external_id"=>"11", "z"=>"0", "tc_id"=>"25", "version"=>"1", "tcversion_id"=>"26", "execution_order"=>"110", "user_id"=>"", "feature_id"=>"11", "tcversion_number"=>"", "testsuite_id"=>"4", "active"=>"1"}, "9"=>{"exec_status"=>"n", "status"=>"", "name"=>"??????????", "assigner_id"=>"", "urgency"=>"2", "exec_id"=>"", "type"=>"", "exec_on_tplan"=>"", "executed"=>"", "external_id"=>"3", "z"=>"0", "tc_id"=>"9", "version"=>"1", "tcversion_id"=>"10", "execution_order"=>"30", "user_id"=>"", "feature_id"=>"3", "tcversion_number"=>"", "testsuite_id"=>"4", "active"=>"1"}, "15"=>{"exec_status"=>"n", "status"=>"", "name"=>"????", "assigner_id"=>"", "urgency"=>"2", "exec_id"=>"", "type"=>"", "exec_on_tplan"=>"", "executed"=>"", "external_id"=>"6", "z"=>"0", "tc_id"=>"15", "version"=>"1", "tcversion_id"=>"16", "execution_order"=>"60", "user_id"=>"", "feature_id"=>"6", "tcversion_number"=>"", "testsuite_id"=>"4", "active"=>"1"}, "27"=>{"exec_status"=>"n", "status"=>"", "name"=>"?????", "assigner_id"=>"", "urgency"=>"2", "exec_id"=>"", "type"=>"", "exec_on_tplan"=>"", "executed"=>"", "external_id"=>"12", "z"=>"0", "tc_id"=>"27", "version"=>"1", "tcversion_id"=>"28", "execution_order"=>"120", "user_id"=>"", "feature_id"=>"12", "tcversion_number"=>"", "testsuite_id"=>"4", "active"=>"1"}, "17"=>{"exec_status"=>"n", "status"=>"", "name"=>"???????", "assigner_id"=>"", "urgency"=>"2", "exec_id"=>"", "type"=>"", "exec_on_tplan"=>"", "executed"=>"", "external_id"=>"7", "z"=>"0", "tc_id"=>"17", "version"=>"1", "tcversion_id"=>"18", "execution_order"=>"70", "user_id"=>"", "feature_id"=>"7", "tcversion_number"=>"", "testsuite_id"=>"4", "active"=>"1"}, "29"=>{"exec_status"=>"n", "status"=>"", "name"=>"?????", "assigner_id"=>"", "urgency"=>"2", "exec_id"=>"", "type"=>"", "exec_on_tplan"=>"", "executed"=>"", "external_id"=>"13", "z"=>"0", "tc_id"=>"29", "version"=>"1", "tcversion_id"=>"30", "execution_order"=>"130", "user_id"=>"", "feature_id"=>"13", "tcversion_number"=>"", "testsuite_id"=>"4", "active"=>"1"}, "31"=>{"exec_status"=>"n", "status"=>"", "name"=>"???????", "assigner_id"=>"", "urgency"=>"2", "exec_id"=>"", "type"=>"", "exec_on_tplan"=>"", "executed"=>"", "external_id"=>"14", "z"=>"0", "tc_id"=>"31", "version"=>"1", "tcversion_id"=>"32", "execution_order"=>"140", "user_id"=>"", "feature_id"=>"14", "tcversion_number"=>"", "testsuite_id"=>"4", "active"=>"1"}, "19"=>{"exec_status"=>"n", "status"=>"", "name"=>"???????????????", "assigner_id"=>"", "urgency"=>"2", "exec_id"=>"", "type"=>"", "exec_on_tplan"=>"", "executed"=>"", "external_id"=>"8", "z"=>"0", "tc_id"=>"19", "version"=>"1", "tcversion_id"=>"20", "execution_order"=>"80", "user_id"=>"", "feature_id"=>"8", "tcversion_number"=>"", "testsuite_id"=>"4", "active"=>"1"}, "21"=>{"exec_status"=>"n", "status"=>"", "name"=>"?????????", "assigner_id"=>"", "urgency"=>"2", "exec_id"=>"", "type"=>"", "exec_on_tplan"=>"", "executed"=>"", "external_id"=>"9", "z"=>"0", "tc_id"=>"21", "version"=>"1", "tcversion_id"=>"22", "execution_order"=>"90", "user_id"=>"", "feature_id"=>"9", "tcversion_number"=>"", "testsuite_id"=>"4", "active"=>"1"}, "5"=>{"exec_status"=>"p", "status"=>"", "name"=>"????????", "assigner_id"=>"", "urgency"=>"2", "exec_id"=>"1", "type"=>"", "exec_on_tplan"=>"3", "executed"=>"6", "external_id"=>"1", "z"=>"0", "tc_id"=>"5", "version"=>"1", "tcversion_id"=>"6", "execution_order"=>"10", "user_id"=>"", "feature_id"=>"1", "tcversion_number"=>"1", "testsuite_id"=>"4", "active"=>"1"}}

exec_status:n

status:

name:?????

assigner_id:

urgency:2

exec_id:

type:

exec_on_tplan:

executed:

external_id:15

z:0

tc_id:33

version:1

tcversion_id:34

execution_order:150

user_id:

feature_id:15

tcversion_number:

testsuite_id:4

active:1

--

exec_status:n

status:

name:?????????

assigner_id:

urgency:2

exec_id:

type:

exec_on_tplan:

executed:

external_id:4

z:0

tc_id:11

version:1

tcversion_id:12

execution_order:40

user_id:

feature_id:4

tcversion_number:

testsuite_id:4

active:1

--

exec_status:n

status:

name:?????????

assigner_id:

urgency:2

exec_id:

type:

exec_on_tplan:

executed:

external_id:10

z:0

tc_id:23

version:1

tcversion_id:24

execution_order:100

user_id:

feature_id:10

tcversion_number:

testsuite_id:4

active:1

--

exec_status:n

status:

name:????

assigner_id:

urgency:2

exec_id:

type:

exec_on_tplan:

executed:

external_id:2

z:0

tc_id:7

version:1

tcversion_id:8

execution_order:20

user_id:

feature_id:2

tcversion_number:

testsuite_id:4

active:1

--

exec_status:n

status:

name:??????????????

assigner_id:

urgency:2

exec_id:

type:

exec_on_tplan:

executed:

external_id:5

z:0

tc_id:13

version:1

tcversion_id:14

execution_order:50

user_id:

feature_id:5

tcversion_number:

testsuite_id:4

active:1

--

exec_status:n

status:

name:????????(Mantis)

assigner_id:

urgency:2

exec_id:

type:

exec_on_tplan:

executed:

external_id:11

z:0

tc_id:25

version:1

tcversion_id:26

execution_order:110

user_id:

feature_id:11

tcversion_number:

testsuite_id:4

active:1

--

exec_status:n

status:

name:??????????

assigner_id:

urgency:2

exec_id:

type:

exec_on_tplan:

executed:

external_id:3

z:0

tc_id:9

version:1

tcversion_id:10

execution_order:30

user_id:

feature_id:3

tcversion_number:

testsuite_id:4

active:1

--

exec_status:n

status:

name:????

assigner_id:

urgency:2

exec_id:

type:

exec_on_tplan:

executed:

external_id:6

z:0

tc_id:15

version:1

tcversion_id:16

execution_order:60

user_id:

feature_id:6

tcversion_number:

testsuite_id:4

active:1

--

exec_status:n

status:

name:?????

assigner_id:

urgency:2

exec_id:

type:

exec_on_tplan:

executed:

external_id:12

z:0

tc_id:27

version:1

tcversion_id:28

execution_order:120

user_id:

feature_id:12

tcversion_number:

testsuite_id:4

active:1

--

exec_status:n

status:

name:???????

assigner_id:

urgency:2

exec_id:

type:

exec_on_tplan:

executed:

external_id:7

z:0

tc_id:17

version:1

tcversion_id:18

execution_order:70

user_id:

feature_id:7

tcversion_number:

testsuite_id:4

active:1

--

exec_status:n

status:

name:?????

assigner_id:

urgency:2

exec_id:

type:

exec_on_tplan:

executed:

external_id:13

z:0

tc_id:29

version:1

tcversion_id:30

execution_order:130

user_id:

feature_id:13

tcversion_number:

testsuite_id:4

active:1

--

exec_status:n

status:

name:???????

assigner_id:

urgency:2

exec_id:

type:

exec_on_tplan:

executed:

external_id:14

z:0

tc_id:31

version:1

tcversion_id:32

execution_order:140

user_id:

feature_id:14

tcversion_number:

testsuite_id:4

active:1

--

exec_status:n

status:

name:???????????????

assigner_id:

urgency:2

exec_id:

type:

exec_on_tplan:

executed:

external_id:8

z:0

tc_id:19

version:1

tcversion_id:20

execution_order:80

user_id:

feature_id:8

tcversion_number:

testsuite_id:4

active:1

--

exec_status:n

status:

name:?????????

assigner_id:

urgency:2

exec_id:

type:

exec_on_tplan:

executed:

external_id:9

z:0

tc_id:21

version:1

tcversion_id:22

execution_order:90

user_id:

feature_id:9

tcversion_number:

testsuite_id:4

active:1

--

exec_status:p

status:

name:????????

assigner_id:

urgency:2

exec_id:1

type:

exec_on_tplan:3

executed:6

external_id:1

z:0

tc_id:5

version:1

tcversion_id:6

execution_order:10

user_id:

feature_id:1

tcversion_number:1

testsuite_id:4

active:1

--

---

最初の33が良くわからないが、テスト計画IDを渡すとテストケース情報を返す。

ソースによると以下のオプションもあるらしい

	 * @param struct $args
	 * @param string $args["devKey"]
	 * @param int $args["testplanid"]
	 * @param int $args["testcaseid"] - optional
	 * @param int $args["buildid"] - optional
	 * @param int $args["keywordid"] - optional
	 * @param boolean $args["executed"] - optional
	 * @param int $args["$assignedto"] - optional
	 * @param string $args["executestatus"] - optional

getTestCaseIDByNameを試す

    args = {"devKey"=>@devKey,"testcasename"=>"Mantis"}     
		ret = @server.call("tl.getTestCaseIDByName",args)
    p ret
    ret[0].each{|key,val|
        puts "#{key}:#{val}\n"
    }
    puts "---"

[{"message"=>"Cannot find matching test case. No testcase exists with the name provided!", "code"=>5030}]

message:Cannot find matching test case. No testcase exists with the name provided!

code:5030

---

OK時

[{"name"=>"testcase1", "id"=>"37"}]

テストケース名を渡すとテストケースを返すらしい。オプションでテストスイートも追加可能。

	 * @param struct $args
	 * @param string $args["devKey"]
	 * @param string $args["testcasename"]
	 * @param string $args["testsuitename"] - optional
	 * @return mixed $resultInfo

reportTCResultを試す

    args = {"devKey"=>@devKey,"testcaseid"=>25,"testplanid"=>3,"status"=>"f","buildid"=>1}     
		ret = @server.call("tl.reportTCResult",args)
    p ret
    ret[0].each{|key,val|
        puts "#{key}:#{val}\n"
    }
    puts "---"

[{"message"=>"Success!", "status"=>true, "id"=>"2"}]

message:Success!

status:true

id:2

---

テストケースIDとテスト計画IDとビルドIDと試験結果(p:パス,f:失敗,b:ブロック)を渡すと

試験結果が反映される

戻り値は statusが失敗、成功。 idがエラーコード,messageがエラーメッセージ

	 * @param struct $args
	 * @param string $args["devKey"]
	 * @param int $args["testcaseid"]
	 * @param int $args["testplanid"] 
         * @param string $args["status"] - status is {@link $validStatusList}
	 * @param int $args["buildid"] - optional
	 * @param string $args["notes"] - optional
	 * @param bool $args["guess"] - optional definiing whether to guess optinal params or require them 
	 * 								explicitly default is true (guess by default)
	 * @return mixed $resultInfo 
	 * 				[status]	=> true/false of success
	 * 				[id]		=> result id or error code
	 * 				[message]	=> optional message for error message string

TestLinkが表示するテストケース IDは「test11」なのに実際のIDは25

createBuildを試す

    args = {"devKey"=>@devKey,"testplanid"=>3,"buildname"=>"TestBuild","buildnotes"=>"note"} 
		ret = @server.call("tl.createBuild",args)
    p ret
    ret[0].each{|key,val|
        puts "#{key}:#{val}\n"
    }
    puts "---"

[{"message"=>"Success!", "status"=>true, "id"=>"2"}]

message:Success!

status:true

id:2

---

テスト計画IDとビルド名、コメントを渡すと、ビルドIDと成功・失敗が返る

createTestCase

未実装

createTestProject

引数不明

トラックバック - http://ruby.g.hatena.ne.jp/garyo/20081208