testcentricity_web 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6b46d8e4ce4c479595b40af6e05228921c7f8cfd
4
- data.tar.gz: 38929c566789d3ca56d6ea8b2ce523601c6367da
3
+ metadata.gz: 01d450e7584fcada45507bcce94357d5c48f45ce
4
+ data.tar.gz: 62a0b88fb18e18d844feea66ce248f823653b18f
5
5
  SHA512:
6
- metadata.gz: befd23db564f85e8e74fbc774f02bb949d3a47a232abfbc68991495e2fbc95287a9254a6668a21eee913b793a03595de7fe54f0d7ac8d541d615e3aecc22d7d5
7
- data.tar.gz: a664cfbc24afa3e2814fb59c8898be38f5914141d56a3d21f4c48753d3f693748c1cd20f2d5b05231ab79ebae073e62b0523eaf04da486a28059f6920f8d3b6b
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} #{locator}" : 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
- locator = locator.gsub(" //", "//") if type == :xpath
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} #{locator}" if @context == :section && !@parent.get_locator.nil?
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
- locator = locator.gsub(" //", "//") if type == :xpath
300
- obj = page.find(type, locator, :visible => false)
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)
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '0.7.2'
2
+ VERSION = '0.7.3'
3
3
  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: 0.7.2
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-10 00:00:00.000000000 Z
11
+ date: 2016-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler