testcentricity_web 0.7.2 → 0.7.3
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/lib/testcentricity_web/elements/checkbox.rb +2 -0
- data/lib/testcentricity_web/elements/radio.rb +2 -0
- data/lib/testcentricity_web/environment.rb +9 -0
- data/lib/testcentricity_web/page_sections_helper.rb +7 -2
- data/lib/testcentricity_web/ui_elements_helper.rb +9 -3
- data/lib/testcentricity_web/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01d450e7584fcada45507bcce94357d5c48f45ce
|
4
|
+
data.tar.gz: 62a0b88fb18e18d844feea66ce248f823653b18f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d85d7810484d82aecfbe9b495f7351f06638e2403659c1edb69c1abfea809c60295ddd6343e93398654fcd58e2807ca934751cc13ed262401b30a346cd514ce7
|
7
|
+
data.tar.gz: 003943bb68ef0f2c79c2b4076ec64c51ddac31cf13ea64d7e08b48aed973666fddb5f7100758993a09241fdf14a4b30478ff20dc61baefde1b1a9a26758a8ad4
|
@@ -16,6 +16,7 @@ module TestCentricity
|
|
16
16
|
# remember_me_checkbox.checked?
|
17
17
|
#
|
18
18
|
def checked?
|
19
|
+
Capybara.ignore_hidden_elements = false
|
19
20
|
obj, _ = find_element
|
20
21
|
object_not_found_exception(obj, 'Checkbox')
|
21
22
|
obj.checked?
|
@@ -28,6 +29,7 @@ module TestCentricity
|
|
28
29
|
# remember_me_checkbox.set_checkbox_state(true)
|
29
30
|
#
|
30
31
|
def set_checkbox_state(state)
|
32
|
+
Capybara.ignore_hidden_elements = false
|
31
33
|
obj, _ = find_element
|
32
34
|
object_not_found_exception(obj, 'Checkbox')
|
33
35
|
invalid_object_type_exception(obj, 'checkbox')
|
@@ -16,6 +16,7 @@ module TestCentricity
|
|
16
16
|
# accept_terms_radio.selected?
|
17
17
|
#
|
18
18
|
def selected?
|
19
|
+
Capybara.ignore_hidden_elements = false
|
19
20
|
obj, _ = find_element
|
20
21
|
object_not_found_exception(obj, 'Radio')
|
21
22
|
obj.checked?
|
@@ -28,6 +29,7 @@ module TestCentricity
|
|
28
29
|
# accept_terms_radio.set_selected_state(true)
|
29
30
|
#
|
30
31
|
def set_selected_state(state)
|
32
|
+
Capybara.ignore_hidden_elements = false
|
31
33
|
obj, _ = find_element
|
32
34
|
object_not_found_exception(obj, 'Radio')
|
33
35
|
invalid_object_type_exception(obj, 'radio')
|
@@ -25,6 +25,7 @@ module TestCentricity
|
|
25
25
|
attr_accessor :platform
|
26
26
|
attr_accessor :signed_in
|
27
27
|
attr_accessor :portal_status
|
28
|
+
attr_accessor :external_page
|
28
29
|
|
29
30
|
attr_reader :protocol
|
30
31
|
attr_reader :hostname
|
@@ -119,6 +120,14 @@ module TestCentricity
|
|
119
120
|
@portal_status
|
120
121
|
end
|
121
122
|
|
123
|
+
def self.set_external_page(state)
|
124
|
+
@external_page = state
|
125
|
+
end
|
126
|
+
|
127
|
+
def self.external_page
|
128
|
+
@external_page
|
129
|
+
end
|
130
|
+
|
122
131
|
def self.save_screen_shot(screen_shot)
|
123
132
|
@screen_shots.push(screen_shot)
|
124
133
|
end
|
@@ -170,7 +170,7 @@ module TestCentricity
|
|
170
170
|
|
171
171
|
def get_locator
|
172
172
|
(@locator.empty? && defined?(section_locator)) ? locator = section_locator : locator = @locator
|
173
|
-
(@context == :section && !@parent.nil? && !@parent.get_locator.nil?) ? "#{@parent.get_locator}
|
173
|
+
(@context == :section && !@parent.nil? && !@parent.get_locator.nil?) ? "#{@parent.get_locator}|#{locator}" : locator
|
174
174
|
end
|
175
175
|
|
176
176
|
def set_parent(parent)
|
@@ -349,7 +349,12 @@ module TestCentricity
|
|
349
349
|
tries ||= 2
|
350
350
|
attributes = [:id, :xpath, :css]
|
351
351
|
type = attributes[tries]
|
352
|
-
|
352
|
+
case type
|
353
|
+
when :css
|
354
|
+
locator = locator.gsub("|", " ")
|
355
|
+
when :xpath
|
356
|
+
locator = locator.gsub("|//", "//")
|
357
|
+
end
|
353
358
|
obj = page.find(type, locator)
|
354
359
|
[obj, type]
|
355
360
|
rescue
|
@@ -290,14 +290,19 @@ module TestCentricity
|
|
290
290
|
|
291
291
|
def find_object
|
292
292
|
@alt_locator.nil? ? locator = @locator : locator = @alt_locator
|
293
|
-
locator = "#{@parent.get_locator}
|
293
|
+
locator = "#{@parent.get_locator}|#{locator}" if @context == :section && !@parent.get_locator.nil?
|
294
294
|
saved_wait_time = Capybara.default_max_wait_time
|
295
295
|
Capybara.default_max_wait_time = 0.01
|
296
296
|
tries ||= 2
|
297
297
|
attributes = [:id, :xpath, :css]
|
298
298
|
type = attributes[tries]
|
299
|
-
|
300
|
-
|
299
|
+
case type
|
300
|
+
when :css
|
301
|
+
locator = locator.gsub("|", " ")
|
302
|
+
when :xpath
|
303
|
+
locator = locator.gsub("|//", "//")
|
304
|
+
end
|
305
|
+
obj = page.find(type, locator)
|
301
306
|
[obj, type]
|
302
307
|
rescue
|
303
308
|
Capybara.default_max_wait_time = saved_wait_time
|
@@ -305,6 +310,7 @@ module TestCentricity
|
|
305
310
|
[nil, nil]
|
306
311
|
ensure
|
307
312
|
Capybara.default_max_wait_time = saved_wait_time
|
313
|
+
Capybara.ignore_hidden_elements = true
|
308
314
|
end
|
309
315
|
|
310
316
|
def object_not_found_exception(obj, obj_type)
|
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.
|
4
|
+
version: 0.7.3
|
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-
|
11
|
+
date: 2016-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|