gridium 0.1.8 → 0.1.9
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.
- checksums.yaml +4 -4
- data/lib/driver.rb +5 -0
- data/lib/element.rb +9 -7
- data/lib/gridium/version.rb +1 -1
- 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: e3d14191f23e8336ab424696936b964b43485a95
|
4
|
+
data.tar.gz: 859a4c45c037a0e32a3920ff9c720915fca9c766
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f553ef4803f2180ddee37f52c7d03da2e8863e0bb1007e38f8a6ef5a42b314c294d3dde450e84cb6d4d6c69b3d162a7ccff822cfe95d50b057e406692f8bdb2e
|
7
|
+
data.tar.gz: 4eb5a1135950c93af2d8df86b86c9cf597aa0f87d8d300ac313a159568b984ca6e861acb173bc304e298d3cd814433311933e9d4e1b6b673e9853beefa71db7b
|
data/lib/driver.rb
CHANGED
@@ -30,6 +30,11 @@ class Driver
|
|
30
30
|
##Adding support for remote browsers
|
31
31
|
if Gridium.config.browser_source == :remote
|
32
32
|
@@driver = Selenium::WebDriver.for(:remote, url: Gridium.config.target_environment, desired_capabilities: Gridium.config.browser)
|
33
|
+
#this file detector is only used for remote drivers and is needed to upload files from test_host through Grid to browser
|
34
|
+
@@driver.file_detector = lambda do |args|
|
35
|
+
str = args.first.to_s
|
36
|
+
str if File.exist?(str)
|
37
|
+
end
|
33
38
|
else
|
34
39
|
@@driver = Selenium::WebDriver.for(Gridium.config.browser)
|
35
40
|
end
|
data/lib/element.rb
CHANGED
@@ -43,18 +43,20 @@ class Element
|
|
43
43
|
#Found an issue where the element would go stale after it's found
|
44
44
|
begin
|
45
45
|
elements = @driver.find_elements(@by, @locator)
|
46
|
-
##there's a chance here the element is found but not displayed.
|
47
46
|
elements.each do |element|
|
48
|
-
if element.displayed?
|
49
|
-
found_element = element;
|
47
|
+
if element.displayed? #removed check for element.enabled
|
48
|
+
found_element = element; #this will always return the last displayed element
|
50
49
|
end
|
51
50
|
end
|
52
51
|
rescue Exception => e
|
53
|
-
|
54
|
-
|
52
|
+
if found_element
|
53
|
+
Log.warn("An element was found, but it was not displayed on the page. Gridium.config.visible_elements_only set to: #{Gridium.config.visible_elements_only} Element: #{self.to_s}")
|
54
|
+
else
|
55
|
+
Log.warn("Could not find Element: #{self.to_s}")
|
56
|
+
end
|
55
57
|
end
|
56
58
|
|
57
|
-
|
59
|
+
found_element
|
58
60
|
end
|
59
61
|
|
60
62
|
# ================ #
|
@@ -96,7 +98,7 @@ class Element
|
|
96
98
|
end
|
97
99
|
|
98
100
|
def enabled?
|
99
|
-
|
101
|
+
element.enabled?
|
100
102
|
end
|
101
103
|
|
102
104
|
def clear
|
data/lib/gridium/version.rb
CHANGED
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.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Urban
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|