testcentricity_web 0.7.3 → 0.7.4

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: 01d450e7584fcada45507bcce94357d5c48f45ce
4
- data.tar.gz: 62a0b88fb18e18d844feea66ce248f823653b18f
3
+ metadata.gz: d4edaaa4fcef2bdc3bbc2f414b813069f26ffcda
4
+ data.tar.gz: aa80ace49bf4cf496510969d29bf1742f7aa3ae1
5
5
  SHA512:
6
- metadata.gz: d85d7810484d82aecfbe9b495f7351f06638e2403659c1edb69c1abfea809c60295ddd6343e93398654fcd58e2807ca934751cc13ed262401b30a346cd514ce7
7
- data.tar.gz: 003943bb68ef0f2c79c2b4076ec64c51ddac31cf13ea64d7e08b48aed973666fddb5f7100758993a09241fdf14a4b30478ff20dc61baefde1b1a9a26758a8ad4
6
+ metadata.gz: 648db7efaf75de5d614f30486536567322a4491454ade71185bf39a070ef5ab85a77015f60729bde54e1954e67941a5b8299cdf7dffb6f55f85d384454b344ec
7
+ data.tar.gz: 53201ce9d75df3a32fa301963a0ab83049e9c096691c4bd2173f87a997170e23049ce273a846a05c92066e0921e359411e688a431277c68d1bd31b9ef1ab2886
@@ -338,31 +338,21 @@ module TestCentricity
338
338
  private
339
339
 
340
340
  def find_section
341
- wait = Selenium::WebDriver::Wait.new(timeout: Capybara.default_max_wait_time)
342
- wait.until { find_object }
343
- end
344
-
345
- def find_object
346
341
  locator = get_locator
347
- saved_wait_time = Capybara.default_max_wait_time
348
- Capybara.default_max_wait_time = 0.1
349
342
  tries ||= 2
350
343
  attributes = [:id, :xpath, :css]
351
344
  type = attributes[tries]
352
345
  case type
353
346
  when :css
354
- locator = locator.gsub("|", " ")
347
+ locator = locator.gsub('|', ' ')
355
348
  when :xpath
356
- locator = locator.gsub("|//", "//")
349
+ locator = locator.gsub('|', '')
357
350
  end
358
- obj = page.find(type, locator)
351
+ obj = page.find(type, locator, :wait => 0.1)
359
352
  [obj, type]
360
353
  rescue
361
- Capybara.default_max_wait_time = saved_wait_time
362
354
  retry if (tries -= 1) > 0
363
355
  [nil, nil]
364
- ensure
365
- Capybara.default_max_wait_time = saved_wait_time
366
356
  end
367
357
  end
368
358
  end
@@ -290,26 +290,30 @@ 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?
294
- saved_wait_time = Capybara.default_max_wait_time
295
- Capybara.default_max_wait_time = 0.01
296
- tries ||= 2
297
- attributes = [:id, :xpath, :css]
293
+ tries ||= 3
294
+ attributes = [:name, :id, :xpath, :css]
298
295
  type = attributes[tries]
299
- case type
300
- when :css
301
- locator = locator.gsub("|", " ")
302
- when :xpath
303
- locator = locator.gsub("|//", "//")
296
+ if @context == :section && !@parent.get_locator.nil?
297
+ parent_locator = @parent.get_locator
298
+ case type
299
+ when :css
300
+ parent_locator = parent_locator.gsub('|', ' ')
301
+ obj = page.find(:css, parent_locator, :wait => 0.01).find(:css, locator, :wait => 0.01)
302
+ when :xpath
303
+ parent_locator = parent_locator.gsub('|', '')
304
+ obj = page.find(:xpath, "#{parent_locator}#{locator}", :wait => 0.01)
305
+ when :id
306
+ parent_locator = parent_locator.gsub('|', ' ')
307
+ obj = page.find(:css, parent_locator, :wait => 0.01).find(:xpath, locator, :wait => 0.01)
308
+ end
309
+ else
310
+ obj = page.find(type, locator, :wait => 0.01)
304
311
  end
305
- obj = page.find(type, locator)
306
312
  [obj, type]
307
313
  rescue
308
- Capybara.default_max_wait_time = saved_wait_time
309
314
  retry if (tries -= 1) > 0
310
315
  [nil, nil]
311
316
  ensure
312
- Capybara.default_max_wait_time = saved_wait_time
313
317
  Capybara.ignore_hidden_elements = true
314
318
  end
315
319
 
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '0.7.3'
2
+ VERSION = '0.7.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testcentricity_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - A.J. Mrozinski