gridium 1.1.20 → 1.1.21

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/page.rb +18 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4aca24b0651f872bf562fd3ed0c942b87e642294
4
- data.tar.gz: 42f21919a492043b5d6b7795625f4c2413c7aa94
3
+ metadata.gz: 0e2118b3117399136ea6fbdb3ae202f33d8264ff
4
+ data.tar.gz: f64e6404d9eab2f565e47597d9d6a2e4e4f9d130
5
5
  SHA512:
6
- metadata.gz: 6ef11a4aed69775333bfa1d8fc4fa6bfde6b40c7d34a8df3b6638543890fc7be12c40f9907a4a07e2f0c28d4130efc3c0dd9dbbfc31cdc44de2d24974e74fd1f
7
- data.tar.gz: eae99ef9001f83128cf01ea69c49c885c5a46cad358a69e8c0568c03d8caacd6345d84518934c1c191682ff87ecc5a3d950b2999caadd280b14341bfa9bb9cc3
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, options={})
22
- wait = Selenium::WebDriver::Wait.new(:timeout => 5)
21
+ def self.has_css?(css, opts = {})
22
+ timeout = opts[:timeout] || 5
23
+ wait = Selenium::WebDriver::Wait.new(:timeout => timeout)
23
24
  begin
24
- wait.until {Driver.driver.find_element(:css, css).enabled?}
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, options={})
32
- wait = Selenium::WebDriver::Wait.new(:timeout => 5)
37
+ def self.has_xpath?(xpath, opts = {})
38
+ timeout = opts[:timeout] || 5
39
+ wait = Selenium::WebDriver::Wait.new(:timeout => timeout)
33
40
  begin
34
- wait.until {Driver.driver.find_element(:xpath, xpath).enabled?}
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.20
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-25 00:00:00.000000000 Z
11
+ date: 2017-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler