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 +4 -4
- data/lib/driver.rb +1 -1
- data/lib/element.rb +3 -2
- data/lib/gridium/version.rb +1 -1
- data/lib/page.rb +5 -6
- 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: 1c3014cfbf647be8f8784de153fe555dab6ae93c
|
4
|
+
data.tar.gz: 719e88c0e03c7b2335761c1362efaed114271683
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4b7bc902272b95f1d264ba306390b75cadef732a5330108813d7f37b03757d15e6f21f801ac05b25fd75f9427eb07a24f7f70cb115f92a2cd446c84322ea3b3
|
7
|
+
data.tar.gz: c924c40931f400b18b049ae54787796739c09996b72825aedf9e0b06313ac8961ecd3c0af9394cf81469e715f8432de72db318a779f4bb292432248e93ef9853
|
data/lib/driver.rb
CHANGED
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("
|
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("
|
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")
|
data/lib/gridium/version.rb
CHANGED
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(
|
93
|
-
|
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(
|
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(
|
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.
|
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-
|
11
|
+
date: 2016-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|