test_rail_integration 0.0.6.24 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +23 -3
- data/doc/README_md.html +29 -9
- data/doc/TestRail/APIClient.html +2 -2
- data/doc/TestRail/Connection.html +380 -20
- data/doc/TestRail/Hook.html +14 -12
- data/doc/TestRail/TestCaseResult.html +35 -7
- data/doc/TestRail/TestRailDataLoad.html +1 -1
- data/doc/TestRail/TestRailTools.html +14 -13
- data/doc/TestRail/TestRunParameters.html +27 -10
- data/doc/created.rid +13 -13
- data/doc/index.html +2 -0
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/table_of_contents.html +77 -4
- data/lib/test_rail_integration/generator/connection.rb +1 -1
- data/lib/test_rail_integration/generator/test_rail_hooks.rb +3 -1
- data/lib/test_rail_integration/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 869b4a953fe83492ab5f7b4e2e809b39fa6cfb75
|
4
|
+
data.tar.gz: 48d08cdd0726c3e709d39bbde409c3860f2dfa6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05c5c9c77e7e49515e35c1877278aa83e5a90cb2943e495a446c72c561539a9d98275ae32bacf8c5ed307c4a125509d4a4b68974e1e62af7bd82bd4f1871faf9
|
7
|
+
data.tar.gz: edfaf5d9c2efa742d00bd05ca9a6cb89081c2300a754ccd17412d4611b0293ed4862aeed98f1534dea1d7f007a42b1efe89d1821820ed6a7f9a0560f8e0dfb6f
|
data/README.md
CHANGED
@@ -21,10 +21,30 @@ Or install it yourself as:
|
|
21
21
|
|
22
22
|
## Usage
|
23
23
|
|
24
|
-
After installation type
|
25
|
-
|
24
|
+
After installation type
|
25
|
+
|
26
|
+
test_rail_integration perform
|
27
|
+
|
28
|
+
This command generate executable file run_test_run.rb. You should run this file with parameter - number on test run in TestRail
|
29
|
+
Fill all data in test_rail_data.yml.
|
30
|
+
|
31
|
+
Add TestRail::Hook.update_test_rail(scenario) into " after |scenario| " hook.
|
32
|
+
|
33
|
+
For standard running use command
|
34
|
+
|
35
|
+
ruby run_test_run.rb <run_number>
|
36
|
+
|
37
|
+
For generate test run by default use
|
38
|
+
|
39
|
+
ruby run_test_run.rb auto <1st parameter> <2nd parameter>
|
40
|
+
|
41
|
+
Command that will generated is placed in test_rail_data.yml :exec_command:
|
42
|
+
|
43
|
+
After running command for generating executable file run
|
44
|
+
|
45
|
+
./cucumber_run.sh
|
46
|
+
|
26
47
|
For perform this actions in Jenkins just create Execute shell "ruby run_test_run.rb $Testrun_id ; ./cucumber_run.sh;" where $Testrun_id its string parameter for parameterized builds.
|
27
|
-
Add TestRail::Hook.update_test_rail(scenario) into after hook.
|
28
48
|
## Contributing
|
29
49
|
|
30
50
|
1. Fork it ( https://github.com/kirikami/test_rail_integration/fork )
|
data/doc/README_md.html
CHANGED
@@ -112,16 +112,36 @@ and Ruby automation framework Cucumber+Watir</p>
|
|
112
112
|
|
113
113
|
<h2 id="label-Usage">Usage<span><a href="#label-Usage">¶</a> <a href="#top">↑</a></span></h2>
|
114
114
|
|
115
|
-
<p>After installation type
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
115
|
+
<p>After installation type</p>
|
116
|
+
|
117
|
+
<pre class="ruby"><span class="ruby-identifier">test_rail_integration</span> <span class="ruby-identifier">perform</span>
|
118
|
+
</pre>
|
119
|
+
|
120
|
+
<p>This command generate executable file run_test_run.rb. You should run this
|
121
|
+
file with parameter - number on test run in <a
|
122
|
+
href="TestRail.html">TestRail</a> Fill all data in test_rail_data.yml.</p>
|
123
|
+
|
124
|
+
<p>Add <a
|
123
125
|
href="TestRail/Hook.html#method-c-update_test_rail">TestRail::Hook.update_test_rail</a>
|
124
|
-
into after hook.</p>
|
126
|
+
into “ after |scenario| ” hook.</p>
|
127
|
+
|
128
|
+
<p>For standard running use command</p>
|
129
|
+
|
130
|
+
<pre>ruby run_test_run.rb <run_number></pre>
|
131
|
+
|
132
|
+
<p>For generate test run by default use</p>
|
133
|
+
|
134
|
+
<pre>ruby run_test_run.rb auto <1st parameter> <2nd parameter></pre>
|
135
|
+
|
136
|
+
<p>Command that will generated is placed in test_rail_data.yml :exec_command:</p>
|
137
|
+
|
138
|
+
<p>After running command for generating executable file run</p>
|
139
|
+
|
140
|
+
<pre>./cucumber_run.sh</pre>
|
141
|
+
|
142
|
+
<p>For perform this actions in Jenkins just create Execute shell “ruby
|
143
|
+
run_test_run.rb $Testrun_id ; ./cucumber_run.sh;” where $Testrun_id its
|
144
|
+
string parameter for parameterized builds.</p>
|
125
145
|
|
126
146
|
<h2 id="label-Contributing">Contributing<span><a href="#label-Contributing">¶</a> <a href="#top">↑</a></span></h2>
|
127
147
|
<ol><li>
|
data/doc/TestRail/APIClient.html
CHANGED
@@ -169,8 +169,8 @@
|
|
169
169
|
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">base_url</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">/\/$/</span>)
|
170
170
|
<span class="ruby-identifier">base_url</span> <span class="ruby-operator">+=</span> <span class="ruby-string">'/'</span>
|
171
171
|
<span class="ruby-keyword">end</span>
|
172
|
-
<span class="ruby-ivar">@url</span>
|
173
|
-
<span class="ruby-ivar">@user</span>
|
172
|
+
<span class="ruby-ivar">@url</span> = <span class="ruby-identifier">base_url</span> <span class="ruby-operator">+</span> <span class="ruby-string">'index.php?/api/v2/'</span>
|
173
|
+
<span class="ruby-ivar">@user</span> = <span class="ruby-identifier">connection_data</span>[<span class="ruby-value">:username</span>]
|
174
174
|
<span class="ruby-ivar">@password</span> = <span class="ruby-identifier">connection_data</span>[<span class="ruby-value">:password</span>]
|
175
175
|
<span class="ruby-keyword">end</span></pre>
|
176
176
|
</div>
|
@@ -72,16 +72,34 @@
|
|
72
72
|
|
73
73
|
<li ><a href="#method-c-cases_id">::cases_id</a>
|
74
74
|
|
75
|
+
<li ><a href="#method-c-cases_with_types">::cases_with_types</a>
|
76
|
+
|
75
77
|
<li ><a href="#method-c-change_test_run_name">::change_test_run_name</a>
|
76
78
|
|
77
79
|
<li ><a href="#method-c-client">::client</a>
|
78
80
|
|
79
81
|
<li ><a href="#method-c-commit_test_result">::commit_test_result</a>
|
80
82
|
|
83
|
+
<li ><a href="#method-c-create_new_test_run_with_name">::create_new_test_run_with_name</a>
|
84
|
+
|
85
|
+
<li ><a href="#method-c-create_test_run_with_name">::create_test_run_with_name</a>
|
86
|
+
|
87
|
+
<li ><a href="#method-c-generate_test_run_name">::generate_test_run_name</a>
|
88
|
+
|
89
|
+
<li ><a href="#method-c-get_indexes_of_fails">::get_indexes_of_fails</a>
|
90
|
+
|
91
|
+
<li ><a href="#method-c-get_last_failed_comment">::get_last_failed_comment</a>
|
92
|
+
|
93
|
+
<li ><a href="#method-c-get_previous_comments">::get_previous_comments</a>
|
94
|
+
|
81
95
|
<li ><a href="#method-c-get_previous_test_result">::get_previous_test_result</a>
|
82
96
|
|
83
97
|
<li ><a href="#method-c-get_test_result">::get_test_result</a>
|
84
98
|
|
99
|
+
<li ><a href="#method-c-get_test_runs">::get_test_runs</a>
|
100
|
+
|
101
|
+
<li ><a href="#method-c-project_id">::project_id</a>
|
102
|
+
|
85
103
|
<li ><a href="#method-c-test_run_data">::test_run_data</a>
|
86
104
|
|
87
105
|
<li ><a href="#method-c-test_run_id">::test_run_id</a>
|
@@ -90,6 +108,8 @@
|
|
90
108
|
|
91
109
|
<li ><a href="#method-c-test_run_name">::test_run_name</a>
|
92
110
|
|
111
|
+
<li ><a href="#method-c-test_suite_id">::test_suite_id</a>
|
112
|
+
|
93
113
|
</ul>
|
94
114
|
</div>
|
95
115
|
|
@@ -145,7 +165,7 @@
|
|
145
165
|
|
146
166
|
|
147
167
|
<div class="method-source-code" id="cases_id-source">
|
148
|
-
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line
|
168
|
+
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line 95</span>
|
149
169
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">cases_id</span>(<span class="ruby-identifier">test_run_id</span>)
|
150
170
|
<span class="ruby-identifier">cases</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">send_get</span>(<span class="ruby-node">"get_tests/#{test_run_id}"</span>)
|
151
171
|
<span class="ruby-identifier">cases</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">test_case</span><span class="ruby-operator">|</span> <span class="ruby-identifier">test_case</span>[<span class="ruby-string">"case_id"</span>] }
|
@@ -157,6 +177,42 @@
|
|
157
177
|
|
158
178
|
|
159
179
|
|
180
|
+
</div>
|
181
|
+
|
182
|
+
|
183
|
+
<div id="method-c-cases_with_types" class="method-detail ">
|
184
|
+
|
185
|
+
<div class="method-heading">
|
186
|
+
<span class="method-name">cases_with_types</span><span
|
187
|
+
class="method-args">()</span>
|
188
|
+
|
189
|
+
<span class="method-click-advice">click to toggle source</span>
|
190
|
+
|
191
|
+
</div>
|
192
|
+
|
193
|
+
|
194
|
+
<div class="method-description">
|
195
|
+
|
196
|
+
<p>Take all test types</p>
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
<div class="method-source-code" id="cases_with_types-source">
|
202
|
+
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line 146</span>
|
203
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">cases_with_types</span>
|
204
|
+
<span class="ruby-identifier">types</span> = <span class="ruby-constant">TYPES</span>
|
205
|
+
<span class="ruby-identifier">cases</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">send_get</span>(<span class="ruby-node">"get_cases/#{project_id}&suite_id=#{test_suite_id}&type_id=#{types}"</span>)
|
206
|
+
<span class="ruby-identifier">case_ids</span> = <span class="ruby-identifier">cases</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">test_case</span><span class="ruby-operator">|</span> <span class="ruby-identifier">test_case</span>[<span class="ruby-string">"id"</span>] }
|
207
|
+
<span class="ruby-identifier">case_ids</span>
|
208
|
+
<span class="ruby-keyword">end</span></pre>
|
209
|
+
</div>
|
210
|
+
|
211
|
+
</div>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
160
216
|
</div>
|
161
217
|
|
162
218
|
|
@@ -164,7 +220,7 @@
|
|
164
220
|
|
165
221
|
<div class="method-heading">
|
166
222
|
<span class="method-name">change_test_run_name</span><span
|
167
|
-
class="method-args">()</span>
|
223
|
+
class="method-args">(run_id = test_run_id)</span>
|
168
224
|
|
169
225
|
<span class="method-click-advice">click to toggle source</span>
|
170
226
|
|
@@ -182,10 +238,10 @@
|
|
182
238
|
|
183
239
|
|
184
240
|
<div class="method-source-code" id="change_test_run_name-source">
|
185
|
-
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line
|
186
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">change_test_run_name</span>
|
241
|
+
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line 158</span>
|
242
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">change_test_run_name</span>(<span class="ruby-identifier">run_id</span> = <span class="ruby-identifier">test_run_id</span>)
|
187
243
|
<span class="ruby-identifier">new_name</span> = <span class="ruby-identifier">test_run_name</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-constant">IN_PROGRESS</span>, <span class="ruby-string">""</span>)
|
188
|
-
<span class="ruby-identifier">client</span>.<span class="ruby-identifier">send_post</span>(<span class="ruby-node">"update_run/#{
|
244
|
+
<span class="ruby-identifier">client</span>.<span class="ruby-identifier">send_post</span>(<span class="ruby-node">"update_run/#{run_id}"</span>, {<span class="ruby-identifier">name</span><span class="ruby-operator">:</span> <span class="ruby-identifier">new_name</span>})
|
189
245
|
<span class="ruby-keyword">end</span></pre>
|
190
246
|
</div>
|
191
247
|
|
@@ -269,6 +325,211 @@ comment: “Test passed” )</p>
|
|
269
325
|
|
270
326
|
|
271
327
|
|
328
|
+
</div>
|
329
|
+
|
330
|
+
|
331
|
+
<div id="method-c-create_new_test_run_with_name" class="method-detail ">
|
332
|
+
|
333
|
+
<div class="method-heading">
|
334
|
+
<span class="method-name">create_new_test_run_with_name</span><span
|
335
|
+
class="method-args">()</span>
|
336
|
+
|
337
|
+
<span class="method-click-advice">click to toggle source</span>
|
338
|
+
|
339
|
+
</div>
|
340
|
+
|
341
|
+
|
342
|
+
<div class="method-description">
|
343
|
+
|
344
|
+
<p>Send request for creation test run with name (“add_run/3”, {suite_id: 3,
|
345
|
+
name “New test run”, include_all: false, case_ids: C31, C32, C33}</p>
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
<div class="method-source-code" id="create_new_test_run_with_name-source">
|
351
|
+
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line 167</span>
|
352
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">create_new_test_run_with_name</span>
|
353
|
+
<span class="ruby-identifier">client</span>.<span class="ruby-identifier">send_post</span>(<span class="ruby-node">"add_run/#{project_id}"</span>, {<span class="ruby-identifier">suite_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">test_suite_id</span>, <span class="ruby-identifier">name</span><span class="ruby-operator">:</span> <span class="ruby-identifier">generate_test_run_name</span>, <span class="ruby-identifier">include_all</span><span class="ruby-operator">:</span> <span class="ruby-keyword">false</span>, <span class="ruby-identifier">case_ids</span><span class="ruby-operator">:</span> <span class="ruby-identifier">cases_with_types</span>})
|
354
|
+
<span class="ruby-keyword">end</span></pre>
|
355
|
+
</div>
|
356
|
+
|
357
|
+
</div>
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
</div>
|
363
|
+
|
364
|
+
|
365
|
+
<div id="method-c-create_test_run_with_name" class="method-detail ">
|
366
|
+
|
367
|
+
<div class="method-heading">
|
368
|
+
<span class="method-name">create_test_run_with_name</span><span
|
369
|
+
class="method-args">(name)</span>
|
370
|
+
|
371
|
+
<span class="method-click-advice">click to toggle source</span>
|
372
|
+
|
373
|
+
</div>
|
374
|
+
|
375
|
+
|
376
|
+
<div class="method-description">
|
377
|
+
|
378
|
+
<p>Create test run in test rail for project with name</p>
|
379
|
+
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
<div class="method-source-code" id="create_test_run_with_name-source">
|
384
|
+
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line 48</span>
|
385
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">create_test_run_with_name</span>(<span class="ruby-identifier">name</span>)
|
386
|
+
<span class="ruby-identifier">client</span>.<span class="ruby-identifier">send_post</span>(<span class="ruby-node">"add_run/#{project_id}"</span>, {<span class="ruby-identifier">suite_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">test_suite_id</span>, <span class="ruby-identifier">name</span><span class="ruby-operator">:</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">include_all</span><span class="ruby-operator">:</span> <span class="ruby-keyword">false</span>, <span class="ruby-identifier">case_ids</span><span class="ruby-operator">:</span> <span class="ruby-identifier">cases_with_types</span>})
|
387
|
+
<span class="ruby-keyword">end</span></pre>
|
388
|
+
</div>
|
389
|
+
|
390
|
+
</div>
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
</div>
|
396
|
+
|
397
|
+
|
398
|
+
<div id="method-c-generate_test_run_name" class="method-detail ">
|
399
|
+
|
400
|
+
<div class="method-heading">
|
401
|
+
<span class="method-name">generate_test_run_name</span><span
|
402
|
+
class="method-args">()</span>
|
403
|
+
|
404
|
+
<span class="method-click-advice">click to toggle source</span>
|
405
|
+
|
406
|
+
</div>
|
407
|
+
|
408
|
+
|
409
|
+
<div class="method-description">
|
410
|
+
|
411
|
+
<p>Generate name for test run with date</p>
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
<div class="method-source-code" id="generate_test_run_name-source">
|
417
|
+
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line 181</span>
|
418
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">generate_test_run_name</span>
|
419
|
+
<span class="ruby-node">"Test run #{Time.now.strftime("%d/%m/%Y")}"</span>
|
420
|
+
<span class="ruby-keyword">end</span></pre>
|
421
|
+
</div>
|
422
|
+
|
423
|
+
</div>
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
|
428
|
+
</div>
|
429
|
+
|
430
|
+
|
431
|
+
<div id="method-c-get_indexes_of_fails" class="method-detail ">
|
432
|
+
|
433
|
+
<div class="method-heading">
|
434
|
+
<span class="method-name">get_indexes_of_fails</span><span
|
435
|
+
class="method-args">(test_case_id)</span>
|
436
|
+
|
437
|
+
<span class="method-click-advice">click to toggle source</span>
|
438
|
+
|
439
|
+
</div>
|
440
|
+
|
441
|
+
|
442
|
+
<div class="method-description">
|
443
|
+
|
444
|
+
<p>Get indexes of failed results</p>
|
445
|
+
|
446
|
+
|
447
|
+
|
448
|
+
|
449
|
+
<div class="method-source-code" id="get_indexes_of_fails-source">
|
450
|
+
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line 76</span>
|
451
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">get_indexes_of_fails</span>(<span class="ruby-identifier">test_case_id</span>)
|
452
|
+
<span class="ruby-identifier">indexes</span> = <span class="ruby-identifier">get_test_result</span>(<span class="ruby-identifier">test_case_id</span>).<span class="ruby-identifier">map</span>.<span class="ruby-identifier">with_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">result</span>, <span class="ruby-identifier">index</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result</span>[<span class="ruby-string">"status_id"</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">TestCaseResult</span><span class="ruby-operator">::</span><span class="ruby-constant">COMMENT</span>[<span class="ruby-value">:fail</span>][<span class="ruby-value">:status</span>] <span class="ruby-operator">?</span> <span class="ruby-identifier">index</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span> }
|
453
|
+
<span class="ruby-identifier">indexes</span>.<span class="ruby-identifier">compact</span>
|
454
|
+
<span class="ruby-keyword">end</span></pre>
|
455
|
+
</div>
|
456
|
+
|
457
|
+
</div>
|
458
|
+
|
459
|
+
|
460
|
+
|
461
|
+
|
462
|
+
</div>
|
463
|
+
|
464
|
+
|
465
|
+
<div id="method-c-get_last_failed_comment" class="method-detail ">
|
466
|
+
|
467
|
+
<div class="method-heading">
|
468
|
+
<span class="method-name">get_last_failed_comment</span><span
|
469
|
+
class="method-args">(test_case_id)</span>
|
470
|
+
|
471
|
+
<span class="method-click-advice">click to toggle source</span>
|
472
|
+
|
473
|
+
</div>
|
474
|
+
|
475
|
+
|
476
|
+
<div class="method-description">
|
477
|
+
|
478
|
+
<p>Get last failed comment for test case</p>
|
479
|
+
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
<div class="method-source-code" id="get_last_failed_comment-source">
|
484
|
+
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line 84</span>
|
485
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">get_last_failed_comment</span>(<span class="ruby-identifier">test_case_id</span>)
|
486
|
+
<span class="ruby-identifier">comments</span> = <span class="ruby-identifier">get_previous_comments</span>(<span class="ruby-identifier">test_case_id</span>)
|
487
|
+
<span class="ruby-identifier">index</span> = <span class="ruby-constant">Connection</span>.<span class="ruby-identifier">get_indexes_of_fails</span>(<span class="ruby-identifier">test_case_id</span>).<span class="ruby-identifier">first</span>
|
488
|
+
<span class="ruby-identifier">comments</span>[<span class="ruby-identifier">index</span>]
|
489
|
+
<span class="ruby-keyword">end</span></pre>
|
490
|
+
</div>
|
491
|
+
|
492
|
+
</div>
|
493
|
+
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
</div>
|
498
|
+
|
499
|
+
|
500
|
+
<div id="method-c-get_previous_comments" class="method-detail ">
|
501
|
+
|
502
|
+
<div class="method-heading">
|
503
|
+
<span class="method-name">get_previous_comments</span><span
|
504
|
+
class="method-args">(case_id)</span>
|
505
|
+
|
506
|
+
<span class="method-click-advice">click to toggle source</span>
|
507
|
+
|
508
|
+
</div>
|
509
|
+
|
510
|
+
|
511
|
+
<div class="method-description">
|
512
|
+
|
513
|
+
<p>Parse results and returns previous comment.</p>
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
|
518
|
+
<div class="method-source-code" id="get_previous_comments-source">
|
519
|
+
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line 66</span>
|
520
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">get_previous_comments</span>(<span class="ruby-identifier">case_id</span>)
|
521
|
+
<span class="ruby-identifier">test_comment</span> = <span class="ruby-identifier">get_test_result</span>(<span class="ruby-identifier">case_id</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">hash</span><span class="ruby-operator">|</span> <span class="ruby-identifier">hash</span>[<span class="ruby-string">"comment"</span>] }
|
522
|
+
<span class="ruby-identifier">comment</span> = <span class="ruby-identifier">test_comment</span>
|
523
|
+
<span class="ruby-identifier">comment</span> <span class="ruby-operator">||=</span> []
|
524
|
+
<span class="ruby-identifier">comment</span>
|
525
|
+
<span class="ruby-keyword">end</span></pre>
|
526
|
+
</div>
|
527
|
+
|
528
|
+
</div>
|
529
|
+
|
530
|
+
|
531
|
+
|
532
|
+
|
272
533
|
</div>
|
273
534
|
|
274
535
|
|
@@ -291,12 +552,12 @@ comment: “Test passed” )</p>
|
|
291
552
|
|
292
553
|
|
293
554
|
<div class="method-source-code" id="get_previous_test_result-source">
|
294
|
-
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line
|
555
|
+
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line 55</span>
|
295
556
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">get_previous_test_result</span>(<span class="ruby-identifier">case_id</span>)
|
296
557
|
<span class="ruby-identifier">test_results</span> = <span class="ruby-identifier">get_test_result</span>(<span class="ruby-identifier">case_id</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">status_hash</span><span class="ruby-operator">|</span> <span class="ruby-identifier">status_hash</span>[<span class="ruby-string">"status_id"</span>] }
|
297
|
-
<span class="ruby-identifier">status</span>
|
298
|
-
<span class="ruby-identifier">status</span>
|
299
|
-
<span class="ruby-identifier">status</span>
|
558
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-constant">TestCaseResult</span><span class="ruby-operator">::</span><span class="ruby-constant">FAILED</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">test_results</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-constant">TestCaseResult</span><span class="ruby-operator">::</span><span class="ruby-constant">FAILED</span>)
|
559
|
+
<span class="ruby-identifier">status</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">TestCaseResult</span><span class="ruby-operator">::</span><span class="ruby-constant">PASS</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">test_results</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">==</span> <span class="ruby-constant">TestCaseResult</span><span class="ruby-operator">::</span><span class="ruby-constant">PASS</span>
|
560
|
+
<span class="ruby-identifier">status</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">TestCaseResult</span><span class="ruby-operator">::</span><span class="ruby-constant">NEW</span>
|
300
561
|
<span class="ruby-identifier">status</span>
|
301
562
|
<span class="ruby-keyword">end</span></pre>
|
302
563
|
</div>
|
@@ -341,6 +602,72 @@ comment: “Test passed” )</p>
|
|
341
602
|
|
342
603
|
|
343
604
|
|
605
|
+
</div>
|
606
|
+
|
607
|
+
|
608
|
+
<div id="method-c-get_test_runs" class="method-detail ">
|
609
|
+
|
610
|
+
<div class="method-heading">
|
611
|
+
<span class="method-name">get_test_runs</span><span
|
612
|
+
class="method-args">()</span>
|
613
|
+
|
614
|
+
<span class="method-click-advice">click to toggle source</span>
|
615
|
+
|
616
|
+
</div>
|
617
|
+
|
618
|
+
|
619
|
+
<div class="method-description">
|
620
|
+
|
621
|
+
<p>Get all test runs for project</p>
|
622
|
+
|
623
|
+
|
624
|
+
|
625
|
+
|
626
|
+
<div class="method-source-code" id="get_test_runs-source">
|
627
|
+
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line 174</span>
|
628
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">get_test_runs</span>
|
629
|
+
<span class="ruby-identifier">client</span>.<span class="ruby-identifier">send_get</span>(<span class="ruby-node">"get_runs/#{project_id}"</span>)
|
630
|
+
<span class="ruby-keyword">end</span></pre>
|
631
|
+
</div>
|
632
|
+
|
633
|
+
</div>
|
634
|
+
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
</div>
|
639
|
+
|
640
|
+
|
641
|
+
<div id="method-c-project_id" class="method-detail ">
|
642
|
+
|
643
|
+
<div class="method-heading">
|
644
|
+
<span class="method-name">project_id</span><span
|
645
|
+
class="method-args">()</span>
|
646
|
+
|
647
|
+
<span class="method-click-advice">click to toggle source</span>
|
648
|
+
|
649
|
+
</div>
|
650
|
+
|
651
|
+
|
652
|
+
<div class="method-description">
|
653
|
+
|
654
|
+
<p>Setting project id</p>
|
655
|
+
|
656
|
+
|
657
|
+
|
658
|
+
|
659
|
+
<div class="method-source-code" id="project_id-source">
|
660
|
+
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line 117</span>
|
661
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">project_id</span>
|
662
|
+
<span class="ruby-ivar">@project_id</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">PROJECT_ID</span>
|
663
|
+
<span class="ruby-keyword">end</span></pre>
|
664
|
+
</div>
|
665
|
+
|
666
|
+
</div>
|
667
|
+
|
668
|
+
|
669
|
+
|
670
|
+
|
344
671
|
</div>
|
345
672
|
|
346
673
|
|
@@ -348,7 +675,7 @@ comment: “Test passed” )</p>
|
|
348
675
|
|
349
676
|
<div class="method-heading">
|
350
677
|
<span class="method-name">test_run_data</span><span
|
351
|
-
class="method-args">()</span>
|
678
|
+
class="method-args">(id_of_run=test_run_id)</span>
|
352
679
|
|
353
680
|
<span class="method-click-advice">click to toggle source</span>
|
354
681
|
|
@@ -363,9 +690,9 @@ comment: “Test passed” )</p>
|
|
363
690
|
|
364
691
|
|
365
692
|
<div class="method-source-code" id="test_run_data-source">
|
366
|
-
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line
|
367
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">test_run_data</span>
|
368
|
-
<span class="ruby-identifier">client</span>.<span class="ruby-identifier">send_get</span>(<span class="ruby-node">"get_run/#{
|
693
|
+
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line 132</span>
|
694
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">test_run_data</span>(<span class="ruby-identifier">id_of_run</span>=<span class="ruby-identifier">test_run_id</span>)
|
695
|
+
<span class="ruby-identifier">client</span>.<span class="ruby-identifier">send_get</span>(<span class="ruby-node">"get_run/#{id_of_run}"</span>)
|
369
696
|
<span class="ruby-keyword">end</span></pre>
|
370
697
|
</div>
|
371
698
|
|
@@ -390,13 +717,13 @@ comment: “Test passed” )</p>
|
|
390
717
|
|
391
718
|
<div class="method-description">
|
392
719
|
|
393
|
-
<p>
|
720
|
+
<p>Setting test run id value</p>
|
394
721
|
|
395
722
|
|
396
723
|
|
397
724
|
|
398
725
|
<div class="method-source-code" id="test_run_id-source">
|
399
|
-
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line
|
726
|
+
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line 110</span>
|
400
727
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">test_run_id</span>
|
401
728
|
<span class="ruby-ivar">@test_run_id</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">TEST_RUN_ID</span>
|
402
729
|
<span class="ruby-keyword">end</span></pre>
|
@@ -429,7 +756,7 @@ comment: “Test passed” )</p>
|
|
429
756
|
|
430
757
|
|
431
758
|
<div class="method-source-code" id="test_run_id-3D-source">
|
432
|
-
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line
|
759
|
+
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line 103</span>
|
433
760
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">test_run_id=</span>(<span class="ruby-identifier">test_run_id</span>)
|
434
761
|
<span class="ruby-ivar">@test_run_id</span> = <span class="ruby-identifier">test_run_id</span>
|
435
762
|
<span class="ruby-keyword">end</span></pre>
|
@@ -447,7 +774,7 @@ comment: “Test passed” )</p>
|
|
447
774
|
|
448
775
|
<div class="method-heading">
|
449
776
|
<span class="method-name">test_run_name</span><span
|
450
|
-
class="method-args">()</span>
|
777
|
+
class="method-args">(id_of_run=test_run_id)</span>
|
451
778
|
|
452
779
|
<span class="method-click-advice">click to toggle source</span>
|
453
780
|
|
@@ -462,9 +789,42 @@ comment: “Test passed” )</p>
|
|
462
789
|
|
463
790
|
|
464
791
|
<div class="method-source-code" id="test_run_name-source">
|
465
|
-
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line
|
466
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">test_run_name</span>
|
467
|
-
<span class="ruby-identifier">test_run_data</span>[<span class="ruby-string">"name"</span>]
|
792
|
+
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line 139</span>
|
793
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">test_run_name</span>(<span class="ruby-identifier">id_of_run</span>=<span class="ruby-identifier">test_run_id</span>)
|
794
|
+
<span class="ruby-identifier">test_run_data</span>(<span class="ruby-identifier">id_of_run</span>)[<span class="ruby-string">"name"</span>]
|
795
|
+
<span class="ruby-keyword">end</span></pre>
|
796
|
+
</div>
|
797
|
+
|
798
|
+
</div>
|
799
|
+
|
800
|
+
|
801
|
+
|
802
|
+
|
803
|
+
</div>
|
804
|
+
|
805
|
+
|
806
|
+
<div id="method-c-test_suite_id" class="method-detail ">
|
807
|
+
|
808
|
+
<div class="method-heading">
|
809
|
+
<span class="method-name">test_suite_id</span><span
|
810
|
+
class="method-args">()</span>
|
811
|
+
|
812
|
+
<span class="method-click-advice">click to toggle source</span>
|
813
|
+
|
814
|
+
</div>
|
815
|
+
|
816
|
+
|
817
|
+
<div class="method-description">
|
818
|
+
|
819
|
+
<p>Setting test suite id</p>
|
820
|
+
|
821
|
+
|
822
|
+
|
823
|
+
|
824
|
+
<div class="method-source-code" id="test_suite_id-source">
|
825
|
+
<pre><span class="ruby-comment"># File lib/test_rail_integration/generator/connection.rb, line 125</span>
|
826
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">test_suite_id</span>
|
827
|
+
<span class="ruby-ivar">@test_suite_id</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">TEST_SUITE</span>
|
468
828
|
<span class="ruby-keyword">end</span></pre>
|
469
829
|
</div>
|
470
830
|
|