quintocumber 0.1.0 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/env.rb +1 -0
- data/lib/loader.rb +3 -1
- data/lib/{config → plugins}/browserstack.yml +0 -2
- data/lib/{config → plugins}/browserstack_config.rb +6 -5
- data/lib/{config → plugins}/local_config.rb +0 -0
- data/lib/plugins/publish_reports.rb +54 -0
- data/lib/{config → plugins}/screeshot_hooks.rb +0 -0
- data/lib/quintocumber/version.rb +1 -1
- data/lib/quintocumber_config.rb +14 -0
- data/quintocumber.gemspec +4 -0
- metadata +64 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4d239dcec237822c029124d239264a674065c3b
|
4
|
+
data.tar.gz: 1c57a5230680af5e55c17a27413ce49bf2381583
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f857bdf5c9bbebd814f379e775e7f95a1dc653cd110802f412cd65e5540b7d995dc5eb3a4b3f184e7a56f04eb6a08f9334e57b76909881a16d00bca94c3bbf81
|
7
|
+
data.tar.gz: ae1a189e449bb24a0202dfecb19b66be228ebfec8029d8251428e1435afec14eb154562d067bbbb09839fe01ce05f1b1dc77c153c1bb667c444434fde21e7b34
|
data/lib/env.rb
CHANGED
data/lib/loader.rb
CHANGED
@@ -11,7 +11,6 @@ else
|
|
11
11
|
BROWSERSTACK_PROJECT_CONFIG = Hash.new
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
14
|
BROWSERSTACK_CONFIG = BROWSERSTACK_DEFAULT_CONFIG.merge(BROWSERSTACK_PROJECT_CONFIG)
|
16
15
|
|
17
16
|
BROWSERSTACK_CONFIG['user'] = ENV['BROWSERSTACK_USERNAME'] || BROWSERSTACK_CONFIG['user']
|
@@ -28,13 +27,15 @@ if BROWSERSTACK_CONFIG['user'] && BROWSERSTACK_CONFIG['key']
|
|
28
27
|
raise 'Remote browser not configured in browsertack.yaml'
|
29
28
|
end
|
30
29
|
|
31
|
-
test_browser = ENV['TEST_BROWSER'] || 'chrome'
|
32
|
-
|
33
30
|
#merge common capabilities and browser capabilities (if not browser is set, deafults to chrome)
|
34
|
-
|
31
|
+
BROWSERSTACK_CONFIG['common_caps'] = BROWSERSTACK_CONFIG['common_caps'] || {}
|
32
|
+
@caps = BROWSERSTACK_CONFIG['common_caps'].merge(BROWSERSTACK_CONFIG['browser_caps'][TEST_BROWSER])
|
35
33
|
|
36
34
|
#sets timestamp as build name along with target browser
|
37
|
-
@caps['build'] =
|
35
|
+
@caps['build'] = BUILD
|
36
|
+
|
37
|
+
#sets project name
|
38
|
+
@caps['project'] = PROJECT_NAME
|
38
39
|
|
39
40
|
#all set, instanciate new remote broser
|
40
41
|
Capybara::Selenium::Driver.new(app,
|
File without changes
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
require 'aws-sdk'
|
3
|
+
|
4
|
+
PUBLISH_REPORTS_TESTS_FAILED = []
|
5
|
+
|
6
|
+
AfterConfiguration do |config|
|
7
|
+
config.on_event :after_test_case do |event|
|
8
|
+
if not event.result.ok?
|
9
|
+
PUBLISH_REPORTS_TESTS_FAILED.push(event.test_case.name)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
at_exit do
|
15
|
+
bucket = ENV['REPORT_BUCKET']
|
16
|
+
bucket_region = ENV['REPORT_BUCKET_REGION'] || 'us-east-1'
|
17
|
+
report_url = nil
|
18
|
+
if bucket && system('allure --help >> /dev/null')
|
19
|
+
system('allure generate --clean reports')
|
20
|
+
Dir[File.join(Dir.pwd, "allure-report/**/*")].each do |file|
|
21
|
+
if not File.directory?(file)
|
22
|
+
file_name = file.clone
|
23
|
+
file_name.sub! File.join(Dir.pwd, "allure-report/"), ''
|
24
|
+
s3 = Aws::S3::Resource.new(region: bucket_region)
|
25
|
+
obj = s3.bucket(bucket).object("#{BUILD}/#{file_name}")
|
26
|
+
obj.upload_file(file)
|
27
|
+
obj.acl.put({ acl: "public-read" })
|
28
|
+
end
|
29
|
+
end
|
30
|
+
report_url = "http://#{bucket}.s3-website-#{bucket_region}.amazonaws.com/#{URI.escape(BUILD)}"
|
31
|
+
end
|
32
|
+
if ENV['PAGERDUTY_ROUTING_KEY'] && PUBLISH_REPORTS_TESTS_FAILED.length
|
33
|
+
payload = {
|
34
|
+
:payload => {
|
35
|
+
:summary => "#{PUBLISH_REPORTS_TESTS_FAILED.length} #{PROJECT_NAME} test(s) failed",
|
36
|
+
:source => "#{PROJECT_NAME}",
|
37
|
+
:severity => "critical",
|
38
|
+
:custom_details => "Failed test(s):\n- #{PUBLISH_REPORTS_TESTS_FAILED.join("\n- ")}"
|
39
|
+
},
|
40
|
+
:event_action => "trigger",
|
41
|
+
:routing_key => ENV['PAGERDUTY_ROUTING_KEY'],
|
42
|
+
}
|
43
|
+
if report_url
|
44
|
+
payload[:links] = [{
|
45
|
+
:href => report_url,
|
46
|
+
:text => "Report for #{BUILD}"
|
47
|
+
}]
|
48
|
+
end
|
49
|
+
response = HTTParty.post "https://events.pagerduty.com/v2/enqueue",
|
50
|
+
headers:{ "Content-Type" => "application/json"},
|
51
|
+
body: payload.to_json
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
File without changes
|
data/lib/quintocumber/version.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
TEST_BROWSER = ENV['TEST_BROWSER'] || 'chrome'
|
2
|
+
|
3
|
+
BUILD = "#{Time.now.utc.iso8601} - #{TEST_BROWSER}"
|
4
|
+
|
5
|
+
quintocumber_project_config_filename = File.join(Dir.pwd, "./quintocumber.yaml")
|
6
|
+
if File.file?(quintocumber_project_config_filename)
|
7
|
+
QUINTOCUMBER_CONFIG = YAML.load(File.read(quintocumber_project_config_filename)) || Hash.new
|
8
|
+
else
|
9
|
+
QUINTOCUMBER_CONFIG = Hash.new
|
10
|
+
end
|
11
|
+
|
12
|
+
QUINTOCUMBER_CONFIG['project'] = QUINTOCUMBER_CONFIG['project'] || {}
|
13
|
+
|
14
|
+
PROJECT_NAME = QUINTOCUMBER_CONFIG['project']['name'] || "UNNAMED PROJECT"
|
data/quintocumber.gemspec
CHANGED
@@ -42,4 +42,8 @@ Gem::Specification.new do |spec|
|
|
42
42
|
spec.add_dependency "capybara", "~> 2.14"
|
43
43
|
spec.add_dependency "selenium-webdriver", "~> 3.4"
|
44
44
|
spec.add_dependency "allure-cucumber", "~> 0.5"
|
45
|
+
spec.add_dependency "factory_girl", "~> 4.8"
|
46
|
+
spec.add_dependency "faker", "~> 1.8"
|
47
|
+
spec.add_dependency "httparty", "~> 0.15"
|
48
|
+
spec.add_dependency "aws-sdk", "~> 2.10"
|
45
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quintocumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diego Queiroz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -150,6 +150,62 @@ dependencies:
|
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0.5'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: factory_girl
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '4.8'
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '4.8'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: faker
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '1.8'
|
174
|
+
type: :runtime
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '1.8'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: httparty
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0.15'
|
188
|
+
type: :runtime
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - "~>"
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0.15'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: aws-sdk
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - "~>"
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '2.10'
|
202
|
+
type: :runtime
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - "~>"
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '2.10'
|
153
209
|
description: 'Cucumber with some additional support: Capybara, Browsertack, Allure
|
154
210
|
reports, Rspec and SitePrism'
|
155
211
|
email:
|
@@ -167,14 +223,16 @@ files:
|
|
167
223
|
- bin/console
|
168
224
|
- bin/setup
|
169
225
|
- exe/quintocumber
|
170
|
-
- lib/config/browserstack.yml
|
171
|
-
- lib/config/browserstack_config.rb
|
172
|
-
- lib/config/local_config.rb
|
173
|
-
- lib/config/screeshot_hooks.rb
|
174
226
|
- lib/env.rb
|
175
227
|
- lib/loader.rb
|
228
|
+
- lib/plugins/browserstack.yml
|
229
|
+
- lib/plugins/browserstack_config.rb
|
230
|
+
- lib/plugins/local_config.rb
|
231
|
+
- lib/plugins/publish_reports.rb
|
232
|
+
- lib/plugins/screeshot_hooks.rb
|
176
233
|
- lib/quintocumber.rb
|
177
234
|
- lib/quintocumber/version.rb
|
235
|
+
- lib/quintocumber_config.rb
|
178
236
|
- lib/runner.rb
|
179
237
|
- quintocumber.gemspec
|
180
238
|
homepage: https://github.com/quintoandar/quintocumber
|