assertthat-bdd 1.0.1 → 1.4.0

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
  SHA256:
3
- metadata.gz: 3ce859b7b5c5f6135860a015e9669fc67d5db6f237c1d3b0671f961257d90a8f
4
- data.tar.gz: 955d497645c3d49de0a9e72b05620753155850b7c93f98e8716c7da4ff81f8af
3
+ metadata.gz: 713c7de6c2c8f244ec1f5839c3708ccaad3ce9f5e5eaf7d717457da9cca24be2
4
+ data.tar.gz: 612e19f5a6d1c1610d1e0f31e71a033a06cfd29b92dd373ab8602a80135b61e1
5
5
  SHA512:
6
- metadata.gz: 4239d182d22d575ce433553cc396ca395d7bf734665cd5a1dec73ec689279b3cdd95ed183fc7129f197081a74857e57ae4738050ca9c7f897df27796ebb28ae6
7
- data.tar.gz: 9b38ffa862129f823cb40f4d42e1b8fbe7fa04c670f2b1aa1b3e6c87681b341b7423a34ca403b57fc665ab2879b4996d597ce67395bf01ec77a74f1bf80a3eac
6
+ metadata.gz: e50822e3c93b59a4ea7ad94ca4b512766ca54af8c3d69b8c4c51bb7f52f93a6cef3040c746f9c317f1253a055e24c56164945b68af07d74e72fc73b960c7153b
7
+ data.tar.gz: 6591ab7cc79a5366baf14950edfb5a27dc95aa23adf841b094c20cc10541d51a26df8ec74b57cd65fa329f426f5506d059b01fbf08f7e69a85e9ac668d83d7b6
@@ -2,15 +2,17 @@
2
2
  require 'assertthat-bdd'
3
3
  require 'optparse'
4
4
 
5
- VERSION = '1.0.1'
5
+ VERSION = '1.2.0'
6
6
 
7
7
  options = {}
8
8
  OptionParser.new do |opt|
9
9
  opt.on('-a','--accessKey ACCESS_KEY', 'Access key same as env variable ASSERTTHAT_ACCESS_KEY') { |o| options[:accessKey] = o }
10
10
  opt.on('-s','--secretKey SECRET_KEY', 'Secret key same as env variable ASSERTTHAT_SECRET_KEY') { |o| options[:secretKey] = o }
11
+ opt.on('-u','--jiraServerUrl SERVER_URL', 'Jira server URL') { |o| options[:jiraServerUrl] = o }
11
12
  opt.on('-p','--projectId PROJECT_ID', 'Jira project id') { |o| options[:projectId] = o }
12
13
  opt.on('-o','--outputFolder OUTPUT_FOLDER', 'Featured output folder - default ./features') { |o| options[:outputFolder] = o }
13
14
  opt.on('-m','--mode MODE', 'Mode one of automated,manual,both - deafult automated') { |o| options[:mode] = o }
15
+ opt.on('-t','--tags <tag-expression>', 'Cucucmber tag expression for scenarios filtering') { |o| options[:tags] = o }
14
16
  opt.on('-j','--jql JQL_FILTER', 'Jql issues filter') { |o| options[:jql] = o }
15
17
  opt.on('-x','--proxy PROXY_URL', 'proxy url to connect to Jira') { |o| options[:proxy] = o }
16
18
  opt.on_tail('-h', '--help', 'Show help') do
@@ -2,12 +2,13 @@
2
2
  require 'assertthat-bdd'
3
3
  require 'optparse'
4
4
 
5
- VERSION = '1.0.1'
5
+ VERSION = '1.2.0'
6
6
 
7
7
  options = {}
8
8
  OptionParser.new do |opt|
9
9
  opt.on('-a','--accessKey ACCESS_KEY', 'Access key same as env variable ASSERTTHAT_ACCESS_KEY') { |o| options[:accessKey] = o }
10
10
  opt.on('-s','--secretKey SECRET_KEY', 'Secret key same as env variable ASSERTTHAT_SECRET_KEY') { |o| options[:secretKey] = o }
11
+ opt.on('-u','--jiraServerUrl SERVER_URL', 'Jira server URL') { |o| options[:jiraServerUrl] = o }
11
12
  opt.on('-p', '--projectId PROJECT_ID', 'Jira project id') { |o| options[:projectId] = o }
12
13
  opt.on('-n','--runName RUN_NAME', 'The name of the run - default \'Test run dd MMM yyyy HH:mm:ss\'') { |o| options[:runName] = o }
13
14
  opt.on('-f','--jsonReportFolder JSON_FOLDER_PATH', 'Json report folder - default ./reports') { |o| options[:mode] = o }
@@ -5,27 +5,28 @@ require 'json'
5
5
 
6
6
  module AssertThatBDD
7
7
  class Features
8
- def self.download(accessKey: ENV['ASSERTTHAT_ACCESS_KEY'], secretKey: ENV['ASSERTTHAT_ACCESS_KEY'], projectId: nil, outputFolder: './features/', proxy: nil, mode: 'automated', jql: '')
8
+ def self.download(accessKey: ENV['ASSERTTHAT_ACCESS_KEY'], secretKey: ENV['ASSERTTHAT_ACCESS_KEY'], projectId: nil, outputFolder: './features/', proxy: nil, mode: 'automated', jql: '', tags: '', jiraServerUrl: nil)
9
9
  RestClient.proxy = proxy unless proxy.nil?
