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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7a99831da6cafebbe23877e882238bdedaf9f6a
4
- data.tar.gz: e38e96f6e936bfbe1d0466323b88fc3803688214
3
+ metadata.gz: edb2141abed4cf676408f211a2f1b899b9a5c882
4
+ data.tar.gz: fcce0b85455e1cde53b5d68ecb2b0dfab80b7deb
5
5
  SHA512:
6
- metadata.gz: 11153243c9df50c92a18746a4f1b23c4c37de9b593e22a55572755a93bd107e7e2c0e21a859edde7d11d58e8141ca31630e90d4b8f7ca7f8ea0b5825fcb9c7af
7
- data.tar.gz: 6b5569fc541ba2f1ab8df52a1c1add02fe8ed27472930302ca59ec5cc7df981877b8fe55b4b016ba93575cd2e18b8643ba92ce407e29ab1ee2dd8dc32af1e2ac
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
- BROWSERSTACK_DEFAULT_CONFIG = YAML.load(File.read(File.join(File.dirname(__FILE__), "./browserstack.yml")))
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
- BROWSERSTACK_PROJECT_CONFIG = YAML.load(File.read(browserstack_project_config_filename)) || Hash.new
9
+ browserstack_project_config = YAML.load(File.read(browserstack_project_config_filename)) || Hash.new
10
10
  else
11
- BROWSERSTACK_PROJECT_CONFIG = Hash.new
11
+ browserstack_project_config = Hash.new
12
12
  end
13
13
 
14
- BROWSERSTACK_CONFIG = BROWSERSTACK_DEFAULT_CONFIG.merge(BROWSERSTACK_PROJECT_CONFIG)
14
+ browserstack_config = browserstack_default_config.merge(browserstack_project_config)
15
15
 
16
- BROWSERSTACK_CONFIG['user'] = ENV['BROWSERSTACK_USERNAME'] || BROWSERSTACK_CONFIG['user']
17
- BROWSERSTACK_CONFIG['key'] = ENV['BROWSERSTACK_ACCESS_KEY'] || BROWSERSTACK_CONFIG['key']
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 BROWSERSTACK_CONFIG['user'] && BROWSERSTACK_CONFIG['key']
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'] && BROWSERSTACK_CONFIG['browser_caps'][ENV['TEST_BROWSER']].nil?
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
- BROWSERSTACK_CONFIG['common_caps'] = BROWSERSTACK_CONFIG['common_caps'] || {}
32
- @caps = BROWSERSTACK_CONFIG['common_caps'].merge(BROWSERSTACK_CONFIG['browser_caps'][TEST_BROWSER])
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://#{BROWSERSTACK_CONFIG['user']}:#{BROWSERSTACK_CONFIG['key']}@#{BROWSERSTACK_CONFIG['server']}/wd/hub",
43
+ :url => "http://#{browserstack_config['user']}:#{browserstack_config['key']}@#{browserstack_config['server']}/wd/hub",
44
44
  :desired_capabilities => @caps
45
45
  )
46
46
  end
@@ -0,0 +1,6 @@
1
+ environments_config_filename = File.join(Dir.pwd, "./environments.yaml")
2
+ if File.file?(environments_config_filename)
3
+ ENVIRONMENT = YAML.load(File.read(environments_config_filename)).dig(ENV['WHERE'] || 'default') || Hash.new
4
+ else
5
+ ENVIRONMENT = Hash.new
6
+ end
@@ -1,6 +1,6 @@
1
1
  AfterConfiguration do |config|
2
2
  config.on_event :after_test_step do |event|
3
- if not event.result.ok?
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
@@ -1,3 +1,3 @@
1
1
  module Quintocumber
2
- VERSION = "1.0.4"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -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
- QUINTOCUMBER_CONFIG = YAML.load(File.read(quintocumber_project_config_filename)) || Hash.new
7
+ quintocumber_config = YAML.load(File.read(quintocumber_project_config_filename)) || Hash.new
8
8
  else
9
- QUINTOCUMBER_CONFIG = Hash.new
9
+ quintocumber_config = Hash.new
10
10
  end
11
11
 
12
- QUINTOCUMBER_CONFIG['project'] = QUINTOCUMBER_CONFIG['project'] || {}
12
+ quintocumber_config['project'] = quintocumber_config['project'] || {}
13
13
 
14
- PROJECT_NAME = QUINTOCUMBER_CONFIG['project']['name'] || "UNNAMED PROJECT"
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
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-01 00:00:00.000000000 Z
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