gridium 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/lib/driver.rb +12 -11
- data/lib/element.rb +3 -1
- 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: 6a4ace6541c078b40a55d84eb1ef8c0f8c34403f
|
4
|
+
data.tar.gz: 83c330abf2bb40c311526ae630f766972427ec9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 774ed7c45f415438d230277edbc9626677397c82f10dffccadfa895adaf5c3251ee7190ec7bfae21ab869b17c668ccfbd903444522b35955c664da0f16710acc
|
7
|
+
data.tar.gz: 73703b59def639a997649ba78ce4685275cd439b13ca96a14943cd95244dce1f339bfd02495bc7e8cd23b989a12e907b54e72782172efe196fee25cbfe53b8a2
|
data/Gemfile
CHANGED
data/lib/driver.rb
CHANGED
@@ -2,7 +2,6 @@ require 'selenium-webdriver'
|
|
2
2
|
require 'uri'
|
3
3
|
require 'spec_data'
|
4
4
|
|
5
|
-
|
6
5
|
class Driver
|
7
6
|
@@driver = nil
|
8
7
|
|
@@ -60,14 +59,16 @@ class Driver
|
|
60
59
|
|
61
60
|
def self.visit(path)
|
62
61
|
begin
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
62
|
+
if path
|
63
|
+
Log.debug("Navigating to url: (#{path}).")
|
64
|
+
driver
|
65
|
+
time_start = Time.now
|
66
|
+
driver.navigate.to(path)
|
67
|
+
time_end = Time.new
|
68
|
+
page_load = (time_end - time_start)
|
69
|
+
Log.debug("Page loaded in (#{page_load}) seconds.")
|
70
|
+
$verification_passes += 1
|
71
|
+
end
|
71
72
|
rescue Exception => e
|
72
73
|
Log.debug(e.backtrace.inspect)
|
73
74
|
Log.error("#{e.message} - Also be sure to check the url formatting. http:// is required for proper test execution (www is optional).")
|
@@ -128,12 +129,11 @@ class Driver
|
|
128
129
|
Log.debug('Verifying URL...')
|
129
130
|
current_url = self.current_url.to_s
|
130
131
|
current_domain = self.current_domain.to_s
|
131
|
-
if
|
132
|
+
if current_url.include?(given_url)
|
132
133
|
Log.debug("Confirmed. (#{current_url}) includes (#{given_url}).")
|
133
134
|
$verification_passes += 1
|
134
135
|
else
|
135
136
|
Log.error("(#{current_url}) does not include (#{given_url}).")
|
136
|
-
Kernel.fail
|
137
137
|
end
|
138
138
|
end
|
139
139
|
|
@@ -147,6 +147,7 @@ class Driver
|
|
147
147
|
#
|
148
148
|
def self.execute_script(script, element)
|
149
149
|
if element.is_a?(Element)
|
150
|
+
#we dont care if Gridium.config.visible_elements_only is set to true or not
|
150
151
|
ele = driver.find_element(element.by, element.locator)
|
151
152
|
driver.execute_script(script, ele)
|
152
153
|
else
|
data/lib/element.rb
CHANGED
@@ -180,7 +180,8 @@ class Element
|
|
180
180
|
end
|
181
181
|
|
182
182
|
def text
|
183
|
-
|
183
|
+
#this is used for text based elements
|
184
|
+
element.text
|
184
185
|
end
|
185
186
|
|
186
187
|
def text=(text)
|
@@ -189,6 +190,7 @@ class Element
|
|
189
190
|
end
|
190
191
|
|
191
192
|
def value
|
193
|
+
#this is used for inputs and forms
|
192
194
|
element.attribute("value")
|
193
195
|
end
|
194
196
|
|
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.11
|
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-01-
|
11
|
+
date: 2016-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|