testcentricity_web 3.2.3 → 3.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +24 -24
- data/README.md +12 -9
- data/lib/testcentricity_web.rb +1 -0
- data/lib/testcentricity_web/utility_helpers.rb +8 -0
- data/lib/testcentricity_web/version.rb +1 -1
- data/lib/testcentricity_web/web_core/page_object.rb +24 -1
- data/lib/testcentricity_web/web_core/page_objects_helper.rb +2 -1
- data/lib/testcentricity_web/web_core/page_section.rb +23 -0
- data/lib/testcentricity_web/web_elements/range.rb +36 -0
- data/lib/testcentricity_web/web_elements/textfield.rb +27 -3
- data/testcentricity_web.gemspec +2 -2
- metadata +8 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f9bdfaf5c58d665211ecd77601ea526762f1b4f80fa4e803487d44f5255c97ea
|
4
|
+
data.tar.gz: 10f8d07f59688ce9fd65e5a4872236b16660dce386c71272cbd30bcef13808d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfd96ace3200351c8bc5a289428bd8404188e030d6345b8f53cfbdf3f32043c50fef1afa24dbfb4764d6b61085c0fc31b806649e2bace048228c01786bc8b9cc
|
7
|
+
data.tar.gz: 63d7c404e1c3a2115e0fc927f20af8a7cd46f5ea4f5931ae1e62e42a7717596f8f5d291c0cafbefb7a59832385a30de50494ffd904ab3ce3d7123ba6c2cb4446
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## [3.2.4] - 16-JAN-2020
|
5
|
+
|
6
|
+
### Added
|
7
|
+
* Added `Range` type `UIElement` to support interaction with and verification of HTML5 Input Range Slider Objects.
|
4
8
|
|
5
9
|
## [3.2.3] - 29-DEC-2019
|
6
10
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
testcentricity_web (3.2.
|
4
|
+
testcentricity_web (3.2.4)
|
5
5
|
appium_lib
|
6
6
|
browserstack-local
|
7
7
|
capybara (>= 3.1, < 4)
|
@@ -10,22 +10,22 @@ PATH
|
|
10
10
|
faker
|
11
11
|
i18n
|
12
12
|
os (~> 1.0)
|
13
|
-
selenium-webdriver
|
13
|
+
selenium-webdriver
|
14
14
|
spreadsheet (= 1.1.7)
|
15
15
|
test-unit
|
16
16
|
virtus
|
17
|
-
webdrivers (~>
|
17
|
+
webdrivers (~> 4.0)
|
18
18
|
|
19
19
|
GEM
|
20
20
|
remote: https://rubygems.org/
|
21
21
|
specs:
|
22
22
|
addressable (2.7.0)
|
23
23
|
public_suffix (>= 2.0.2, < 5.0)
|
24
|
-
appium_lib (10.
|
25
|
-
appium_lib_core (~> 3.
|
24
|
+
appium_lib (10.5.0)
|
25
|
+
appium_lib_core (~> 3.3)
|
26
26
|
nokogiri (~> 1.8, >= 1.8.1)
|
27
27
|
tomlrb (~> 1.1)
|
28
|
-
appium_lib_core (3.
|
28
|
+
appium_lib_core (3.5.0)
|
29
29
|
faye-websocket (~> 0.10.0)
|
30
30
|
selenium-webdriver (~> 3.14, >= 3.14.1)
|
31
31
|
axiom-types (0.1.1)
|
@@ -33,7 +33,7 @@ GEM
|
|
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.
|
36
|
+
capybara (3.30.0)
|
37
37
|
addressable
|
38
38
|
mini_mime (>= 0.1.3)
|
39
39
|
nokogiri (~> 1.8)
|
@@ -51,48 +51,48 @@ GEM
|
|
51
51
|
thread_safe (~> 0.3, >= 0.3.1)
|
52
52
|
equalizer (0.0.11)
|
53
53
|
eventmachine (1.2.7)
|
54
|
-
faker (2.
|
55
|
-
i18n (>= 1.6, <
|
54
|
+
faker (2.10.1)
|
55
|
+
i18n (>= 1.6, < 2)
|
56
56
|
faye-websocket (0.10.9)
|
57
57
|
eventmachine (>= 0.12.0)
|
58
58
|
websocket-driver (>= 0.5.1)
|
59
|
-
ffi (1.
|
60
|
-
i18n (1.
|
59
|
+
ffi (1.12.1)
|
60
|
+
i18n (1.8.2)
|
61
61
|
concurrent-ruby (~> 1.0)
|
62
62
|
ice_nine (0.11.2)
|
63
63
|
mini_mime (1.0.2)
|
64
64
|
mini_portile2 (2.4.0)
|
65
|
-
nokogiri (1.10.
|
65
|
+
nokogiri (1.10.7)
|
66
66
|
mini_portile2 (~> 2.4.0)
|
67
67
|
os (1.0.1)
|
68
68
|
power_assert (1.1.5)
|
69
|
-
public_suffix (4.0.
|
70
|
-
rack (2.
|
69
|
+
public_suffix (4.0.3)
|
70
|
+
rack (2.1.1)
|
71
71
|
rack-test (1.1.0)
|
72
72
|
rack (>= 1.0, < 3)
|
73
|
-
rake (
|
74
|
-
redcarpet (3.
|
73
|
+
rake (13.0.1)
|
74
|
+
redcarpet (3.5.0)
|
75
75
|
regexp_parser (1.6.0)
|
76
76
|
ruby-ole (1.2.12.2)
|
77
|
-
rubyzip (
|
78
|
-
selenium-webdriver (3.142.
|
77
|
+
rubyzip (2.0.0)
|
78
|
+
selenium-webdriver (3.142.7)
|
79
79
|
childprocess (>= 0.5, < 4.0)
|
80
80
|
rubyzip (>= 1.2.2)
|
81
81
|
spreadsheet (1.1.7)
|
82
82
|
ruby-ole (>= 1.0)
|
83
|
-
test-unit (3.3.
|
83
|
+
test-unit (3.3.5)
|
84
84
|
power_assert
|
85
85
|
thread_safe (0.3.6)
|
86
|
-
tomlrb (1.2.
|
86
|
+
tomlrb (1.2.9)
|
87
87
|
virtus (1.0.5)
|
88
88
|
axiom-types (~> 0.1)
|
89
89
|
coercible (~> 1.0)
|
90
90
|
descendants_tracker (~> 0.0, >= 0.0.3)
|
91
91
|
equalizer (~> 0.0, >= 0.0.9)
|
92
|
-
webdrivers (
|
92
|
+
webdrivers (4.2.0)
|
93
93
|
nokogiri (~> 1.6)
|
94
|
-
rubyzip (
|
95
|
-
selenium-webdriver (
|
94
|
+
rubyzip (>= 1.3.0)
|
95
|
+
selenium-webdriver (>= 3.0, < 4.0)
|
96
96
|
websocket-driver (0.7.1)
|
97
97
|
websocket-extensions (>= 0.1.0)
|
98
98
|
websocket-extensions (0.1.4)
|
@@ -109,4 +109,4 @@ DEPENDENCIES
|
|
109
109
|
testcentricity_web!
|
110
110
|
|
111
111
|
BUNDLED WITH
|
112
|
-
2.
|
112
|
+
2.1.2
|
data/README.md
CHANGED
@@ -419,6 +419,7 @@ Supported **UI Element** elementTypes and their declarations have the following
|
|
419
419
|
selectlist :select_name, locator
|
420
420
|
list :list_name, locator
|
421
421
|
table :table_name, locator
|
422
|
+
range :range_name, locator
|
422
423
|
image :image_name, locator
|
423
424
|
video :video_name, locator
|
424
425
|
audio :audio_name, locator
|
@@ -451,6 +452,8 @@ Supported **UI Element** elementTypes and their declarations have the following
|
|
451
452
|
list_X_name: locator
|
452
453
|
tables table_1_name: locator,
|
453
454
|
table_X_name: locator
|
455
|
+
ranges range_1_name: locator,
|
456
|
+
range_X_name: locator
|
454
457
|
images image_1_name: locator,
|
455
458
|
image_X_name: locator
|
456
459
|
videos video_1_name: locator,
|
@@ -504,6 +507,15 @@ With TestCentricity, all UI elements are based on the **UIElement** class, and i
|
|
504
507
|
element.get_native_attribute(attrib)
|
505
508
|
element.inspect
|
506
509
|
|
510
|
+
**Waiting methods:**
|
511
|
+
|
512
|
+
element.wait_until_exists(seconds)
|
513
|
+
element.wait_until_gone(seconds)
|
514
|
+
element.wait_until_visible(seconds)
|
515
|
+
element.wait_until_hidden(seconds)
|
516
|
+
element.wait_until_value_is(value, seconds)
|
517
|
+
element.wait_until_value_changes(seconds)
|
518
|
+
|
507
519
|
**WAI-ARIA Object Accessibility (A11y) methods:**
|
508
520
|
|
509
521
|
element.role
|
@@ -539,15 +551,6 @@ With TestCentricity, all UI elements are based on the **UIElement** class, and i
|
|
539
551
|
element.aria_multiselectable?
|
540
552
|
element.aria_busy?
|
541
553
|
|
542
|
-
**Waiting methods:**
|
543
|
-
|
544
|
-
element.wait_until_exists(seconds)
|
545
|
-
element.wait_until_gone(seconds)
|
546
|
-
element.wait_until_visible(seconds)
|
547
|
-
element.wait_until_hidden(seconds)
|
548
|
-
element.wait_until_value_is(value, seconds)
|
549
|
-
element.wait_until_value_changes(seconds)
|
550
|
-
|
551
554
|
|
552
555
|
## Instantiating your Page Objects
|
553
556
|
|
data/lib/testcentricity_web.rb
CHANGED
@@ -31,6 +31,7 @@ require 'testcentricity_web/web_elements/select_list'
|
|
31
31
|
require 'testcentricity_web/web_elements/list'
|
32
32
|
require 'testcentricity_web/web_elements/table'
|
33
33
|
require 'testcentricity_web/web_elements/textfield'
|
34
|
+
require 'testcentricity_web/web_elements/range'
|
34
35
|
require 'testcentricity_web/web_elements/audio'
|
35
36
|
require 'testcentricity_web/web_elements/video'
|
36
37
|
require 'testcentricity_web/web_elements/cell_element'
|
@@ -54,7 +54,7 @@ module TestCentricity
|
|
54
54
|
# @param locator [String] CSS selector or XPath expression that uniquely identifies object
|
55
55
|
# @example
|
56
56
|
# textfield :user_id_field, "//input[@id='UserName']"
|
57
|
-
# textfield :password_field, 'consumer_password'
|
57
|
+
# textfield :password_field, 'input#consumer_password'
|
58
58
|
#
|
59
59
|
def self.textfield(element_name, locator)
|
60
60
|
define_page_element(element_name, TestCentricity::TextField, locator)
|
@@ -74,6 +74,29 @@ module TestCentricity
|
|
74
74
|
element_hash.each(&method(:textfield))
|
75
75
|
end
|
76
76
|
|
77
|
+
# Declare and instantiate a single range input UI Element for this page object.
|
78
|
+
#
|
79
|
+
# @param element_name [Symbol] name of range input object (as a symbol)
|
80
|
+
# @param locator [String] CSS selector or XPath expression that uniquely identifies object
|
81
|
+
# @example
|
82
|
+
# range :volume_level, "//input[@id='volume_slider']"
|
83
|
+
# range :points_slider, 'input#points'
|
84
|
+
#
|
85
|
+
def self.range(element_name, locator)
|
86
|
+
define_page_element(element_name, TestCentricity::Range, locator)
|
87
|
+
end
|
88
|
+
|
89
|
+
# Declare and instantiate a collection of range inputs for this page object.
|
90
|
+
#
|
91
|
+
# @param element_hash [Hash] names of ranges (as a symbol) and CSS selectors or XPath expressions that uniquely identifies the ranges
|
92
|
+
# @example
|
93
|
+
# ranges points_slider: 'input#points',
|
94
|
+
# risk_slider: 'input#risk_percentage'
|
95
|
+
#
|
96
|
+
def self.ranges(element_hash)
|
97
|
+
element_hash.each(&method(:range))
|
98
|
+
end
|
99
|
+
|
77
100
|
# Declare and instantiate a single checkbox UI Element for this page object.
|
78
101
|
#
|
79
102
|
# @param element_name [Symbol] name of checkbox object (as a symbol)
|
@@ -228,7 +228,8 @@ module TestCentricity
|
|
228
228
|
rescue ObjectNotFoundError => e
|
229
229
|
ExceptionQueue.enqueue_exception(e.message)
|
230
230
|
ensure
|
231
|
-
|
231
|
+
error_msg = "#{fail_message}\nPage URL = #{URI.parse(current_url)}"
|
232
|
+
ExceptionQueue.post_exceptions(error_msg)
|
232
233
|
end
|
233
234
|
|
234
235
|
# Populate the specified UI elements on this page or section object with the associated data from a Hash passed as an
|
@@ -193,6 +193,29 @@ module TestCentricity
|
|
193
193
|
element_hash.each(&method(:textfield))
|
194
194
|
end
|
195
195
|
|
196
|
+
# Declare and instantiate a single range input UI Element for this page section.
|
197
|
+
#
|
198
|
+
# @param element_name [Symbol] name of range input object (as a symbol)
|
199
|
+
# @param locator [String] CSS selector or XPath expression that uniquely identifies object
|
200
|
+
# @example
|
201
|
+
# range :volume_level, "//input[@id='volume_slider']"
|
202
|
+
# range :points_slider, 'input#points'
|
203
|
+
#
|
204
|
+
def self.range(element_name, locator)
|
205
|
+
define_element(element_name, TestCentricity::Range, locator)
|
206
|
+
end
|
207
|
+
|
208
|
+
# Declare and instantiate a collection of range inputs for this page section.
|
209
|
+
#
|
210
|
+
# @param element_hash [Hash] names of ranges (as a symbol) and CSS selectors or XPath expressions that uniquely identifies the ranges
|
211
|
+
# @example
|
212
|
+
# ranges points_slider: 'input#points',
|
213
|
+
# risk_slider: 'input#risk_percentage'
|
214
|
+
#
|
215
|
+
def self.ranges(element_hash)
|
216
|
+
element_hash.each(&method(:range))
|
217
|
+
end
|
218
|
+
|
196
219
|
# Declare and instantiate a single checkbox UI Element for this page section.
|
197
220
|
#
|
198
221
|
# @param element_name [Symbol] name of checkbox object (as a symbol)
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module TestCentricity
|
2
|
+
class Range < TextField
|
3
|
+
def initialize(name, parent, locator, context)
|
4
|
+
super
|
5
|
+
@type = :range
|
6
|
+
end
|
7
|
+
|
8
|
+
# Set the value property of a range type input object.
|
9
|
+
#
|
10
|
+
# @param value [Integer]
|
11
|
+
# @example
|
12
|
+
# volume_level.value = 11
|
13
|
+
#
|
14
|
+
def value=(value)
|
15
|
+
obj, = find_element
|
16
|
+
object_not_found_exception(obj, nil)
|
17
|
+
page.execute_script('arguments[0].value = arguments[1]', obj, value)
|
18
|
+
obj.send_keys(:right)
|
19
|
+
end
|
20
|
+
|
21
|
+
def get_value(visible = true)
|
22
|
+
obj, type = find_element(visible)
|
23
|
+
object_not_found_exception(obj, type)
|
24
|
+
result = obj.value
|
25
|
+
unless result.blank?
|
26
|
+
if result.is_int?
|
27
|
+
result.to_i
|
28
|
+
elsif result.is_float?
|
29
|
+
result.to_f
|
30
|
+
else
|
31
|
+
result
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -52,7 +52,15 @@ module TestCentricity
|
|
52
52
|
obj, = find_element
|
53
53
|
object_not_found_exception(obj, nil)
|
54
54
|
min = obj.native.attribute('min')
|
55
|
-
|
55
|
+
unless min.blank?
|
56
|
+
if min.is_int?
|
57
|
+
min.to_i
|
58
|
+
elsif min.is_float?
|
59
|
+
min.to_f
|
60
|
+
else
|
61
|
+
min
|
62
|
+
end
|
63
|
+
end
|
56
64
|
end
|
57
65
|
|
58
66
|
# Return max attribute of a number type text field.
|
@@ -65,7 +73,15 @@ module TestCentricity
|
|
65
73
|
obj, = find_element
|
66
74
|
object_not_found_exception(obj, nil)
|
67
75
|
max = obj.native.attribute('max')
|
68
|
-
|
76
|
+
unless max.blank?
|
77
|
+
if max.is_int?
|
78
|
+
max.to_i
|
79
|
+
elsif max.is_float?
|
80
|
+
max.to_f
|
81
|
+
else
|
82
|
+
max
|
83
|
+
end
|
84
|
+
end
|
69
85
|
end
|
70
86
|
|
71
87
|
# Return step attribute of a number type text field.
|
@@ -78,7 +94,15 @@ module TestCentricity
|
|
78
94
|
obj, = find_element
|
79
95
|
object_not_found_exception(obj, nil)
|
80
96
|
step = obj.native.attribute('step')
|
81
|
-
|
97
|
+
unless step.blank?
|
98
|
+
if step.is_int?
|
99
|
+
step.to_i
|
100
|
+
elsif step.is_float?
|
101
|
+
step.to_f
|
102
|
+
else
|
103
|
+
step
|
104
|
+
end
|
105
|
+
end
|
82
106
|
end
|
83
107
|
|
84
108
|
# Clear the contents of a text field
|
data/testcentricity_web.gemspec
CHANGED
@@ -39,9 +39,9 @@ Gem::Specification.new do |spec|
|
|
39
39
|
spec.add_runtime_dependency 'faker'
|
40
40
|
spec.add_runtime_dependency 'i18n'
|
41
41
|
spec.add_runtime_dependency 'os', '~> 1.0'
|
42
|
-
spec.add_runtime_dependency 'selenium-webdriver'
|
42
|
+
spec.add_runtime_dependency 'selenium-webdriver'
|
43
43
|
spec.add_runtime_dependency 'spreadsheet', '1.1.7'
|
44
44
|
spec.add_runtime_dependency 'test-unit'
|
45
|
-
spec.add_runtime_dependency 'webdrivers', '~>
|
45
|
+
spec.add_runtime_dependency 'webdrivers', '~> 4.0'
|
46
46
|
spec.add_runtime_dependency 'virtus'
|
47
47
|
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: 3.2.
|
4
|
+
version: 3.2.4
|
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: 2020-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -162,20 +162,14 @@ dependencies:
|
|
162
162
|
requirements:
|
163
163
|
- - ">="
|
164
164
|
- !ruby/object:Gem::Version
|
165
|
-
version:
|
166
|
-
- - "<"
|
167
|
-
- !ruby/object:Gem::Version
|
168
|
-
version: '4.0'
|
165
|
+
version: '0'
|
169
166
|
type: :runtime
|
170
167
|
prerelease: false
|
171
168
|
version_requirements: !ruby/object:Gem::Requirement
|
172
169
|
requirements:
|
173
170
|
- - ">="
|
174
171
|
- !ruby/object:Gem::Version
|
175
|
-
version:
|
176
|
-
- - "<"
|
177
|
-
- !ruby/object:Gem::Version
|
178
|
-
version: '4.0'
|
172
|
+
version: '0'
|
179
173
|
- !ruby/object:Gem::Dependency
|
180
174
|
name: spreadsheet
|
181
175
|
requirement: !ruby/object:Gem::Requirement
|
@@ -210,14 +204,14 @@ dependencies:
|
|
210
204
|
requirements:
|
211
205
|
- - "~>"
|
212
206
|
- !ruby/object:Gem::Version
|
213
|
-
version: '
|
207
|
+
version: '4.0'
|
214
208
|
type: :runtime
|
215
209
|
prerelease: false
|
216
210
|
version_requirements: !ruby/object:Gem::Requirement
|
217
211
|
requirements:
|
218
212
|
- - "~>"
|
219
213
|
- !ruby/object:Gem::Version
|
220
|
-
version: '
|
214
|
+
version: '4.0'
|
221
215
|
- !ruby/object:Gem::Dependency
|
222
216
|
name: virtus
|
223
217
|
requirement: !ruby/object:Gem::Requirement
|
@@ -296,6 +290,7 @@ files:
|
|
296
290
|
- lib/testcentricity_web/web_elements/list_element.rb
|
297
291
|
- lib/testcentricity_web/web_elements/list_radio.rb
|
298
292
|
- lib/testcentricity_web/web_elements/radio.rb
|
293
|
+
- lib/testcentricity_web/web_elements/range.rb
|
299
294
|
- lib/testcentricity_web/web_elements/select_list.rb
|
300
295
|
- lib/testcentricity_web/web_elements/siebel_open_ui_helper.rb
|
301
296
|
- lib/testcentricity_web/web_elements/table.rb
|
@@ -326,7 +321,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
326
321
|
requirements:
|
327
322
|
- Capybara, Selenium-WebDriver
|
328
323
|
rubyforge_project:
|
329
|
-
rubygems_version: 2.
|
324
|
+
rubygems_version: 2.7.9
|
330
325
|
signing_key:
|
331
326
|
specification_version: 4
|
332
327
|
summary: A Page Object and Data Object Model Framework for desktop and mobile web
|