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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4edaaa4fcef2bdc3bbc2f414b813069f26ffcda
|
4
|
+
data.tar.gz: aa80ace49bf4cf496510969d29bf1742f7aa3ae1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
294
|
-
|
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
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
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
|
|