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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca2c840a2915ee8a73b3e71a429a5831df4be9d4
4
- data.tar.gz: dcde135b0b82021b115e17acc2da9972fc39b861
3
+ metadata.gz: 6a4ace6541c078b40a55d84eb1ef8c0f8c34403f
4
+ data.tar.gz: 83c330abf2bb40c311526ae630f766972427ec9e
5
5
  SHA512:
6
- metadata.gz: 6a56945c2a5e4b52af23582b269e4f558bf578bfda1055c4939b6295ae2a126a6393f8932e437cc2c7c5c075c20cf391bc49ea8f19a320b4a4a487c84ea3abd2
7
- data.tar.gz: da16047fdec1576ba805bb173f9ec815c6378e10391277b13dfc682bff42fcc2dd64aa941f1fbf59525d8d4dc44eb3d19b07a0c5b4487c5904aff5ee5c827af6
6
+ metadata.gz: 774ed7c45f415438d230277edbc9626677397c82f10dffccadfa895adaf5c3251ee7190ec7bfae21ab869b17c668ccfbd903444522b35955c664da0f16710acc
7
+ data.tar.gz: 73703b59def639a997649ba78ce4685275cd439b13ca96a14943cd95244dce1f339bfd02495bc7e8cd23b989a12e907b54e72782172efe196fee25cbfe53b8a2
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in gridium.gemspec
4
4
  gemspec
5
+
6
+ gem 'rspec-mocks'
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
- 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
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 current_domain.include?(given_url)
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
- element.attribute("value")
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
 
@@ -1,3 +1,3 @@
1
1
  module Gridium
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.11"
3
3
  end
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.10
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-07 00:00:00.000000000 Z
11
+ date: 2016-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler