gridium 1.1.20 → 1.1.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/page.rb +18 -6
- 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: 0e2118b3117399136ea6fbdb3ae202f33d8264ff
|
4
|
+
data.tar.gz: f64e6404d9eab2f565e47597d9d6a2e4e4f9d130
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63ab9be1812891e80a842cd03fb245fa4be76039878d93ae0319198ee80964edd19dba8b9f9e9542674a18d52c60167a1a0e89943221f5d7a8bba3ffa0865e8a
|
7
|
+
data.tar.gz: 0c8821f9ca4855d725e1a0bd50e4656d89c2eff6a68b0fb78271e25b9501d319e184d9a092d0f39c3a5aebfa218b96afd9b6338f57c341149bc4279403ed633f
|
data/lib/page.rb
CHANGED
@@ -18,20 +18,32 @@ module Gridium
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
def self.has_css?(css,
|
22
|
-
|
21
|
+
def self.has_css?(css, opts = {})
|
22
|
+
timeout = opts[:timeout] || 5
|
23
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => timeout)
|
23
24
|
begin
|
24
|
-
|
25
|
+
element = Driver.driver.find_element :css, css
|
26
|
+
if opts[:visible]
|
27
|
+
wait.until {element.displayed?}
|
28
|
+
else
|
29
|
+
wait.until {element.enabled?}
|
30
|
+
end
|
25
31
|
rescue Exception => exception
|
26
32
|
Log.debug("[GRIDIUM::Page] has_css? is false because this exception was rescued: #{exception}")
|
27
33
|
return false
|
28
34
|
end
|
29
35
|
end
|
30
36
|
|
31
|
-
def self.has_xpath?(xpath,
|
32
|
-
|
37
|
+
def self.has_xpath?(xpath, opts = {})
|
38
|
+
timeout = opts[:timeout] || 5
|
39
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => timeout)
|
33
40
|
begin
|
34
|
-
|
41
|
+
element = Driver.driver.find_element :xpath, xpath
|
42
|
+
if opts[:visible]
|
43
|
+
wait.until {element.displayed?}
|
44
|
+
else
|
45
|
+
wait.until {element.enabled?}
|
46
|
+
end
|
35
47
|
rescue Exception => exception
|
36
48
|
Log.debug("[GRIDIUM::Page] has_xpath? is false because this exception was rescued: #{exception}")
|
37
49
|
return false
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gridium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Urban
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|