tellurium_driver 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.
- data/lib/tellurium_driver.rb +7 -4
- metadata +1 -1
data/lib/tellurium_driver.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
#Provides added functionality to Selenium WebDriver
|
2
2
|
class TelluriumDriver
|
3
|
-
|
3
|
+
class << self
|
4
|
+
attr_accessor :wait_for_document_ready
|
5
|
+
end
|
6
|
+
|
4
7
|
#takes browser name, browser version, hub ip(optional)
|
5
8
|
def self.before(names)
|
6
9
|
names.each do |name|
|
@@ -21,7 +24,7 @@ class TelluriumDriver
|
|
21
24
|
browser, version,hub_ip,timeout = args
|
22
25
|
timeout = 120 unless timeout
|
23
26
|
@wait = Selenium::WebDriver::Wait.new(:timeout=>timeout)
|
24
|
-
|
27
|
+
TelluriumDriver.wait_for_document_ready=true;
|
25
28
|
|
26
29
|
is_local = version.include?("local") if version
|
27
30
|
is_ie = browser.include?("internet") && version
|
@@ -55,9 +58,9 @@ class TelluriumDriver
|
|
55
58
|
end
|
56
59
|
|
57
60
|
|
58
|
-
TelluriumDriver.before(TelluriumDriver.instance_methods.reject { |name| name.to_s.include?("initialize")
|
61
|
+
TelluriumDriver.before(TelluriumDriver.instance_methods.reject { |name| name.to_s.include?("initialize")}) do
|
59
62
|
begin
|
60
|
-
if(
|
63
|
+
if(TelluriumDriver.wait_for_document_ready)
|
61
64
|
wait = Selenium::WebDriver::Wait.new(:timeout=>120)
|
62
65
|
wait.until{ self.driver.execute_script("document.readyState") == "complete" }
|
63
66
|
end
|