assertthat-bdd 1.0.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/assertthat-bdd-features +3 -1
- data/bin/assertthat-bdd-report +2 -1
- data/lib/assertthat-bdd.rb +19 -16
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 713c7de6c2c8f244ec1f5839c3708ccaad3ce9f5e5eaf7d717457da9cca24be2
|
4
|
+
data.tar.gz: 612e19f5a6d1c1610d1e0f31e71a033a06cfd29b92dd373ab8602a80135b61e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e50822e3c93b59a4ea7ad94ca4b512766ca54af8c3d69b8c4c51bb7f52f93a6cef3040c746f9c317f1253a055e24c56164945b68af07d74e72fc73b960c7153b
|
7
|
+
data.tar.gz: 6591ab7cc79a5366baf14950edfb5a27dc95aa23adf841b094c20cc10541d51a26df8ec74b57cd65fa329f426f5506d059b01fbf08f7e69a85e9ac668d83d7b6
|
data/bin/assertthat-bdd-features
CHANGED
@@ -2,15 +2,17 @@
|
|
2
2
|
require 'assertthat-bdd'
|
3
3
|
require 'optparse'
|
4
4
|
|
5
|
-
VERSION = '1.0
|
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
|
data/bin/assertthat-bdd-report
CHANGED
@@ -2,12 +2,13 @@
|
|
2
2
|
require 'assertthat-bdd'
|
3
3
|
require 'optparse'
|
4
4
|
|
5
|
-
VERSION = '1.0
|
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 }
|
data/lib/assertthat-bdd.rb
CHANGED
@@ -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.
|
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 '
|
21
|
+
puts '*** ERROR: Unauthorized error (401). Supplied secretKey/accessKey is invalid'
|
21
22
|
when 400
|
22
|
-
puts '
|
23
|
+
puts '*** ERROR: ' + e.response
|
23
24
|
when 500
|
24
|
-
puts '
|
25
|
+
puts '*** ERROR: Jira server error (500)'
|
25
26
|
end
|
26
27
|
end
|
27
28
|
else
|
28
|
-
puts '
|
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 "
|
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
|
-
|
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 "
|
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 '
|
75
|
+
puts '*** ERROR: Unauthorized error (401). Supplied secretKey/accessKey is invalid'
|
73
76
|
when 500
|
74
|
-
puts '
|
77
|
+
puts '*** ERROR: Jira server error (500)'
|
75
78
|
end
|
76
79
|
end
|
77
80
|
else
|
78
|
-
puts
|
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
|
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
|
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:
|
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
|
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
|
-
|
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
|