testcentricity_web 0.7.7 → 0.7.8

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: bd9cf8a1aa80abfcac896b14099e1a5dfd50fc9a
4
- data.tar.gz: 40ef5a530ffe4bdfa7b685dba070ff148c03c668
3
+ metadata.gz: 98298b1269fe2d4737edcca42ee62cd492821cb1
4
+ data.tar.gz: d67323c361b7131e2989a7f3cd7ea6672edc1ca5
5
5
  SHA512:
6
- metadata.gz: 99b815226510736a9d1c347df0e8a14168fd3e30d778b1497b71ec98dceecad396ddfde9b67b88c32aee1c23b269a65a6038aa70f8eff319380ba1c639bf4688
7
- data.tar.gz: 113e01a7682fa043fa59428c1be6a6629b5922e92d899e81f4b35b0b24b54b0b8b952a2672ebc6236f2df27fc162548cd119decf1bc2ab5fe4511a7e7f6cdd02
6
+ metadata.gz: 5156b3d332280bd77036acb1a671a4ef981d5eaaea60371b8e091d3a5bd0b5df524082141e1e6873b165d983e45ee97a15b6ff4af8a48c4a3baeddea5568631c
7
+ data.tar.gz: de20a06d2d0f82da95a66ef10bcb4a808a8f40daaa5a1daeb387d9d49d1926d66d89485f2444cf9d0bbd1dcdf84a0a9ec829b213898efc8e755e796d08d4d0a8
@@ -1,3 +1,5 @@
1
+ require 'yaml'
2
+
1
3
  module TestCentricity
2
4
 
3
5
  XL_PRIMARY_DATA_PATH ||= 'features/test_data/'
@@ -23,9 +25,17 @@ module TestCentricity
23
25
  end
24
26
 
25
27
 
26
- class ExcelDataSource
28
+ class DataSource
27
29
  attr_accessor :current
28
30
 
31
+ def read_yaml_node_data(file_name, node_name)
32
+ data = YAML.load_file("#{XL_PRIMARY_DATA_PATH}#{file_name}")
33
+ data[node_name]
34
+ end
35
+ end
36
+
37
+
38
+ class ExcelDataSource < TestCentricity::DataSource
29
39
  def pick_excel_data_source(sheet, row_name)
30
40
  environment = ENV['TEST_ENVIRONMENT']
31
41
  data_file = "#{XL_PRIMARY_DATA_PATH}#{environment}_data.xls"
@@ -4,8 +4,14 @@ module TestCentricity
4
4
 
5
5
  WKS_ENVIRONS ||= 'Environments'
6
6
 
7
- def find_environ(row_name)
8
- @current = Environ.new(ExcelData.read_row_data(XL_PRIMARY_DATA_FILE, WKS_ENVIRONS, row_name))
7
+ def find_environ(environ_name, source_type = :excel)
8
+ case source_type
9
+ when :excel
10
+ data = ExcelData.read_row_data(XL_PRIMARY_DATA_FILE, WKS_ENVIRONS, environ_name)
11
+ when :yaml
12
+ data = read_yaml_node_data('environments.yml', environ_name)
13
+ end
14
+ @current = Environ.new(data)
9
15
  Environ.set_current(@current)
10
16
  end
11
17
  end
@@ -162,13 +162,13 @@ module TestCentricity
162
162
 
163
163
  def open_portal
164
164
  environment = Environ.current
165
- (environment.hostname.length > 0) ?
166
- url = "#{environment.hostname}/#{environment.base_url}#{environment.append}" :
167
- url = "#{environment.base_url}#{environment.append}"
168
- if environment.user_id.length > 0 && environment.password.length > 0
169
- visit "#{environment.protocol}://#{environment.user_id}:#{environment.password}@#{url}"
170
- else
165
+ environment.hostname.blank? ?
166
+ url = "#{environment.base_url}#{environment.append}" :
167
+ url = "#{environment.hostname}/#{environment.base_url}#{environment.append}"
168
+ if environment.user_id.blank? || environment.password.blank?
171
169
  visit "#{environment.protocol}://#{url}"
170
+ else
171
+ visit "#{environment.protocol}://#{environment.user_id}:#{environment.password}@#{url}"
172
172
  end
173
173
  Environ.set_portal_state(:open)
174
174
  end
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '0.7.7'
2
+ VERSION = '0.7.8'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testcentricity_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.7
4
+ version: 0.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - A.J. Mrozinski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-18 00:00:00.000000000 Z
11
+ date: 2016-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler