testcentricity_web 3.2.18 → 3.2.23
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 +31 -0
- data/Gemfile.lock +1 -1
- data/LICENSE.md +1 -1
- data/README.md +1 -1
- data/lib/testcentricity_web/exception_queue_helper.rb +40 -6
- data/lib/testcentricity_web/version.rb +1 -1
- data/lib/testcentricity_web/web_elements/select_list.rb +2 -2
- data/lib/testcentricity_web/web_elements/ui_elements_helper.rb +16 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 201a3a1fe2a5b1283ab8a737e74926b33499996716889284fe01b529ae139ea5
|
4
|
+
data.tar.gz: d34074fd5d9a2f3c651a70dca4dd0698bf4213033df533804ec3d6cd3e834b54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 421f09ad690ae3edbab6ac272d80e6e9839d7cd2651323419dbc0b3226839a3b370fce2d5e1900ccf6fc8aac6c441e0b7f1167022f0b908effabaac6d3b94f48
|
7
|
+
data.tar.gz: d1c0c2cc3d8225515d9305be4a26ad13ccc6ef00bd05ac9d4328db9e5251e85d2a8872866d702e72b535b4da0978c83c05f3c86be24124adf8e718aa7dd4ca40
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,37 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
|
5
|
+
## [3.2.23] - 11-FEB-2021
|
6
|
+
|
7
|
+
### Changed
|
8
|
+
* Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to allow `:translate_upcase`,
|
9
|
+
`:translate_downcase`, `:translate_capitalize`, and `:translate_titlecase` conversions to fall back to `:en` default
|
10
|
+
locale if translated strings are missing from the current locale specified in `I18n.locale`.
|
11
|
+
|
12
|
+
## [3.2.22] - 09-FEB-2021
|
13
|
+
|
14
|
+
### Fixed
|
15
|
+
* Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to correctly handle `:translate_upcase`,
|
16
|
+
`:translate_downcase`, `:translate_capitalize`, and `:translate_titlecase` conversions for Arrays of `String`.
|
17
|
+
|
18
|
+
## [3.2.21] - 04-FEB-2021
|
19
|
+
|
20
|
+
### Changed
|
21
|
+
* `UIElement.hover_at` method now accepts an optional `visible` parameter to allow hovering over UI elements that are not
|
22
|
+
visible.
|
23
|
+
|
24
|
+
## [3.2.20] - 21-JAN-2021
|
25
|
+
|
26
|
+
### Changed
|
27
|
+
* `UIElement.hover` method now accepts an optional `visible` parameter to allow hovering over UI elements that are not
|
28
|
+
visible.
|
29
|
+
|
30
|
+
## [3.2.19] - 05-JAN-2021
|
31
|
+
|
32
|
+
### Fixed
|
33
|
+
* `SelectList.choose_option` and `SelectList.get_options` methods now wait up to 5 seconds for list drop menu to appear.
|
34
|
+
|
4
35
|
## [3.2.18] - 12-AUG-2020
|
5
36
|
|
6
37
|
### Fixed
|
data/Gemfile.lock
CHANGED
data/LICENSE.md
CHANGED
data/README.md
CHANGED
@@ -1673,7 +1673,7 @@ landscape orientation running on the BrowserStack service:
|
|
1673
1673
|
|
1674
1674
|
## Copyright and License
|
1675
1675
|
|
1676
|
-
TestCentricity™ Framework is Copyright (c) 2014-
|
1676
|
+
TestCentricity™ Framework is Copyright (c) 2014-2021, Tony Mrozinski.
|
1677
1677
|
All rights reserved.
|
1678
1678
|
|
1679
1679
|
Redistribution and use in source and binary forms, with or without
|
@@ -76,20 +76,31 @@ module TestCentricity
|
|
76
76
|
expected = expected.downcase
|
77
77
|
enqueue_exception("#{error_msg} be like '#{value}' but found '#{actual}'") unless actual_like.include?(expected)
|
78
78
|
when :translate
|
79
|
-
expected =
|
79
|
+
expected = translate(value)
|
80
80
|
enqueue_assert_equal(expected, actual, error_msg)
|
81
81
|
when :translate_upcase
|
82
|
-
expected =
|
82
|
+
expected = translate(value)
|
83
|
+
expected = expected.is_a?(Array) ? expected.map(&:upcase) : expected.upcase
|
83
84
|
enqueue_assert_equal(expected, actual, error_msg)
|
84
85
|
when :translate_downcase
|
85
|
-
expected =
|
86
|
+
expected = translate(value)
|
87
|
+
expected = expected.is_a?(Array) ? expected.map(&:downcase) : expected.downcase
|
86
88
|
enqueue_assert_equal(expected, actual, error_msg)
|
87
89
|
when :translate_capitalize
|
88
|
-
expected =
|
90
|
+
expected = translate(value)
|
91
|
+
expected = expected.is_a?(Array) ? expected.map(&:capitalize) : expected.capitalize
|
89
92
|
enqueue_assert_equal(expected, actual, error_msg)
|
90
93
|
when :translate_titlecase
|
91
|
-
expected =
|
92
|
-
expected =
|
94
|
+
expected = translate(value)
|
95
|
+
expected = if expected.is_a?(Array)
|
96
|
+
result = []
|
97
|
+
expected.each do |item|
|
98
|
+
result.push("#{item.split.each{ |item| item.capitalize! }.join(' ')}")
|
99
|
+
end
|
100
|
+
result
|
101
|
+
else
|
102
|
+
"#{expected.split.each{ |expected| expected.capitalize! }.join(' ')}"
|
103
|
+
end
|
93
104
|
enqueue_assert_equal(expected, actual, error_msg)
|
94
105
|
end
|
95
106
|
end
|
@@ -126,6 +137,29 @@ module TestCentricity
|
|
126
137
|
screen_shot = {path: path, filename: filename}
|
127
138
|
Environ.save_screen_shot(screen_shot)
|
128
139
|
end
|
140
|
+
|
141
|
+
def self.translate(*args, **opts)
|
142
|
+
opts[:locale] ||= I18n.locale
|
143
|
+
opts[:raise] = true
|
144
|
+
I18n.translate(*args, **opts)
|
145
|
+
rescue I18n::MissingTranslationData => err
|
146
|
+
puts err
|
147
|
+
opts[:locale] = :en
|
148
|
+
|
149
|
+
# fallback to en if the translation is missing. If the translation isn't
|
150
|
+
# in en, then raise again.
|
151
|
+
disable_enforce_available_locales do
|
152
|
+
I18n.translate(*args, **opts)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
def self.disable_enforce_available_locales
|
157
|
+
saved_enforce_available_locales = I18n.enforce_available_locales
|
158
|
+
I18n.enforce_available_locales = false
|
159
|
+
yield
|
160
|
+
ensure
|
161
|
+
I18n.enforce_available_locales = saved_enforce_available_locales
|
162
|
+
end
|
129
163
|
end
|
130
164
|
|
131
165
|
|
@@ -68,7 +68,7 @@ module TestCentricity
|
|
68
68
|
|
69
69
|
unless @options_list.nil?
|
70
70
|
find_component(@options_list, 'drop menu')
|
71
|
-
raise "Could not find option #{option} to choose" unless first(:css, @list_item, minimum: 0, wait:
|
71
|
+
raise "Could not find option #{option} to choose" unless first(:css, @list_item, minimum: 0, wait: 5)
|
72
72
|
|
73
73
|
if option.is_a?(Array)
|
74
74
|
option.each do |item|
|
@@ -344,7 +344,7 @@ module TestCentricity
|
|
344
344
|
element = @base_object.find(:css, component, minimum: 0, wait: 1)
|
345
345
|
rescue
|
346
346
|
begin
|
347
|
-
element = page.find(:css, component, minimum: 0, wait:
|
347
|
+
element = page.find(:css, component, minimum: 0, wait: 5)
|
348
348
|
rescue
|
349
349
|
raise "List #{component_name} (#{component}) for selectlist named '#{@name}' (#{locator}) not found"
|
350
350
|
end
|
@@ -528,11 +528,17 @@ module TestCentricity
|
|
528
528
|
|
529
529
|
# Hover the cursor over an object
|
530
530
|
#
|
531
|
+
# @param visible [Boolean, Symbol] Only find elements with the specified visibility:
|
532
|
+
# * true - only finds visible elements.
|
533
|
+
# * false - finds invisible _and_ visible elements.
|
534
|
+
# * :all - same as false; finds visible and invisible elements.
|
535
|
+
# * :hidden - only finds invisible elements.
|
536
|
+
# * :visible - same as true; only finds visible elements.
|
531
537
|
# @example
|
532
538
|
# basket_link.hover
|
533
539
|
#
|
534
|
-
def hover
|
535
|
-
obj, type = find_element
|
540
|
+
def hover(visible = true)
|
541
|
+
obj, type = find_element(visible)
|
536
542
|
object_not_found_exception(obj, type)
|
537
543
|
obj.hover
|
538
544
|
end
|
@@ -541,11 +547,17 @@ module TestCentricity
|
|
541
547
|
#
|
542
548
|
# @param x [Integer] X offset
|
543
549
|
# @param y [Integer] Y offset
|
550
|
+
# @param visible [Boolean, Symbol] Only find elements with the specified visibility:
|
551
|
+
# * true - only finds visible elements.
|
552
|
+
# * false - finds invisible _and_ visible elements.
|
553
|
+
# * :all - same as false; finds visible and invisible elements.
|
554
|
+
# * :hidden - only finds invisible elements.
|
555
|
+
# * :visible - same as true; only finds visible elements.
|
544
556
|
# @example
|
545
557
|
# timeline_bar.hover_at(100, 5)
|
546
558
|
#
|
547
|
-
def hover_at(x, y)
|
548
|
-
obj, = find_element
|
559
|
+
def hover_at(x, y, visible = true)
|
560
|
+
obj, = find_element(visible)
|
549
561
|
raise "UI #{object_ref_message} not found" unless obj
|
550
562
|
obj.hover_at(x, y)
|
551
563
|
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.23
|
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: 2021-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|