testcentricity_web 3.2.23 → 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +40 -0
  3. data/Gemfile.lock +23 -23
  4. data/README.md +62 -29
  5. data/lib/testcentricity_web.rb +0 -10
  6. data/lib/testcentricity_web/browser_helper.rb +21 -13
  7. data/lib/testcentricity_web/data_objects/data_objects_helper.rb +34 -5
  8. data/lib/testcentricity_web/data_objects/environment.rb +70 -8
  9. data/lib/testcentricity_web/data_objects/excel_helper.rb +1 -25
  10. data/lib/testcentricity_web/utility_helpers.rb +4 -0
  11. data/lib/testcentricity_web/version.rb +1 -1
  12. data/lib/testcentricity_web/web_core/page_object.rb +1 -93
  13. data/lib/testcentricity_web/web_core/page_objects_helper.rb +1 -7
  14. data/lib/testcentricity_web/web_core/page_section.rb +0 -91
  15. data/lib/testcentricity_web/web_core/webdriver_helper.rb +127 -52
  16. data/lib/testcentricity_web/web_elements/checkbox.rb +1 -15
  17. data/lib/testcentricity_web/web_elements/file_field.rb +1 -1
  18. data/lib/testcentricity_web/web_elements/radio.rb +1 -1
  19. data/lib/testcentricity_web/web_elements/select_list.rb +0 -52
  20. data/lib/testcentricity_web/web_elements/ui_elements_helper.rb +5 -14
  21. data/lib/testcentricity_web/world_extensions.rb +1 -1
  22. metadata +2 -12
  23. data/lib/testcentricity_web/web_elements/cell_button.rb +0 -8
  24. data/lib/testcentricity_web/web_elements/cell_checkbox.rb +0 -38
  25. data/lib/testcentricity_web/web_elements/cell_element.rb +0 -69
  26. data/lib/testcentricity_web/web_elements/cell_image.rb +0 -8
  27. data/lib/testcentricity_web/web_elements/cell_radio.rb +0 -31
  28. data/lib/testcentricity_web/web_elements/list_button.rb +0 -8
  29. data/lib/testcentricity_web/web_elements/list_checkbox.rb +0 -38
  30. data/lib/testcentricity_web/web_elements/list_element.rb +0 -61
  31. data/lib/testcentricity_web/web_elements/list_radio.rb +0 -31
  32. data/lib/testcentricity_web/web_elements/siebel_open_ui_helper.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 201a3a1fe2a5b1283ab8a737e74926b33499996716889284fe01b529ae139ea5
4
- data.tar.gz: d34074fd5d9a2f3c651a70dca4dd0698bf4213033df533804ec3d6cd3e834b54
3
+ metadata.gz: ab40b67743553e06540746f3cc20b3dbef79aaf8f70f1be584dd54150a252e71
4
+ data.tar.gz: 638bb4707bb184a59fa6bf5645f8107891e569e8eb7f218ac92ef1259c21b9ec
5
5
  SHA512:
