testcentricity_web 4.6.11 → 4.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +29 -29
- data/LICENSE.md +1 -1
- data/README.md +7 -7
- data/lib/testcentricity_web/data_objects/data_objects_helper.rb +149 -53
- data/lib/testcentricity_web/data_objects/environment.rb +20 -21
- data/lib/testcentricity_web/version.rb +1 -1
- data/lib/testcentricity_web/web_core/page_objects_helper.rb +10 -0
- metadata +36 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: aa2b9b061985c6e04005e82feb7b44b9901e13e2f78624a6f8a0e5c2edd91fa7
|
|
4
|
+
data.tar.gz: 16eb4823d74ec97b771d50994485f60234ec5a44a1f13f7b51a26e9bd19f3b53
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1f04b179abf04da0fe20e8beb228f5fbd9bd8542cc239ed75a23332c67cea8a4b1c04546d67fd79e3aee029d665d0d14a691a2a8338b6685a6852fba23a57316
|
|
7
|
+
data.tar.gz: 31e95275639ac5691439c9f60440c3b9f4790dc68633b438478ff393e248c5ed8c91d12656a102be858f7a266fb67b4a245d3c4f4cc64972dbc8f7df7935ed43
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
## [4.7.1] - 13-JAN-2026
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
* Added `activesupport` gem as a runtime dependency to prevent test failures if gem is not already installed.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## [4.7.0] - 12-JAN-2026
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
* Added `DataSource.read_file` method capable of reading from `.yml`, `.json`, `.csv`, or `.xml` data files, and accepting
|
|
15
|
+
`options` hash for specifying hash key and value conversions to data being read prior to passing to `DataPresenter` objects.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
* Refactored `EnvironData.read` method to allow passing `options` hash for specifying hash key and value conversions to
|
|
19
|
+
data being read prior to passing to `DataPresenter` objects.
|
|
20
|
+
* Refactored `PageObject.populate_data_fields` and `PageSection.populate_data_fields` methods to support passing a `Symbol`
|
|
21
|
+
for a UI element's name to support using `DataPresenter` object attributes to source data.
|
|
22
|
+
* Updated `appium_lib` gem to version 16.1.1.
|
|
23
|
+
* Updated `appium_lib_core` gem to version 11.2.0.
|
|
24
|
+
|
|
25
|
+
### Removed
|
|
26
|
+
* Unused `DataObject` class has been removed.
|
|
27
|
+
* Removed unused `DataSource.read_yaml_node_data` and `DataSource.read_json_node_data` methods.
|
|
28
|
+
|
|
29
|
+
|
|
5
30
|
## [4.6.11] - 24-NOV-2025
|
|
6
31
|
|
|
7
32
|
### Removed
|
|
@@ -12,7 +37,6 @@ All notable changes to this project will be documented in this file.
|
|
|
12
37
|
## [4.6.10] - 07-NOV-2025
|
|
13
38
|
|
|
14
39
|
### Added
|
|
15
|
-
|
|
16
40
|
* Added the following `Media` methods to support verification of media text tracks (subtitles, captions,
|
|
17
41
|
chapters, descriptions, or metadata):
|
|
18
42
|
* `active_track_cue_count`
|
|
@@ -32,14 +56,12 @@ All notable changes to this project will be documented in this file.
|
|
|
32
56
|
* `all_cues_data`
|
|
33
57
|
|
|
34
58
|
### Changed
|
|
35
|
-
|
|
36
59
|
* `Media.current_time` and `Media.duration` now return `Float` rounded to nearest tenth.
|
|
37
60
|
|
|
38
61
|
|
|
39
62
|
## [4.6.9] - 31-OCT-2025
|
|
40
63
|
|
|
41
64
|
### Added
|
|
42
|
-
|
|
43
65
|
* Added `Table.get_footer_columns` and `Table.get_footer_column`methods.
|
|
44
66
|
* Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to support verification of the following
|
|
45
67
|
`Table` properties:
|
|
@@ -48,14 +70,12 @@ All notable changes to this project will be documented in this file.
|
|
|
48
70
|
* `:column_header`
|
|
49
71
|
|
|
50
72
|
### Changed
|
|
51
|
-
|
|
52
73
|
* `UIElement.get_max` now works with HTML `<progress>` elements.
|
|
53
74
|
|
|
54
75
|
|
|
55
76
|
## [4.6.8] - 27-OCT-2025
|
|
56
77
|
|
|
57
78
|
### Changed
|
|
58
|
-
|
|
59
79
|
* `UIElement.aria_valuemax`, `UIElement.aria_valuemin`, and `UIElement.aria_valuenow` now return `Integer` or `Float`
|
|
60
80
|
instead of `String` result.
|
|
61
81
|
* `UIElement.aria_rowcount` and `UIElement.aria_colcount` now return `Integer` instead of `String` result.
|
|
@@ -74,7 +94,6 @@ All notable changes to this project will be documented in this file.
|
|
|
74
94
|
## [4.6.7] - 21-OCT-2025
|
|
75
95
|
|
|
76
96
|
### Added
|
|
77
|
-
|
|
78
97
|
* Added `UIElement.draggable?` method.
|
|
79
98
|
* Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to support verification of the
|
|
80
99
|
`draggable` property.
|
|
@@ -83,7 +102,6 @@ All notable changes to this project will be documented in this file.
|
|
|
83
102
|
## [4.6.6] - 10-OCT-2025
|
|
84
103
|
|
|
85
104
|
### Changed
|
|
86
|
-
|
|
87
105
|
* Update Nokogiri gem to address CVE-2025-6021, CVE-2025-6170, CVE-2025-49794, CVE-2025-49795, and CVE-2025-49796.
|
|
88
106
|
* Update REXML gem to address DoS vulnerability when parsing XML containing multiple XML declarations.
|
|
89
107
|
|
|
@@ -91,28 +109,24 @@ All notable changes to this project will be documented in this file.
|
|
|
91
109
|
## [4.6.5] - 18-JUL-2025
|
|
92
110
|
|
|
93
111
|
### Changed
|
|
94
|
-
|
|
95
112
|
* No longer bundling `selenium-webdriver` as a runtime dependency.
|
|
96
113
|
|
|
97
114
|
|
|
98
115
|
## [4.6.4] - 22-MAY-2025
|
|
99
116
|
|
|
100
117
|
### Changed
|
|
101
|
-
|
|
102
118
|
* Updated `selenium-webdriver` gem to version 4.32.0.
|
|
103
119
|
|
|
104
120
|
|
|
105
121
|
## [4.6.3] - 23-APR-2025
|
|
106
122
|
|
|
107
123
|
### Changed
|
|
108
|
-
|
|
109
124
|
* Updated `selenium-webdriver` gem to version 4.31.0.
|
|
110
125
|
|
|
111
126
|
|
|
112
127
|
## [4.6.2] - 28-MAR-2025
|
|
113
128
|
|
|
114
129
|
### Changed
|
|
115
|
-
|
|
116
130
|
* Updated `appium_lib` gem to version 16.1.0.
|
|
117
131
|
* Updated `appium_lib_core` gem to version 11.0.1.
|
|
118
132
|
* Updated `selenium-webdriver` gem to version 4.30.1.
|
|
@@ -121,7 +135,6 @@ All notable changes to this project will be documented in this file.
|
|
|
121
135
|
## [4.6.1] - 18-MAR-2025
|
|
122
136
|
|
|
123
137
|
### Changed
|
|
124
|
-
|
|
125
138
|
* Updated `appium_lib` gem to version 16.0.1.
|
|
126
139
|
* Updated `appium_lib_core` gem to version 10.0.0.
|
|
127
140
|
* Updated `selenium-webdriver` gem to version 4.29.1.
|
|
@@ -130,7 +143,6 @@ All notable changes to this project will be documented in this file.
|
|
|
130
143
|
## [4.6.0] - 25-JAN-2025
|
|
131
144
|
|
|
132
145
|
### Changed
|
|
133
|
-
|
|
134
146
|
* Updated `selenium-webdriver` gem to version 4.28.0.
|
|
135
147
|
* Updated `appium_lib` gem to version 15.3.0.
|
|
136
148
|
* Updated `appium_lib_core` gem to version 9.5.0.
|
|
@@ -140,7 +152,6 @@ All notable changes to this project will be documented in this file.
|
|
|
140
152
|
## [4.5.15] - 01-NOV-2024
|
|
141
153
|
|
|
142
154
|
### Changed
|
|
143
|
-
|
|
144
155
|
* Updated `selenium-webdriver` gem to version 4.26.0.
|
|
145
156
|
* Updated `rexml` gem to latest version to address ReDoS vulnerability.
|
|
146
157
|
|
|
@@ -148,35 +159,30 @@ All notable changes to this project will be documented in this file.
|
|
|
148
159
|
## [4.5.14] - 09-OCT-2024
|
|
149
160
|
|
|
150
161
|
### Fixed
|
|
151
|
-
|
|
152
162
|
* Disable Chrome search engine choice screen.
|
|
153
163
|
|
|
154
164
|
|
|
155
165
|
## [4.5.13] - 24-SEP-2024
|
|
156
166
|
|
|
157
167
|
### Changed
|
|
158
|
-
|
|
159
168
|
* Updated `selenium-webdriver` gem to version 4.25.0.
|
|
160
169
|
|
|
161
170
|
|
|
162
171
|
## [4.5.12] - 30-AUG-2024
|
|
163
172
|
|
|
164
173
|
### Changed
|
|
165
|
-
|
|
166
174
|
* Updated `selenium-webdriver` gem to version 4.24.0.
|
|
167
175
|
|
|
168
176
|
|
|
169
177
|
## [4.5.11] - 08-AUG-2024
|
|
170
178
|
|
|
171
179
|
### Changed
|
|
172
|
-
|
|
173
180
|
* Updated `appium_lib` gem to version 15.2.2.
|
|
174
181
|
|
|
175
182
|
|
|
176
183
|
## [4.5.10] - 05-AUG-2024
|
|
177
184
|
|
|
178
185
|
### Changed
|
|
179
|
-
|
|
180
186
|
* Updated `selenium-webdriver` gem to version 4.23.0.
|
|
181
187
|
* Updated `appium_lib` gem to version 15.2.1.
|
|
182
188
|
* Updated `appium_lib_core` gem to version 9.2.1.
|
|
@@ -185,7 +191,6 @@ All notable changes to this project will be documented in this file.
|
|
|
185
191
|
## [4.5.9.1] - 26-JUNE-2024
|
|
186
192
|
|
|
187
193
|
### Fixed
|
|
188
|
-
|
|
189
194
|
* Added `cuke_modeler` gem as a development dependency so that Cucumber test results logging would not fail when running
|
|
190
195
|
tests in parallel with Ruby version 3.1.0 or greater.
|
|
191
196
|
|
|
@@ -193,16 +198,14 @@ tests in parallel with Ruby version 3.1.0 or greater.
|
|
|
193
198
|
## [4.5.9] - 23-JUNE-2024
|
|
194
199
|
|
|
195
200
|
### Changed
|
|
196
|
-
|
|
197
201
|
* Updated `selenium-webdriver` gem to version 4.22.0.
|
|
198
202
|
|
|
199
203
|
|
|
200
204
|
## [4.5.8] - 21-MAY-2024
|
|
201
205
|
|
|
202
206
|
### Changed
|
|
203
|
-
|
|
204
207
|
* Setting `DOWNLOADS` Environment Variable to `true` will create a `/downloads` folder which will be used as the destination
|
|
205
|
-
for files that are downloaded by your automated tests. You
|
|
208
|
+
for files that are downloaded by your automated tests. You no longer need to manually create the `/downloads` folder.
|
|
206
209
|
* Updated `appium_lib` gem to version 15.1.0.
|
|
207
210
|
* Updated `appium_lib_core` gem to version 9.1.1.
|
|
208
211
|
* Updated `selenium-webdriver` gem to version 4.21.1.
|
|
@@ -211,7 +214,6 @@ for files that are downloaded by your automated tests. You know longer need to m
|
|
|
211
214
|
## [4.5.7] - 25-APR-2024
|
|
212
215
|
|
|
213
216
|
### Changed
|
|
214
|
-
|
|
215
217
|
* Updated `selenium-webdriver` gem to version 4.20.0.
|
|
216
218
|
* Updated `appium_lib` gem to version 15.0.0.
|
|
217
219
|
* Updated `appium_lib_core` gem to version 8.0.1.
|
|
@@ -220,7 +222,6 @@ for files that are downloaded by your automated tests. You know longer need to m
|
|
|
220
222
|
## [4.5.6] - 02-APR-2024
|
|
221
223
|
|
|
222
224
|
### Fixed
|
|
223
|
-
|
|
224
225
|
* `WebDriverConnect.initialize_web_driver`, `AppiumServer.start`, and `AppiumServer.running?` methods now support Appium
|
|
225
226
|
version 2.x. Backward compatibility with Appium version 1.x is provided if `APPIUM_SERVER_VERSION` Environment Variable
|
|
226
227
|
is set to `1`.
|
|
@@ -229,14 +230,12 @@ is set to `1`.
|
|
|
229
230
|
## [4.5.5] - 27-MAR-2024
|
|
230
231
|
|
|
231
232
|
### Changed
|
|
232
|
-
|
|
233
233
|
* Updated `selenium-webdriver` gem to version 4.19.0.
|
|
234
234
|
|
|
235
235
|
|
|
236
236
|
## [4.5.4] - 04-MAR-2024
|
|
237
237
|
|
|
238
238
|
### Changed
|
|
239
|
-
|
|
240
239
|
* Updated `selenium-webdriver` gem to version 4.18.1.
|
|
241
240
|
* Updated `rack` gem to version 3.0.9.1.
|
|
242
241
|
* Updated `nokogiri` gem to version 1.16.2.
|
|
@@ -245,14 +244,12 @@ is set to `1`.
|
|
|
245
244
|
## [4.5.3] - 27-JAN-2024
|
|
246
245
|
|
|
247
246
|
### Changed
|
|
248
|
-
|
|
249
247
|
* Updated `capybara` gem to version 3.40.0.
|
|
250
248
|
|
|
251
249
|
|
|
252
250
|
## [4.5.2] - 26-JAN-2024
|
|
253
251
|
|
|
254
252
|
### Changed
|
|
255
|
-
|
|
256
253
|
* Updated `appium_lib` gem to version 14.0.0.
|
|
257
254
|
* Updated `selenium-webdriver` gem to version 4.17.0.
|
|
258
255
|
|
|
@@ -1014,17 +1011,20 @@ Grid environments.
|
|
|
1014
1011
|
|
|
1015
1012
|
|
|
1016
1013
|
## [3.0.12] - 2018-08-09
|
|
1014
|
+
|
|
1017
1015
|
### Added
|
|
1018
1016
|
* `PageSection.hover` method.
|
|
1019
1017
|
* `List.hover_item` method.
|
|
1020
1018
|
|
|
1021
1019
|
|
|
1022
1020
|
## [3.0.11] - 2018-08-05
|
|
1021
|
+
|
|
1023
1022
|
### Added
|
|
1024
1023
|
* `UIElement.count` method.
|
|
1025
1024
|
|
|
1026
1025
|
|
|
1027
1026
|
## [3.0.10] - 2018-07-20
|
|
1027
|
+
|
|
1028
1028
|
### Added
|
|
1029
1029
|
* `Image.broken?` method.
|
|
1030
1030
|
* `UIElement.highlight` and `UIElement.unhighlight` methods.
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
|
@@ -92,12 +92,12 @@ that can be used in tests. A **Page Object** represents a single page in your AU
|
|
|
92
92
|
encapsulate the implementation details of a web page and expose an API that supports interaction with, and validation of
|
|
93
93
|
the UI elements on the page.
|
|
94
94
|
|
|
95
|
-
**Page Objects**
|
|
96
|
-
location - in
|
|
97
|
-
definitions are no longer required to hold specific information about a page's UI objects, thus minimizing
|
|
98
|
-
requirements. If any element on, or property of a page changes (URL path, text field attributes, button
|
|
99
|
-
maintenance is performed in the `PageObject` class definition only, typically with no need
|
|
100
|
-
files, scenarios, or step definitions.
|
|
95
|
+
**Page Objects** make it easier to maintain automated tests because changes to a page's UI elements are updated in only
|
|
96
|
+
one location - in th corresponding **Page Object** class definition. By adopting a **Page Object Model**, Cucumber Feature
|
|
97
|
+
files and step definitions are no longer required to hold specific information about a page's UI objects, thus minimizing
|
|
98
|
+
test maintenance requirements. If any element on, or property of a page changes (URL path, text field attributes, button
|
|
99
|
+
captions, etc.), maintenance is performed in the corresponding `PageObject` class definition only, typically with no need
|
|
100
|
+
to update the affected feature files, scenarios, or step definitions.
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
### Defining a PageObject
|
|
@@ -3159,7 +3159,7 @@ area sub-folders as needed. Likewise, `PageSection` class definitions should be
|
|
|
3159
3159
|
---
|
|
3160
3160
|
## Copyright and License
|
|
3161
3161
|
|
|
3162
|
-
TestCentricity™ Framework is Copyright (c) 2014-
|
|
3162
|
+
TestCentricity™ Framework is Copyright (c) 2014-2026, Tony Mrozinski.
|
|
3163
3163
|
All rights reserved.
|
|
3164
3164
|
|
|
3165
3165
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
|
|
@@ -1,47 +1,28 @@
|
|
|
1
|
-
require '
|
|
2
|
-
require '
|
|
3
|
-
require 'virtus'
|
|
4
|
-
require 'time'
|
|
1
|
+
require 'active_support'
|
|
2
|
+
require 'active_support/core_ext/hash'
|
|
5
3
|
require 'chronic'
|
|
6
4
|
require 'faker'
|
|
5
|
+
require 'json'
|
|
6
|
+
require 'rexml/document'
|
|
7
|
+
require 'smarter_csv'
|
|
8
|
+
require 'time'
|
|
9
|
+
require 'virtus'
|
|
10
|
+
require 'yaml'
|
|
7
11
|
|
|
8
12
|
|
|
9
13
|
module TestCentricity
|
|
10
14
|
|
|
11
15
|
PRIMARY_DATA_PATH ||= 'config/test_data/'
|
|
16
|
+
SECONDARY_DATA_PATH ||= 'config/data/'
|
|
12
17
|
PRIMARY_DATA_FILE ||= "#{PRIMARY_DATA_PATH}data."
|
|
13
18
|
YML_PRIMARY_DATA_FILE ||= "#{PRIMARY_DATA_FILE}yml"
|
|
14
19
|
JSON_PRIMARY_DATA_FILE ||= "#{PRIMARY_DATA_FILE}json"
|
|
15
20
|
|
|
16
21
|
|
|
17
|
-
class DataObject
|
|
18
|
-
attr_accessor :current
|
|
19
|
-
attr_accessor :context
|
|
20
|
-
attr_accessor :hash_table
|
|
21
|
-
|
|
22
|
-
def initialize(data)
|
|
23
|
-
@hash_table = data
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def self.current
|
|
27
|
-
@current
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def self.current=(current)
|
|
31
|
-
@current = current
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
|
|
36
22
|
class DataPresenter
|
|
37
23
|
include Virtus.model
|
|
38
24
|
|
|
39
25
|
attr_accessor :current
|
|
40
|
-
attr_accessor :context
|
|
41
|
-
|
|
42
|
-
def initialize(data)
|
|
43
|
-
self.attributes = data unless data.nil?
|
|
44
|
-
end
|
|
45
26
|
|
|
46
27
|
def self.current
|
|
47
28
|
@current
|
|
@@ -53,47 +34,162 @@ module TestCentricity
|
|
|
53
34
|
end
|
|
54
35
|
|
|
55
36
|
|
|
56
|
-
# :nocov:
|
|
57
37
|
class DataSource
|
|
58
38
|
attr_accessor :file_path
|
|
59
|
-
attr_accessor :
|
|
39
|
+
attr_accessor :file_extension
|
|
60
40
|
|
|
61
|
-
def
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
41
|
+
def read_file(file_name, key = nil, node_name = nil, options = nil)
|
|
42
|
+
# check to see if full file path was specified
|
|
43
|
+
if File.exist?(file_name)
|
|
44
|
+
@file_path = file_name
|
|
45
|
+
else
|
|
46
|
+
# construct the full file path to the file to be read
|
|
47
|
+
@file_path = "#{PRIMARY_DATA_PATH}#{file_name}"
|
|
48
|
+
unless File.exist?(@file_path)
|
|
49
|
+
@file_path = "#{SECONDARY_DATA_PATH}#{file_name}"
|
|
50
|
+
raise "File #{file_name} not found in Primary or Secondary folders in config folder" unless File.exist?(@file_path)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
# determine file type and read in data from file
|
|
54
|
+
@file_extension = File.extname(file_name)
|
|
55
|
+
data = case @file_extension
|
|
56
|
+
when '.yml'
|
|
57
|
+
YAML.load_file(@file_path)
|
|
58
|
+
when'.json'
|
|
59
|
+
JSON.parse(File.read(@file_path))
|
|
60
|
+
when '.xml'
|
|
61
|
+
xml_data = File.read(@file_path)
|
|
62
|
+
Hash.from_xml(xml_data)
|
|
63
|
+
when '.csv'
|
|
64
|
+
if options
|
|
65
|
+
SmarterCSV.process(@file_path, options)
|
|
66
|
+
else
|
|
67
|
+
SmarterCSV.process(@file_path)
|
|
68
|
+
end
|
|
69
|
+
else
|
|
70
|
+
raise "#{file_name} is not a supported file type"
|
|
71
|
+
end
|
|
72
|
+
# return data if sourced from a .csv file
|
|
73
|
+
return data if @file_extension == '.csv'
|
|
74
|
+
|
|
75
|
+
# read data from specified key and/or node
|
|
76
|
+
result = if key
|
|
77
|
+
raise "Key #{key} not found" unless data.key?(key)
|
|
78
|
+
|
|
79
|
+
if node_name
|
|
80
|
+
raise "Node #{node_name} not found" unless data[key].key?(node_name)
|
|
81
|
+
|
|
82
|
+
data[key][node_name]
|
|
83
|
+
else
|
|
84
|
+
data[key]
|
|
85
|
+
end
|
|
86
|
+
else
|
|
87
|
+
data
|
|
88
|
+
end
|
|
89
|
+
self.class.send(:process_data, result, options)
|
|
66
90
|
end
|
|
67
91
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
data
|
|
73
|
-
|
|
92
|
+
private
|
|
93
|
+
|
|
94
|
+
def self.process_data(data, options)
|
|
95
|
+
# calculate dynamic values if any are specified
|
|
96
|
+
if data.is_a?(Hash)
|
|
97
|
+
data.each do |key, value|
|
|
98
|
+
data[key] = calculate_dynamic_value(value) if value.to_s.start_with?('eval!')
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
return data unless options
|
|
102
|
+
|
|
103
|
+
# convert keys to symbols if :keys_as_symbols is true in options
|
|
104
|
+
if options.key?(:keys_as_symbols) && options[:keys_as_symbols]
|
|
105
|
+
data.transform_keys!(&:to_sym)
|
|
106
|
+
end
|
|
107
|
+
# convert values if :value_converters are specified in options
|
|
108
|
+
if options.key?(:value_converters)
|
|
109
|
+
map_values(data, options[:value_converters])
|
|
110
|
+
else
|
|
111
|
+
data
|
|
112
|
+
end
|
|
74
113
|
end
|
|
75
114
|
|
|
76
|
-
|
|
115
|
+
def self.map_values(data, value_converters)
|
|
116
|
+
data.each_with_object({}) do |(k, v), new_hash|
|
|
117
|
+
converter = value_converters[k]
|
|
118
|
+
v = converter.convert(v) if converter
|
|
119
|
+
new_hash[k] = v
|
|
120
|
+
end
|
|
121
|
+
end
|
|
77
122
|
|
|
78
123
|
def self.calculate_dynamic_value(value)
|
|
79
124
|
test_value = value.split('!', 2)
|
|
80
125
|
parameter = test_value[1].split('.', 2)
|
|
81
|
-
case parameter[0]
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
126
|
+
result = case parameter[0]
|
|
127
|
+
when 'Date'
|
|
128
|
+
Chronic.parse(parameter[1])
|
|
129
|
+
when 'FormattedDate', 'FormatDate'
|
|
130
|
+
date_time_params = parameter[1].split(' format! ', 2)
|
|
131
|
+
date_time = Chronic.parse(date_time_params[0].strip)
|
|
132
|
+
date_time.to_s.format_date_time("#{date_time_params[1].strip}")
|
|
133
|
+
else
|
|
134
|
+
if Faker.constants.include?(parameter[0].to_sym)
|
|
90
135
|
eval("Faker::#{parameter[0]}.#{parameter[1]}")
|
|
91
136
|
else
|
|
92
137
|
eval(test_value[1])
|
|
93
138
|
end
|
|
94
|
-
|
|
139
|
+
end
|
|
95
140
|
result.to_s
|
|
96
141
|
end
|
|
97
|
-
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
# perform conversion of String to Boolean when reading data from .csv or .xml files
|
|
147
|
+
class ToBoolean
|
|
148
|
+
def self.convert(value)
|
|
149
|
+
value.to_bool unless value.nil?
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
# perform conversion of Integer to String when reading data from .csv or .xml files
|
|
155
|
+
class ToString
|
|
156
|
+
def self.convert(value)
|
|
157
|
+
if value.is_a? Integer
|
|
158
|
+
value.to_s
|
|
159
|
+
else
|
|
160
|
+
value
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
# perform conversion of String to Integer when reading data from .csv or .xml files
|
|
167
|
+
class ToInteger
|
|
168
|
+
def self.convert(value)
|
|
169
|
+
if value.is_a? Integer
|
|
170
|
+
value
|
|
171
|
+
else
|
|
172
|
+
if value.is_int?
|
|
173
|
+
value.to_i
|
|
174
|
+
else
|
|
175
|
+
value
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
# perform conversion of String to Float when reading data from .csv or .xml files
|
|
183
|
+
class ToFloat
|
|
184
|
+
def self.convert(value)
|
|
185
|
+
if value.is_a? Float
|
|
186
|
+
value
|
|
187
|
+
else
|
|
188
|
+
if value.is_float?
|
|
189
|
+
value.to_f
|
|
190
|
+
else
|
|
191
|
+
value
|
|
192
|
+
end
|
|
193
|
+
end
|
|
98
194
|
end
|
|
99
195
|
end
|
|
@@ -22,13 +22,11 @@ module TestCentricity
|
|
|
22
22
|
read('Environments', environ_name)
|
|
23
23
|
when :json
|
|
24
24
|
# read generic test data from data.json file
|
|
25
|
-
|
|
26
|
-
@generic_data = JSON.parse(raw_data)
|
|
25
|
+
@generic_data = JSON.parse(File.read(JSON_PRIMARY_DATA_FILE))
|
|
27
26
|
# read environment specific test data
|
|
28
27
|
data_file = "#{PRIMARY_DATA_PATH}#{environ_name}_data.json"
|
|
29
28
|
@environ_specific_data = if File.exist?(data_file)
|
|
30
|
-
|
|
31
|
-
JSON.parse(raw_data)
|
|
29
|
+
JSON.parse(File.read(data_file))
|
|
32
30
|
else
|
|
33
31
|
{}
|
|
34
32
|
end
|
|
@@ -41,27 +39,21 @@ module TestCentricity
|
|
|
41
39
|
Environ.current = @current
|
|
42
40
|
end
|
|
43
41
|
|
|
44
|
-
def self.read(key_name, node_name)
|
|
45
|
-
if @environ_specific_data.key?(key_name) && @environ_specific_data[key_name].key?(node_name)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
node_data = @generic_data[key_name][node_name]
|
|
52
|
-
end
|
|
42
|
+
def self.read(key_name, node_name, options = nil)
|
|
43
|
+
node_data = if @environ_specific_data.key?(key_name) && @environ_specific_data[key_name].key?(node_name)
|
|
44
|
+
@environ_specific_data[key_name][node_name]
|
|
45
|
+
else
|
|
46
|
+
raise "No key named #{key_name} in generic and environment-specific data" unless @generic_data.key?(key_name)
|
|
47
|
+
raise "No node named #{node_name} in #{key_name} section of generic and environment-specific data" unless @generic_data[key_name].key?(node_name)
|
|
53
48
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
node_data
|
|
49
|
+
@generic_data[key_name][node_name]
|
|
50
|
+
end
|
|
51
|
+
process_data(node_data, options)
|
|
60
52
|
end
|
|
61
53
|
end
|
|
62
54
|
|
|
63
55
|
|
|
64
|
-
class Environ
|
|
56
|
+
class Environ
|
|
65
57
|
@session_id = Time.now.strftime('%d%H%M%S%L')
|
|
66
58
|
@session_time_stamp = Time.now.strftime('%Y%m%d%H%M%S')
|
|
67
59
|
@test_environment = ENV['TEST_ENVIRONMENT']
|
|
@@ -69,6 +61,7 @@ module TestCentricity
|
|
|
69
61
|
@language = ENV['LANGUAGE'] || 'English'
|
|
70
62
|
@screen_shots = []
|
|
71
63
|
|
|
64
|
+
attr_accessor :current
|
|
72
65
|
attr_accessor :test_environment
|
|
73
66
|
attr_accessor :app_host
|
|
74
67
|
attr_accessor :browser
|
|
@@ -154,8 +147,14 @@ module TestCentricity
|
|
|
154
147
|
else
|
|
155
148
|
"#{@protocol}://#{@user_id}:#{@password}@#{url}"
|
|
156
149
|
end
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
def self.current
|
|
153
|
+
@current
|
|
154
|
+
end
|
|
157
155
|
|
|
158
|
-
|
|
156
|
+
def self.current=(current)
|
|
157
|
+
@current = current
|
|
159
158
|
end
|
|
160
159
|
|
|
161
160
|
def self.driver_state
|
|
@@ -365,6 +365,16 @@ module TestCentricity
|
|
|
365
365
|
timeout = wait_time.nil? ? 5 : wait_time
|
|
366
366
|
data.each do |data_field, data_param|
|
|
367
367
|
unless data_param != false && data_param.blank?
|
|
368
|
+
# if data_field is a Symbol, find the corresponding object reference
|
|
369
|
+
if data_field.is_a?(Symbol)
|
|
370
|
+
begin
|
|
371
|
+
obj = method(data_field)
|
|
372
|
+
rescue
|
|
373
|
+
puts "No corresponding data field found for #{data_field}" if ENV['DEBUG']
|
|
374
|
+
next
|
|
375
|
+
end
|
|
376
|
+
data_field = obj.call
|
|
377
|
+
end
|
|
368
378
|
# make sure the intended UI target element is visible before trying to set its value
|
|
369
379
|
data_field.wait_until_visible(timeout)
|
|
370
380
|
if data_param == '!DELETE'
|
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: 4.
|
|
4
|
+
version: 4.7.1
|
|
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:
|
|
11
|
+
date: 2026-01-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: axe-core-cucumber
|
|
@@ -44,14 +44,14 @@ dependencies:
|
|
|
44
44
|
requirements:
|
|
45
45
|
- - '='
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 10.
|
|
47
|
+
version: 10.2.0
|
|
48
48
|
type: :development
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
52
|
- - '='
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 10.
|
|
54
|
+
version: 10.2.0
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: cuke_modeler
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -156,14 +156,14 @@ dependencies:
|
|
|
156
156
|
requirements:
|
|
157
157
|
- - "~>"
|
|
158
158
|
- !ruby/object:Gem::Version
|
|
159
|
-
version: 4.
|
|
159
|
+
version: 4.39.0
|
|
160
160
|
type: :development
|
|
161
161
|
prerelease: false
|
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
|
163
163
|
requirements:
|
|
164
164
|
- - "~>"
|
|
165
165
|
- !ruby/object:Gem::Version
|
|
166
|
-
version: 4.
|
|
166
|
+
version: 4.39.0
|
|
167
167
|
- !ruby/object:Gem::Dependency
|
|
168
168
|
name: simplecov
|
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -192,20 +192,34 @@ dependencies:
|
|
|
192
192
|
- - ">="
|
|
193
193
|
- !ruby/object:Gem::Version
|
|
194
194
|
version: 0.9.0
|
|
195
|
+
- !ruby/object:Gem::Dependency
|
|
196
|
+
name: activesupport
|
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
|
198
|
+
requirements:
|
|
199
|
+
- - ">="
|
|
200
|
+
- !ruby/object:Gem::Version
|
|
201
|
+
version: '4.0'
|
|
202
|
+
type: :runtime
|
|
203
|
+
prerelease: false
|
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
205
|
+
requirements:
|
|
206
|
+
- - ">="
|
|
207
|
+
- !ruby/object:Gem::Version
|
|
208
|
+
version: '4.0'
|
|
195
209
|
- !ruby/object:Gem::Dependency
|
|
196
210
|
name: appium_lib
|
|
197
211
|
requirement: !ruby/object:Gem::Requirement
|
|
198
212
|
requirements:
|
|
199
213
|
- - "~>"
|
|
200
214
|
- !ruby/object:Gem::Version
|
|
201
|
-
version: 16.1.
|
|
215
|
+
version: 16.1.1
|
|
202
216
|
type: :runtime
|
|
203
217
|
prerelease: false
|
|
204
218
|
version_requirements: !ruby/object:Gem::Requirement
|
|
205
219
|
requirements:
|
|
206
220
|
- - "~>"
|
|
207
221
|
- !ruby/object:Gem::Version
|
|
208
|
-
version: 16.1.
|
|
222
|
+
version: 16.1.1
|
|
209
223
|
- !ruby/object:Gem::Dependency
|
|
210
224
|
name: browserstack-local
|
|
211
225
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -304,6 +318,20 @@ dependencies:
|
|
|
304
318
|
- - "~>"
|
|
305
319
|
- !ruby/object:Gem::Version
|
|
306
320
|
version: '1.0'
|
|
321
|
+
- !ruby/object:Gem::Dependency
|
|
322
|
+
name: smarter_csv
|
|
323
|
+
requirement: !ruby/object:Gem::Requirement
|
|
324
|
+
requirements:
|
|
325
|
+
- - ">="
|
|
326
|
+
- !ruby/object:Gem::Version
|
|
327
|
+
version: '0'
|
|
328
|
+
type: :runtime
|
|
329
|
+
prerelease: false
|
|
330
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
331
|
+
requirements:
|
|
332
|
+
- - ">="
|
|
333
|
+
- !ruby/object:Gem::Version
|
|
334
|
+
version: '0'
|
|
307
335
|
- !ruby/object:Gem::Dependency
|
|
308
336
|
name: test-unit
|
|
309
337
|
requirement: !ruby/object:Gem::Requirement
|