10
- url = 'https://bdd.assertthat.com/rest/api/1/project/'+ projectId +'/features'
10
+ url = 'https://bdd.assertthat.app/rest/api/1/project/'+ projectId +'/features'
11
+ url = jiraServerUrl+"/rest/assertthat/latest/project/"+projectId+"/client/features" unless jiraServerUrl.nil?
11
12
  resource = RestClient::Resource.new(url, :user => accessKey, :password => secretKey, :content_type => 'application/zip')
12
13
  begin
13
- contents = resource.get(:accept => 'application/zip', params: {mode: mode, jql: jql})
14
+ contents = resource.get(:accept => 'application/zip', params: {mode: mode, jql: jql, tags: tags})
14
15
  rescue => e
15
16
 
16
17
  if e.respond_to?('response') then
17
18
  if e.response.respond_to?('code') then
18
19
  case e.response.code
19
20
  when 401
20
- puts '[ERROR] Unauthorized error (401). Supplied secretKey/accessKey is invalid'
21
+ puts '*** ERROR: Unauthorized error (401). Supplied secretKey/accessKey is invalid'
21
22
  when 400
22
- puts '[ERROR] ' + e.response
23
+ puts '*** ERROR: ' + e.response
23
24
  when 500
24
- puts '[ERROR] Jira server error (500)'
25
+ puts '*** ERROR: Jira server error (500)'
25
26
  end
26
27
  end
27
28
  else
28
- puts '[ERROR] Failed download features: ' + e.message
29
+ puts '*** ERROR: Failed download features: ' + e.message
29
30
  end
30
31
  return
31
32
  end
@@ -39,16 +40,18 @@ module AssertThatBDD
39
40
  entry.extract("#{outputFolder}#{entry.name}")
40
41
  end
41
42
  end
42
- puts "[INFO] #{features_count} features downloaded"
43
+ puts "*** INFO: #{features_count} features downloaded"
43
44
  File.delete("#{outputFolder}/features.zip")
44
45
  end
45
46
  end
46
47
 
47
48
  class Report
48
- def self.upload(accessKey: ENV['ASSERTTHAT_ACCESS_KEY'], secretKey: ENV['ASSERTTHAT_ACCESS_KEY'], projectId: nil, runName: 'Test run '+Time.now.strftime("%d %b %Y %H:%M:%S"), jsonReportFolder: './reports', jsonReportIncludePattern: '.*.json' )
49
- url = "https://bdd.assertthat.com/rest/api/1/project/" + projectId + "/report"
49
+ def self.upload(accessKey: ENV['ASSERTTHAT_ACCESS_KEY'], secretKey: ENV['ASSERTTHAT_ACCESS_KEY'], projectId: nil, runName: 'Test run '+Time.now.strftime("%d %b %Y %H:%M:%S"), jsonReportFolder: './reports', jsonReportIncludePattern: '.*.json', jiraServerUrl: nil )
50
+ url = "https://bdd.assertthat.app/rest/api/1/project/" + projectId + "/report"
51
+ url = jiraServerUrl+"/rest/assertthat/latest/project/"+projectId+"/client/report" unless jiraServerUrl.nil?
50
52
  files = Find.find(jsonReportFolder).grep(/#{jsonReportIncludePattern}/)
51
- puts "[INFO] #{files.count} found matching parretn #{jsonReportIncludePattern}:"
53
+ puts "*** INFO: #{files.count} files found matching parretn #{jsonReportIncludePattern}:"
54
+ puts "*** INFO: #{files}"
52
55
  runId = -1
53
56
  files.each do |f|
54
57
  request = RestClient::Request.new(
@@ -69,13 +72,13 @@ module AssertThatBDD
69
72
  if e.response.respond_to?('code') then
70
73
  case e.response.code
71
74
  when 401
72
- puts '[ERROR] Unauthorized error (401). Supplied secretKey/accessKey is invalid'
75
+ puts '*** ERROR: Unauthorized error (401). Supplied secretKey/accessKey is invalid'
73
76
  when 500
74
- puts '[ERROR] Jira server error (500)'
77
+ puts '*** ERROR: Jira server error (500)'
75
78
  end
76
79
  end
77
80
  else
78
- puts '[ERROR] Failed to submit report: ' + e.message
81
+ puts "*** ERROR: Failed to submit json #{f}: " + e.message
79
82
  end
80
83
  return
81
84
  end
@@ -83,9 +86,9 @@ module AssertThatBDD
83
86
  if resposne_json['result'] == 'success'
84
87
  runId = resposne_json['runId']
85
88
  else
86
- puts '[ERROR] Failed to submit report: ' + resposne_json['message']
89
+ puts "*** ERROR: Failed to submit json #{f}: " + resposne_json['message']
87
90
  end
88
91
  end
89
92
  end
90
93
  end
91
- end
94
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assertthat-bdd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Glib Briia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-07 00:00:00.000000000 Z
11
+ date: 2020-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -51,7 +51,7 @@ dependencies:
51
51
  - !ruby/object:Gem::Version
52
52
  version: '1.0'
53
53
  description:
54
- email: glib.briia@assertthat.com
54
+ email: glib@assertthat.com
55
55
  executables:
56
56
  - assertthat-bdd-features
57
57
  - assertthat-bdd-report
@@ -80,8 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
82
  requirements: []
83
- rubyforge_project:
84
- rubygems_version: 2.7.8
83
+ rubygems_version: 3.0.8
85
84
  signing_key:
86
85
  specification_version: 4
87
86
  summary: AssertThat bdd integration for Ruby