6
- metadata.gz: 421f09ad690ae3edbab6ac272d80e6e9839d7cd2651323419dbc0b3226839a3b370fce2d5e1900ccf6fc8aac6c441e0b7f1167022f0b908effabaac6d3b94f48
7
- data.tar.gz: d1c0c2cc3d8225515d9305be4a26ad13ccc6ef00bd05ac9d4328db9e5251e85d2a8872866d702e72b535b4da0978c83c05f3c86be24124adf8e718aa7dd4ca40
6
+ metadata.gz: 8de993273139d817ea101761ae99fbf5eb3a3737d57b7d3e537e9885dff49dcb842bef51448b88c72993768bb4e4f59f24299ed2ebd104a552d89ecd4f6bc9d7
7
+ data.tar.gz: 891917e94e04880a609a32c7a53adc5bfb125a1dd4c570fdf712d4164948b3e3748c0131ed5fc56b95ab6096c0570c0144a5eba974c926b0a7a860a35e1235ae
data/CHANGELOG.md CHANGED
@@ -1,6 +1,46 @@
1
1
  # CHANGELOG
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [4.0.0] - 18-APR-2021
5
+
6
+ ### Changed
7
+ * `WebDriverConnect.initialize_web_driver` method now accepts an `options` hash as an optional parameter, which can be used to
8
+ specify an optional base host URL and/or the desired Selenium-Webdriver capabilities required to establish a connection with
9
+ a cloud hosted target web browser.
10
+ * User defined mobile device profiles can be specified in a `device.yml` file for testing locally hosted emulated mobile
11
+ web browsers running in an instance of the Chrome desktop browser. The user specified device profiles must be located at
12
+ `config/data/devices/devices.yml`. Refer to the **User defined mobile device profiles** section of the {file:README.md README} file.
13
+
14
+ ### Removed
15
+ * Removed support for the following legacy UI elements:
16
+ * `CellElement`
17
+ * `CellButton`
18
+ * `CellCheckBox`
19
+ * `CellRadio`
20
+ * `CellImage`
21
+ * `ListElement`
22
+ * `ListButton`
23
+ * `ListCheckBox`
24
+ * Removed support for Siebel Open UI objects. This includes removal of the following legacy methods:
25
+ * `CheckBox.set_siebel_checkbox_state`
26
+ * `SelectList.choose_siebel_option`
27
+ * `SelectList.get_siebel_options`
28
+ * `SelectList.verify_siebel_options`
29
+ * `SelectList.read_only?`
30
+ * `UIElement.invoke_siebel_dialog`
31
+ * `UIElement.invoke_siebel_popup`
32
+ * `UIElement.get_siebel_object_type`
33
+
34
+ ## [3.3.0] - 14-MAR-2021
35
+
36
+ ### Fixed
37
+ * `WebDriverConnect.initialize_web_driver` method now correctly sets local Chrome browser Download directory when running
38
+ with headless Chrome.
39
+
40
+ ## [3.2.25] - 11-MAR-2021
41
+
42
+ ### Added
43
+ * Added `String.titlecase` method.
4
44
 
5
45
  ## [3.2.23] - 11-FEB-2021
6
46
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- testcentricity_web (3.2.23)
4
+ testcentricity_web (4.0.1)
5
5
  appium_lib
6
6
  browserstack-local
7
7
  capybara (>= 3.1, < 4)
@@ -21,58 +21,58 @@ GEM
21
21
  specs:
22
22
  addressable (2.7.0)
23
23
  public_suffix (>= 2.0.2, < 5.0)
24
- appium_lib (10.6.0)
25
- appium_lib_core (~> 3.3)
24
+ appium_lib (11.2.0)
25
+ appium_lib_core (~> 4.1)
26
26
  nokogiri (~> 1.8, >= 1.8.1)
27
27
  tomlrb (~> 1.1)
28
- appium_lib_core (3.10.0)
29
- faye-websocket (~> 0.10.0)
28
+ appium_lib_core (4.5.0)
29
+ faye-websocket (~> 0.11.0)
30
30
  selenium-webdriver (~> 3.14, >= 3.14.1)
31
31
  axiom-types (0.1.1)
32
32
  descendants_tracker (~> 0.0.4)
33
33
  ice_nine (~> 0.11.0)
34
34
  thread_safe (~> 0.3, >= 0.3.1)
35
35
  browserstack-local (1.3.0)
36
- capybara (3.32.2)
36
+ capybara (3.35.3)
37
37
  addressable
38
38
  mini_mime (>= 0.1.3)
39
39
  nokogiri (~> 1.8)
40
40
  rack (>= 1.6.0)
41
41
  rack-test (>= 0.6.3)
42
- regexp_parser (~> 1.5)
42
+ regexp_parser (>= 1.5, < 3.0)
43
43
  xpath (~> 3.2)
44
44
  childprocess (0.9.0)
45
45
  ffi (~> 1.0, >= 1.0.11)
46
46
  chronic (0.10.2)
47
47
  coercible (1.0.0)
48
48
  descendants_tracker (~> 0.0.1)
49
- concurrent-ruby (1.1.6)
49
+ concurrent-ruby (1.1.8)
50
50
  descendants_tracker (0.0.4)
51
51
  thread_safe (~> 0.3, >= 0.3.1)
52
52
  equalizer (0.0.11)
53
53
  eventmachine (1.2.7)
54
- faker (2.12.0)
54
+ faker (2.17.0)
55
55
  i18n (>= 1.6, < 2)
56
- faye-websocket (0.10.9)
56
+ faye-websocket (0.11.0)
57
57
  eventmachine (>= 0.12.0)
58
58
  websocket-driver (>= 0.5.1)
59
- ffi (1.13.1)
60
- i18n (1.8.3)
59
+ ffi (1.15.0)
60
+ i18n (1.8.10)
61
61
  concurrent-ruby (~> 1.0)
62
62
  ice_nine (0.11.2)
