gridium 0.1.14 → 0.1.15

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: d7f8f12e48945bbc10f2440aa12963fc0e6bf6b9
4
- data.tar.gz: 9cbbb726e13c56f5bd99c4d4adad213eff7e93e0
3
+ metadata.gz: 1c3014cfbf647be8f8784de153fe555dab6ae93c
4
+ data.tar.gz: 719e88c0e03c7b2335761c1362efaed114271683
5
5
  SHA512:
6
- metadata.gz: cb5291417e0fdfc52eefe30891677d63834043fbe65944b24d663b3d3c69b9a40131f04fab065e8d22bbef47bbcf8795a02ea320f0ea00297577b1d47efa41aa
7
- data.tar.gz: 08715dc6b3c5b902cbba1eb865da0102876db1325947f75eea853de42fcab7fa3b003b37ea2a73f884c856a5f514a2b8d4a8807614ca9c51385e73d324343ca1
6
+ metadata.gz: c4b7bc902272b95f1d264ba306390b75cadef732a5330108813d7f37b03757d15e6f21f801ac05b25fd75f9427eb07a24f7f70cb115f92a2cd446c84322ea3b3
7
+ data.tar.gz: c924c40931f400b18b049ae54787796739c09996b72825aedf9e0b06313ac8961ecd3c0af9394cf81469e715f8432de72db318a779f4bb292432248e93ef9853
data/lib/driver.rb CHANGED
@@ -240,4 +240,4 @@ class Driver
240
240
  Log.debug("Now back to Parent Frame")
241
241
  end
242
242
 
243
- end
243
+ end
data/lib/element.rb CHANGED
@@ -247,14 +247,14 @@ class Element
247
247
  def compare_element_screenshot(base_image_path)
248
248
  #Returns TRUE if there are no differences, FALSE if there are
249
249
  begin
250
- Log.debug("Doing Image Comparison...")
250
+ Log.debug("Loading Images for Comparison...")
251
251
  images = [
252
252
  ChunkyPNG::Image.from_file(base_image_path),
253
253
  ChunkyPNG::Image.from_file(@element_screenshot)
254
254
  ]
255
255
  #used to store image x,y diff
256
256
  diff = []
257
- Log.debug("Loaded Images into array...")
257
+ Log.debug("Comparing Images...")
258
258
  images.first.height.times do |y|
259
259
  images.first.row(y).each_with_index do |pixel, x|
260
260
  diff << [x,y] unless pixel == images.last[x,y]
@@ -268,6 +268,7 @@ class Element
268
268
  x, y = diff.map{|xy| xy[0]}, diff.map{|xy| xy[1]}
269
269
 
270
270
  if x.any? && y.any?
271
+ Log.debug("Differences Detected! Writing Diff Image...")
271
272
  name = self.name.gsub(' ', '_')
272
273
  #timestamp = Time.now.strftime("%Y_%m_%d__%H_%M_%S")
273
274
  element_screenshot_path = File.join($current_run_dir, "#{name}__diff_.png")
@@ -1,3 +1,3 @@
1
1
  module Gridium
2
- VERSION = "0.1.14"
2
+ VERSION = "0.1.15"
3
3
  end
data/lib/page.rb CHANGED
@@ -89,19 +89,18 @@ module Gridium
89
89
  Driver.driver.find_elements(by, locator).first
90
90
  end
91
91
 
92
- def click_link(linktext)
93
- link = Element.new("Clicking #{linktext} Link", :link_text, linktext)
94
- link.click
92
+ def click_link(link_text)
93
+ Element.new("Clicking #{link_text} Link", :link_text, link_text).click
95
94
  end
96
95
 
97
96
  def click_button(button_name)
98
97
  #The button maybe a link that looks like a button - we want to handle both
99
- button = Element.new("A #{button_name} button", :xpath, "//button[contains(text(), '#{button_name}')]")
98
+ button = Element.new("A #{button_name} button", :xpath, "//button[contains(., '#{button_name}')]")
100
99
  begin
101
100
  button.click
102
101
  rescue Exception => e
103
102
  Log.debug("Button not found - Attempting Link - speed up test by using click_link method if this works...")
104
- link = Element.new("A #{button_name} link", :xpath, "//a[contains(text(), '#{button_name}')]")
103
+ link = Element.new("A #{button_name} link", :xpath, "//a[contains(., '#{button_name}')]")
105
104
  link.click
106
105
  end
107
106
  end
@@ -110,4 +109,4 @@ module Gridium
110
109
  Driver.driver.find_element(:id, id).click
111
110
  end
112
111
  end
113
- end
112
+ 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.14
4
+ version: 0.1.15
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-03-28 00:00:00.000000000 Z
11
+ date: 2016-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler