itriagetestrail 1.0.12 → 1.0.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d0387abc222cae089acbb400ade6c0a956dcfcc7
4
- data.tar.gz: 66c32216c3f2008b8959a874151229c3a35d932f
3
+ metadata.gz: 41fcb7814651a32431d7af0f6c54ca50396bdea1
4
+ data.tar.gz: f1c272721dad7bf9abd764c8d047dee6f1a9ee20
5
5
  SHA512:
6
- metadata.gz: a1323588ed7db74da556c899337b81a27ed01de08574005539a99a749fcc2dadceb4a4e67e83c9129a5e420c91f52d68e9440c5b98f97f085e6820e649bfa9f4
7
- data.tar.gz: '05149e94ded8fc656852be78b6c9fad88c44aedef812e9568fa90a24dafaf529e99a739ee6be65fe49a385f16dbc412de01e59e8813b63cd45ee7a55c0bc83c9'
6
+ metadata.gz: 350e2732941a1e611041c27a257d2cb37ebb00d2e7bc319ca70c45d24ada8c1d50a494ae018ecd7198c09833c83c07073f61f9f98b5de31bb4f051c70d6dab05
7
+ data.tar.gz: f290718839f77246429cfed3f1722958176eb379ff1e62c2f63c8aad43c1e619a11e183bd090d75d4a7f9a9ad5241348b0b34ad4716fc9fe184b75d03bcb5310
@@ -80,6 +80,9 @@ module Itriagetestrail
80
80
 
81
81
  @external_results = { results: [] }
82
82
  @batch_size = @testrail_config[:batch_size] || 0
83
+
84
+ #Supports tagging
85
+ @testrail_case_fields = @client.send_get('get_case_fields')
83
86
  end
84
87
 
85
88
  def clear_results
@@ -16,6 +16,7 @@ module Itriagetestrail
16
16
  @scenario_title = scenario.title
17
17
  @scenario_steps = scenario.steps.select { 'name' }.collect(&:name).join("\n")
18
18
  end
19
+ @scenario_tags = scenario.source_tag_names
19
20
  end
20
21
 
21
22
  def record_result(scenario)
@@ -48,6 +48,33 @@ module Itriagetestrail
48
48
  custom_branch_name: @testrail_config[:origin]
49
49
  }
50
50
 
51
+ # Pull Tag IDs
52
+ unless @scenario_tags.nil?
53
+
54
+ # TODO: Determine how to approach updating tags without permanently storing results on broken tests?
55
+ # https://github.com/cucumber/cucumber-ruby/blob/master/lib/cucumber/runtime.rb
56
+ # Test has to actually run in order to populate testrail.
57
+
58
+ testrail_tag_object = @testrail_case_fields.select { |field| field['system_name'] == 'custom_tags'}[0]
59
+ testrail_tag_items = testrail_tag_object['configs'][0]['options']['items'].split("\n")
60
+ testrail_tag_ids = []
61
+ @scenario_tags.each do |scenario_tag|
62
+ testrail_tag_items.each do | tag_item |
63
+ system_tag = tag_item.split(',')
64
+ if scenario_tag == system_tag[1]
65
+ testrail_tag_ids << system_tag[0].to_i
66
+ end
67
+ end
68
+ end
69
+
70
+ # TODO: Determine if there is a change, if so then we send a post
71
+
72
+
73
+
74
+ # Now that we have the case id, lets update tags
75
+ @client.send_post("update_case/#{case_id}", { 'custom_tags': testrail_tag_ids})
76
+ end
77
+
51
78
  # Update Test Run
52
79
  extend_testrail_run
53
80
  end
@@ -1,3 +1,3 @@
1
1
  module Itriagetestrail
2
- VERSION = '1.0.12'.freeze
2
+ VERSION = '1.0.13'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itriagetestrail
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.12
4
+ version: 1.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - a801069
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-27 00:00:00.000000000 Z
11
+ date: 2019-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tzinfo