63
- mini_mime (1.0.2)
64
- mini_portile2 (2.4.0)
65
- nokogiri (1.10.9)
66
- mini_portile2 (~> 2.4.0)
67
- os (1.1.0)
68
- power_assert (1.2.0)
69
- public_suffix (4.0.5)
63
+ mini_mime (1.1.0)
64
+ nokogiri (1.11.3-x86_64-darwin)
65
+ racc (~> 1.4)
66
+ os (1.1.1)
67
+ power_assert (2.0.0)
68
+ public_suffix (4.0.6)
69
+ racc (1.5.2)
70
70
  rack (2.2.3)
71
71
  rack-test (1.1.0)
72
72
  rack (>= 1.0, < 3)
73
73
  rake (13.0.1)
74
74
  redcarpet (3.5.0)
75
- regexp_parser (1.7.1)
75
+ regexp_parser (2.1.1)
76
76
  ruby-ole (1.2.12.2)
77
77
  rubyzip (2.3.0)
78
78
  selenium-webdriver (3.142.7)
@@ -80,7 +80,7 @@ GEM
80
80
  rubyzip (>= 1.2.2)
81
81
  spreadsheet (1.1.7)
82
82
  ruby-ole (>= 1.0)
83
- test-unit (3.3.6)
83
+ test-unit (3.4.1)
84
84
  power_assert
85
85
  thread_safe (0.3.6)
86
86
  tomlrb (1.3.0)
@@ -89,11 +89,11 @@ GEM
89
89
  coercible (~> 1.0)
90
90
  descendants_tracker (~> 0.0, >= 0.0.3)
91
91
  equalizer (~> 0.0, >= 0.0.9)
92
- webdrivers (4.4.1)
92
+ webdrivers (4.6.0)
93
93
  nokogiri (~> 1.6)
94
94
  rubyzip (>= 1.3.0)
95
95
  selenium-webdriver (>= 3.0, < 4.0)
96
- websocket-driver (0.7.2)
96
+ websocket-driver (0.7.3)
97
97
  websocket-extensions (>= 0.1.0)
98
98
  websocket-extensions (0.1.5)
99
99
  xpath (3.2.0)
