quintocumber 1.0.4 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/plugins/browserstack_config.rb +11 -11
- data/lib/plugins/envitonment_variables.rb +6 -0
- data/lib/plugins/screeshot_hooks.rb +1 -1
- data/lib/quintocumber/version.rb +1 -1
- data/lib/quintocumber_config.rb +4 -4
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edb2141abed4cf676408f211a2f1b899b9a5c882
|
4
|
+
data.tar.gz: fcce0b85455e1cde53b5d68ecb2b0dfab80b7deb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecf766307ebbfff96aa15c454e2d64af328de337955004dfc6deb3fcf0a3666429fb2db13a88e8fdf397c67531c82a447c2b40cdc4c889ef81c4174fa750d220
|
7
|
+
data.tar.gz: f8c26e92e1282dc0f86165b9d1aafdb11c7cf9479172665b10f9337696bab71b04126807ed7caba90d7222db0c5620d880ede7980cb2abf2c82679e32e23c572
|
@@ -2,34 +2,34 @@ require 'capybara/cucumber'
|
|
2
2
|
|
3
3
|
#Get browserstack configuration from browserstack.yml
|
4
4
|
#and override credentials if credentials are set in env variables
|
5
|
-
|
5
|
+
browserstack_default_config = YAML.load(File.read(File.join(File.dirname(__FILE__), "./browserstack.yml")))
|
6
6
|
|
7
7
|
browserstack_project_config_filename = File.join(Dir.pwd, "./browserstack.yml")
|
8
8
|
if File.file?(browserstack_project_config_filename)
|
9
|
-
|
9
|
+
browserstack_project_config = YAML.load(File.read(browserstack_project_config_filename)) || Hash.new
|
10
10
|
else
|
11
|
-
|
11
|
+
browserstack_project_config = Hash.new
|
12
12
|
end
|
13
13
|
|
14
|
-
|
14
|
+
browserstack_config = browserstack_default_config.merge(browserstack_project_config)
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
browserstack_config['user'] = ENV['BROWSERSTACK_USERNAME'] || browserstack_config['user']
|
17
|
+
browserstack_config['key'] = ENV['BROWSERSTACK_ACCESS_KEY'] || browserstack_config['key']
|
18
18
|
|
19
19
|
#Only user browserstack if credentials are set
|
20
|
-
if
|
20
|
+
if browserstack_config['user'] && browserstack_config['key']
|
21
21
|
#Register browserstack remote driver into Capybara context
|
22
22
|
Capybara.register_driver :browserstack do |app|
|
23
23
|
|
24
24
|
#check if target browser is properly configured in browsertack.yaml
|
25
25
|
#if no target browser is defined, skip verification due to later override
|
26
|
-
if ENV['TEST_BROWSER'] &&
|
26
|
+
if ENV['TEST_BROWSER'] && browserstack_config['browser_caps'][ENV['TEST_BROWSER']].nil?
|
27
27
|
raise 'Remote browser not configured in browsertack.yaml'
|
28
28
|
end
|
29
29
|
|
30
30
|
#merge common capabilities and browser capabilities (if not browser is set, deafults to chrome)
|
31
|
-
|
32
|
-
@caps =
|
31
|
+
browserstack_config['common_caps'] = browserstack_config['common_caps'] || {}
|
32
|
+
@caps = browserstack_config['common_caps'].merge(browserstack_config['browser_caps'][TEST_BROWSER])
|
33
33
|
|
34
34
|
#sets timestamp as build name along with target browser
|
35
35
|
@caps['build'] = BUILD
|
@@ -40,7 +40,7 @@ if BROWSERSTACK_CONFIG['user'] && BROWSERSTACK_CONFIG['key']
|
|
40
40
|
#all set, instanciate new remote broser
|
41
41
|
Capybara::Selenium::Driver.new(app,
|
42
42
|
:browser => :remote,
|
43
|
-
:url => "http://#{
|
43
|
+
:url => "http://#{browserstack_config['user']}:#{browserstack_config['key']}@#{browserstack_config['server']}/wd/hub",
|
44
44
|
:desired_capabilities => @caps
|
45
45
|
)
|
46
46
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
AfterConfiguration do |config|
|
2
2
|
config.on_event :after_test_step do |event|
|
3
|
-
if
|
3
|
+
if !ENV['DISABLE_REPORTS_SCREENSHOT'] && !event.result.ok?
|
4
4
|
filename = "#{event.test_case.name}/#{event.test_step.name}.png"
|
5
5
|
Capybara.page.save_screenshot(filename)
|
6
6
|
class Includer
|
data/lib/quintocumber/version.rb
CHANGED
data/lib/quintocumber_config.rb
CHANGED
@@ -4,11 +4,11 @@ BUILD = "#{Time.now.utc.iso8601} - #{TEST_BROWSER}"
|
|
4
4
|
|
5
5
|
quintocumber_project_config_filename = File.join(Dir.pwd, "./quintocumber.yaml")
|
6
6
|
if File.file?(quintocumber_project_config_filename)
|
7
|
-
|
7
|
+
quintocumber_config = YAML.load(File.read(quintocumber_project_config_filename)) || Hash.new
|
8
8
|
else
|
9
|
-
|
9
|
+
quintocumber_config = Hash.new
|
10
10
|
end
|
11
11
|
|
12
|
-
|
12
|
+
quintocumber_config['project'] = quintocumber_config['project'] || {}
|
13
13
|
|
14
|
-
PROJECT_NAME =
|
14
|
+
PROJECT_NAME = quintocumber_config['project']['name'] || "UNNAMED PROJECT"
|
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: 1.0
|
4
|
+
version: 1.1.0
|
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-08-
|
11
|
+
date: 2017-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -227,6 +227,7 @@ files:
|
|
227
227
|
- lib/loader.rb
|
228
228
|
- lib/plugins/browserstack.yml
|
229
229
|
- lib/plugins/browserstack_config.rb
|
230
|
+
- lib/plugins/envitonment_variables.rb
|
230
231
|
- lib/plugins/local_config.rb
|
231
232
|
- lib/plugins/publish_reports.rb
|
232
233
|
- lib/plugins/screeshot_hooks.rb
|