likadan 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/likadan_runner.rb +4 -1
- data/lib/public/likadan-runner.js +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df8ec3d54bd3fc9f9fa37fac5efbd69c26b4b223
|
4
|
+
data.tar.gz: aa754753cfc9fef241c026f7142a00598f540964
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd7be6c3cd2b2d443949464a27f69b9b3347b5b47b33c32eb6cf7c5179412fb1ad7051d42f86d0335600faec8bd2b38ac61ecbcd2a5a2feb13c4e3d90949e880
|
7
|
+
data.tar.gz: 0df70f6aa8be4e7b81ecf65c7e74e12923403cc983f58f8a3d6cc217c7890151bc44b27f77fad15290822dcdda7e35e32a4864a410a80cd8d4856bf2fcc0598f
|
data/lib/likadan_runner.rb
CHANGED
@@ -38,7 +38,10 @@ begin
|
|
38
38
|
# Save and crop the screenshot
|
39
39
|
driver.save_screenshot(output_file)
|
40
40
|
cropped = ChunkyPNG::Image.from_file(output_file)
|
41
|
-
cropped.crop!(
|
41
|
+
cropped.crop!(rendered['left'],
|
42
|
+
rendered['top'],
|
43
|
+
rendered['width'],
|
44
|
+
rendered['height'])
|
42
45
|
cropped.save(output_file)
|
43
46
|
|
44
47
|
print "Checking \"#{current['name']}\" at #{width}px... "
|
@@ -66,15 +66,21 @@ window.likadan = {
|
|
66
66
|
|
67
67
|
var width = elem.offsetWidth;
|
68
68
|
var height = elem.offsetHeight;
|
69
|
+
var top = elem.offsetTop;
|
70
|
+
var left = elem.offsetLeft;
|
69
71
|
|
70
72
|
if (this.currentExample.options.snapshotEntireScreen) {
|
71
73
|
width = window.innerWidth;
|
72
74
|
height = window.innerHeight;
|
75
|
+
top = 0;
|
76
|
+
left = 0;
|
73
77
|
}
|
74
78
|
return {
|
75
79
|
name: this.currentExample.name,
|
76
80
|
width: width,
|
77
81
|
height: height,
|
82
|
+
top: top,
|
83
|
+
left: left
|
78
84
|
};
|
79
85
|
} catch (error) {
|
80
86
|
console.error(error);
|