data/README.md CHANGED
@@ -23,7 +23,6 @@ The TestCentricity™ Web gem supports running automated tests against the follo
23
23
  * [Gridlastic](https://www.gridlastic.com/test-environments.html)
24
24
  * [LambdaTest](https://www.lambdatest.com/selenium-automation)
25
25
  * web portals utilizing JavaScript front end application frameworks like Ember, React, Angular, and GWT
26
- * enterprise web portals built using Siebel Open UI
27
26
  * web pages containing HTML5 Video and Audio objects
28
27
 
29
28
 
@@ -483,6 +482,7 @@ With TestCentricity, all UI elements are based on the **UIElement** class, and i
483
482
  element.click_at(x, y)
484
483
  element.hover
485
484
  element.hover_at(x, y)
485
+ element.scroll_to(position)
486
486
  element.drag_by(right_offset, down_offset)
487
487
  element.drag_and_drop(target, right_offset, down_offset)
488
488
 
@@ -638,11 +638,11 @@ navigated to by clicking associated links. One such Cucumber navigation scenario
638
638
 
639
639
  Scenario Outline: Verify Home page navigation links
640
640
  Given I am on the Home page
641
- When I click the <page_name> navigation link
642
- Then I expect the <page_name> page to be correctly displayed
641
+ When I click the <page name> navigation link
642
+ Then I expect the <page name> page to be correctly displayed
643
643
 
644
644
  Examples:
645
- |page_name |
645
+ |page name |
646
646
  |Registration |
647
647
  |My Account |
648
648
  |Terms & Conditions |
@@ -653,41 +653,42 @@ navigated to by clicking associated links. One such Cucumber navigation scenario
653
653
  In the above example, the step definitions associated with the 3 steps might be implemented using a `page_dispatcher` method using a
654
654
  `case` statement to parse the `page` parameter as in the example below:
655
655
 
656
- Given(/^I am on the ([^\"]*) page$/) do |page_name|
656
+ Given(/^I am on the (.*) page$/) do |page_name|
657
657
  target_page = page_dispatcher(page_name)
658
658
  target_page.load_page
659
659
  end
660
660
 
661
- When(/^I click the ([^\"]*) navigation link$/) do |link_name|
661
+ When(/^I click the (.*) navigation link$/) do |link_name|
662
662
  target_page = page_dispatcher(link_name)
663
663
  target_page.navigate_to
664
664
  end
665
665
 
666
- Then(/^I expect the ([^\"]*) page to be correctly displayed$/) do |page_name|
666
+ Then(/^I expect the (.*) page to be correctly displayed$/) do |page_name|
667
667
  target_page = page_dispatcher(page_name)
668
668
  target_page.verify_page_exists
669
669
  target_page.verify_page_ui
670
670
  end
671
671
 
672
672
  # this method takes a page name as a parameter and returns an instance of the associated Page Object
673
- def page_dispatcher(page_name)
674
- case page_name
675
- when 'Registration'
676
- page = registration_page
677
- when 'My Account'
678
- page = my_account_page
679
- when 'Terms & Conditions'
680
- page = terms_conditions_page
681
- when 'Privacy Policy'
682
- page = privacy_policy_page
683
- when 'Contact Us'
684
- page = contact_us_page
685
- when 'FAQs'
686
- page = faqs_page
673
+ def page_dispatcher(page_name)
674
+ page = case page_name
675
+ when 'Registration'
676
+ registration_page
677
+ when 'My Account'
678
+ my_account_page
679
+ when 'Terms & Conditions'
680
+ terms_conditions_page
681
+ when 'Privacy Policy'
682
+ privacy_policy_page
683
+ when 'Contact Us'
684
+ contact_us_page
685
+ when 'FAQs'
686
+ faqs_page
687
+ end
688
+ raise "No page object defined for page named '#{page_name}'" unless page
689
+ page
687
690
  end
688
- raise "No page object defined for page named '#{page_name}'" unless page
689
- page
690
- end
691
+
691
692
 
692
693
 
693
694
  While this approach may be effective for small web applications with only a few pages (and hence few **Page Objects**), it quickly becomes
@@ -701,22 +702,22 @@ To use these **PageManager** methods, include the step definitions and code belo
701
702
 
702
703
  include TestCentricity
703
704
 
704
- Given(/^I am on the ([^\"]*) page$/) do |page_name|
705
+ Given(/^I am on the (.*) page$/) do |page_name|
705
706
  target_page = PageManager.find_page(page_name)
706
707
  target_page.load_page
707
708
  end
708
709
 
709
- When(/^I click the ([^\"]*) navigation link$/) do |page_name|
710
+ When(/^I click the (.*) navigation link$/) do |page_name|
710
711
  target_page = PageManager.find_page(page_name)
711
712
  target_page.navigate_to
712
713
  end
713
714
 
714
- Then(/^I expect to see the ([^\"]*) page$/) do |page_name|
715
+ Then(/^I expect to see the (.*) page$/) do |page_name|
715
716
  target_page = PageManager.find_page(page_name)
716
717
  target_page.verify_page_exists
717
718
  end
718
719
 
719
- Then(/^I expect the ([^\"]*) page to be correctly displayed$/) do |page_name|
720
+ Then(/^I expect the (.*) page to be correctly displayed$/) do |page_name|
720
721
  target_page = PageManager.find_page(page_name)
721
722
  target_page.verify_page_exists
722
723
  target_page.verify_page_ui
@@ -870,6 +871,38 @@ To use a local instance of the Chrome desktop browser to host the emulated mobil
870
871
  to `chrome`.
871
872
 
872
873
 
874
+ #### User defined mobile device profiles
875
+
876
+ User defined mobile device profiles can be specified in a `device.yml` file for testing locally hosted emulated mobile web browsers running in an instance
877
+ of the Chrome desktop browser. The user specified device profiles must be located at `config/data/devices/devices.yml` as depicted below:
878
+
879
+ my_automation_project
880
+ ├── config
881
+ │ ├── data
882
+ │ │ └── devices
883
+ │ │ └── devices.yml
884
+ │ ├── locales
885
+ │ └── cucumber.yml
886
+ ├── downloads
887
+ ├── features
888
+ │ ├── step_definitions
889
+ │ ├── support
890
+ │ └── test_data
891
+ ├── Gemfile
892
+ └── README.md
893
+
894
+ The format for a new device profile is:
895
+ ```
896
+ :new_device_profile:
897
+ :name: "New Device Name"
898
+ :os: (ios, android, kindle, or blackberry)
899
+ :type: (phone or tablet)
900
+ :css_width: css width in pixels
901
+ :css_height: css height in pixels
902
+ :default_orientation: (portrait or landscape)
903
+ :user_agent: "user agent string"
904
+ ```
905
+
873
906
  ### Selenium Grid and Dockerized Selenium Grid hosted desktop and emulated mobile web browsers
874
907
 
875
908
  For desktop and emulated mobile web browsers running on Selenium Grid or Dockerized Selenium Grid environments ([like Zalenium](https://opensource.zalando.com/zalenium/)), the following **Environment Variables** must be set
@@ -877,7 +910,7 @@ as described in the table below.
877
910
 
878
911
  **Environment Variable** | **Description**
879
912
  --------------- | ----------------
880
- `WEB_BROWSER` | Must be set to one of the following desktop browsers - `chrome`, `chrome_headless`, `firefox`, `ie`, `edge`, or `safari` or any of the mobile web browsers described above.
913
+ `WEB_BROWSER` | Must be set to one of the following desktop browsers - `chrome`, `chrome_headless`, or `firefox`, or any of the mobile web browsers described above.
881
914
  `SELENIUM` | Must be set to `remote`
882
915
  `REMOTE_ENDPOINT` | Must be set to the URL of the Grid hub, which is usually `http://localhost:4444/wd/hub`
883
916
 
@@ -35,16 +35,6 @@ require 'testcentricity_web/web_elements/range'
35
35
  require 'testcentricity_web/web_elements/media'
36
36
  require 'testcentricity_web/web_elements/audio'
37
37
  require 'testcentricity_web/web_elements/video'
38
- require 'testcentricity_web/web_elements/cell_element'
39
- require 'testcentricity_web/web_elements/cell_button'
40
- require 'testcentricity_web/web_elements/cell_checkbox'
41
- require 'testcentricity_web/web_elements/cell_radio'
42
- require 'testcentricity_web/web_elements/cell_image'
43
- require 'testcentricity_web/web_elements/list_element'
44
- require 'testcentricity_web/web_elements/list_button'
45
- require 'testcentricity_web/web_elements/list_checkbox'
46
- require 'testcentricity_web/web_elements/list_radio'
47
- require 'testcentricity_web/web_elements/siebel_open_ui_helper'
48
38
 
49
39
 
50
40
  module TestCentricity
@@ -2,9 +2,11 @@ require 'yaml'
2
2
 
3
3
 
4
4
  module TestCentricity
5
- module Browsers
5
+ class Browsers
6
6
  include Capybara::DSL
7
7
 
8
+ @devices = {}
9
+
8
10
  # Sets the size of the browser window.
9
11
  #
10
12
  # @param resolution [Array] the desired [width, height]
@@ -73,8 +75,8 @@ module TestCentricity
73
75
 
74
76
  def self.close_all_browser_instances
75
77
  Capybara.page.driver.browser.window_handles.each do |handle|
76
- page.driver.browser.switch_to.window(handle)
77
- page.driver.browser.close
78
+ Capybara.page.driver.browser.switch_to.window(handle)
79
+ Capybara.page.driver.browser.close
78
80
  end
79
81
  end
80
82
 
@@ -126,17 +128,15 @@ module TestCentricity
126
128
  end
127
129
  end
128
130
 
129
- def self.mobile_device_agent(device)
130
- device_name = device.gsub(/\s+/, '').downcase.to_sym
131
- device = get_devices[device_name]
131
+ def self.mobile_device_agent(browser)
132
+ device = get_device(browser)
132
133
  agent_string = device[:user_agent]
133
134
  raise "Device '#{device}' is not defined" unless agent_string
134
135
  agent_string
135
136
  end
136
137
 
137
- def self.mobile_device_name(device)
138
- device_name = device.gsub(/\s+/, '').downcase.to_sym
139
- device = get_devices[device_name]
138
+ def self.mobile_device_name(browser)
139
+ device = get_device(browser)
140
140
  name = device[:name]
141
141
  raise "Device '#{device}' is not defined" unless name
142
142
  Environ.device_os = device[:os]
@@ -145,8 +145,7 @@ module TestCentricity
145
145
  end
146
146
 
147
147
  def self.browser_size(browser, orientation)
148
- device_name = browser.gsub(/\s+/, '').downcase.to_sym
149
- device = get_devices[device_name]
148
+ device = get_device(browser)
150
149
  if device
151
150
  width = device[:css_width]
152
151
  height = device[:css_height]
@@ -170,8 +169,17 @@ module TestCentricity
170
169
 
171
170
  private
172
171
 
173
- def self.get_devices
174
- YAML.load_file File.expand_path('../../devices/devices.yml', __FILE__)
172
+ def self.get_device(device)
173
+ if @devices.blank?
174
+ @devices = YAML.load_file File.expand_path('../../devices/devices.yml', __FILE__)
175
+ # read in user defined list of devices
176
+ external_device_file = 'config/data/devices/devices.yml'
177
+ unless File.size?(external_device_file).nil?
178
+ ext_devices = YAML.load_file(external_device_file)
179
+ @devices = @devices.merge(ext_devices)
180
+ end
181
+ end
182
+ @devices[device.gsub(/\s+/, '').downcase.to_sym]
175
183
  end
176
184
  end
177
185
  end
@@ -1,12 +1,18 @@
1
1
  require 'yaml'
2
2
  require 'json'
3
3
  require 'virtus'
4
+ require 'time'
5
+ require 'chronic'
6
+ require 'faker'
4
7
 
5
8
 
6
9
  module TestCentricity
7
10
 
8
- XL_PRIMARY_DATA_PATH ||= 'features/test_data/'
9
- XL_PRIMARY_DATA_FILE ||= "#{XL_PRIMARY_DATA_PATH}data.xls"
11
+ PRIMARY_DATA_PATH ||= 'features/test_data/'
12
+ PRIMARY_DATA_FILE ||= "#{PRIMARY_DATA_PATH}data."
13
+ XL_PRIMARY_DATA_FILE ||= "#{PRIMARY_DATA_FILE}xls"
14
+ YML_PRIMARY_DATA_FILE ||= "#{PRIMARY_DATA_FILE}yml"
15
+ JSON_PRIMARY_DATA_FILE ||= "#{PRIMARY_DATA_FILE}json"
10
16
 
11
17
 
12
18
  class DataObject
@@ -81,7 +87,7 @@ module TestCentricity
81
87
  attr_accessor :node
82
88
 
83
89
  def read_yaml_node_data(file_name, node_name)
84
- @file_path = "#{XL_PRIMARY_DATA_PATH}#{file_name}"
90
+ @file_path = "#{PRIMARY_DATA_PATH}#{file_name}"
85
91
  @node = node_name
86
92
  data = YAML.load_file(@file_path)
87
93
  data[node_name]
@@ -94,7 +100,7 @@ module TestCentricity
94
100
  end
95
101
 
96
102
  def read_json_node_data(file_name, node_name)
97
- @file_path = "#{XL_PRIMARY_DATA_PATH}#{file_name}"
103
+ @file_path = "#{PRIMARY_DATA_PATH}#{file_name}"
98
104
  @node = node_name
99
105
  raw_data = File.read(@file_path)
100
106
  data = JSON.parse(raw_data)
@@ -106,6 +112,28 @@ module TestCentricity
106
112
  data[node_name] = node_data
107
113
  File.write(@file_path, data.to_json)
108
114
  end
115
+
116
+ private
117
+
118
+ def self.calculate_dynamic_value(value)
119
+ test_value = value.split('!', 2)
120
+ parameter = test_value[1].split('.', 2)
121
+ case parameter[0]
122
+ when 'Date'
123
+ result = eval("Chronic.parse('#{parameter[1]}')")
124
+ when 'FormattedDate', 'FormatDate'
125
+ date_time_params = parameter[1].split(' format! ', 2)
126
+ date_time = eval("Chronic.parse('#{date_time_params[0].strip}')")
127
+ result = date_time.to_s.format_date_time("#{date_time_params[1].strip}")
128
+ else
129
+ result = if Faker.constants.include?(parameter[0].to_sym)
130
+ eval("Faker::#{parameter[0]}.#{parameter[1]}")
131
+ else
132
+ eval(test_value[1])
133
+ end
134
+ end
135
+ result.to_s
136
+ end
109
137
  end
110
138
 
111
139
 
@@ -117,7 +145,7 @@ module TestCentricity
117
145
  @worksheet = sheet
118
146
  if ENV['TEST_ENVIRONMENT']
119
147
  environment = ENV['TEST_ENVIRONMENT']
120
- data_file = "#{XL_PRIMARY_DATA_PATH}#{environment}_data.xls"
148
+ data_file = "#{PRIMARY_DATA_PATH}#{environment}_data.xls"
121
149
  data_file = XL_PRIMARY_DATA_FILE unless ExcelData.row_spec_exists?(data_file, @worksheet, row_spec)
122
150
  else
123
151
  data_file = XL_PRIMARY_DATA_FILE
@@ -147,3 +175,4 @@ module TestCentricity
147
175
  end
148
176
  end
149
177
  end
178
+