gridium 0.1.15 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gridium/version.rb +1 -1
  3. data/lib/page.rb +18 -4
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c3014cfbf647be8f8784de153fe555dab6ae93c
4
- data.tar.gz: 719e88c0e03c7b2335761c1362efaed114271683
3
+ metadata.gz: bf7d9d1bcac31e36fda6bef78eaaaf9f833886cd
4
+ data.tar.gz: 9045c4caafa09133659f4ec8825dcc264436928e
5
5
  SHA512:
6
- metadata.gz: c4b7bc902272b95f1d264ba306390b75cadef732a5330108813d7f37b03757d15e6f21f801ac05b25fd75f9427eb07a24f7f70cb115f92a2cd446c84322ea3b3
7
- data.tar.gz: c924c40931f400b18b049ae54787796739c09996b72825aedf9e0b06313ac8961ecd3c0af9394cf81469e715f8432de72db318a779f4bb292432248e93ef9853
6
+ metadata.gz: d85c4eafeca504f387795108e992e4f8d44c9605f3f03729c48c9c3dc49c54fd1a5641ac38d322d2b8f4f0195e69bb8dd05b234b62c8216fb52494fcd6927385
7
+ data.tar.gz: f4fd979c9da4b62c497c8a001451bf1a6dc9c8ba8ab205f4bfd615ad74432fd74ccd4f97fbc56ef5bdf223aea38554e2a3287712a412a9e20b93324f61656aed
@@ -1,3 +1,3 @@
1
1
  module Gridium
2
- VERSION = "0.1.15"
2
+ VERSION = "0.1.16"
3
3
  end
data/lib/page.rb CHANGED
@@ -22,7 +22,7 @@ module Gridium
22
22
  wait = Selenium::WebDriver::Wait.new(:timeout => 5)
23
23
  begin
24
24
  wait.until {Driver.driver.find_element(:css, css).enabled?}
25
- rescue Exception => e
25
+ rescue Exception
26
26
  return false
27
27
  end
28
28
  end
@@ -31,7 +31,7 @@ module Gridium
31
31
  wait = Selenium::WebDriver::Wait.new(:timeout => 5)
32
32
  begin
33
33
  wait.until {Driver.driver.find_element(:xpath, xpath).enabled?}
34
- rescue Exception => e
34
+ rescue Exception
35
35
  return false
36
36
  end
37
37
  end
@@ -40,7 +40,7 @@ module Gridium
40
40
  wait = Selenium::WebDriver::Wait.new(:timeout => 5)
41
41
  begin
42
42
  wait.until {Driver.driver.find_element(:link_text, linktext).enabled?}
43
- rescue Exception => e
43
+ rescue Exception
44
44
  return false
45
45
  end
46
46
  end
@@ -77,6 +77,20 @@ module Gridium
77
77
  Driver.execute_script_driver(script)
78
78
  end
79
79
 
80
+ def self.evaluate_script(script)
81
+ Driver.evaluate_script script
82
+ end
83
+
84
+ def self.wait_for_ajax
85
+ Timeout.timeout(Gridium.config.page_load_timeout) do
86
+ loop until jquery_loaded?
87
+ end
88
+ end
89
+
90
+ def self.jquery_loaded?
91
+ self.evaluate_script("jQuery.active").zero?
92
+ end
93
+
80
94
  def all(by, locator)
81
95
  Driver.driver.find_elements(by, locator)
82
96
  end
@@ -98,7 +112,7 @@ module Gridium
98
112
  button = Element.new("A #{button_name} button", :xpath, "//button[contains(., '#{button_name}')]")
99
113
  begin
100
114
  button.click
101
- rescue Exception => e
115
+ rescue Exception
102
116
  Log.debug("Button not found - Attempting Link - speed up test by using click_link method if this works...")
103
117
  link = Element.new("A #{button_name} link", :xpath, "//a[contains(., '#{button_name}')]")
104
118
  link.click
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: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Urban
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-20 00:00:00.000000000 Z
11
+ date: 2016-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler