daddy 0.3.26 → 0.3.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/daddy/cucumber/helpers/capture.rb +8 -3
- data/lib/daddy/formatter/screenshot.js +34 -14
- data/lib/daddy/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: ddcc1a299d62f5d6236c3737303b57f47fe69101
|
4
|
+
data.tar.gz: 813bf1c9f10fc4b2cf8fc221205e385c56c4df88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1edaf332c854b8ad4af1b491c2998a65e9e46392bcd0ebed7904ff6516a88e5b2b073027900052b004bb63fbe10ab970968dbd2eaf545586d8edb8e2e79689b4
|
7
|
+
data.tar.gz: 7d9cae5f76a36b40751b5062a536b8b5d40d72da35dabe649d535144c96065af19a0964734bedf95635f05ed9563b67daca8ac484d83c8e2f547fdfa65607035
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Daddy
|
2
2
|
module Cucumber
|
3
3
|
module Capture
|
4
|
-
feature_dir = '
|
4
|
+
feature_dir = 'features'
|
5
5
|
ARGV.each_with_index do |arg, i|
|
6
6
|
if arg == '-r'
|
7
7
|
feature_dir = ARGV[i + 1]
|
@@ -16,6 +16,9 @@ module Daddy
|
|
16
16
|
@@_images = []
|
17
17
|
|
18
18
|
def capture(options = {})
|
19
|
+
options ||= {}
|
20
|
+
options = {:title => options} if options.is_a?(String)
|
21
|
+
|
19
22
|
pause
|
20
23
|
return if ENV['FORMAT'] == 'junit'
|
21
24
|
|
@@ -26,10 +29,12 @@ module Daddy
|
|
26
29
|
image = "#{IMAGE_DIR}/#{@@_screen_count}.png"
|
27
30
|
page.driver.save_screenshot("#{REPORT_DIR}/#{image}", :full => true)
|
28
31
|
|
32
|
+
image_tag = "<img class=\"screenshot\" src=\"#{image}\" title=\"#{options[:title]}\" alt=\"#{url}\"/>"
|
33
|
+
|
29
34
|
if options[:flash]
|
30
|
-
puts
|
35
|
+
puts image_tag
|
31
36
|
else
|
32
|
-
@@_images <<
|
37
|
+
@@_images << image_tag
|
33
38
|
end
|
34
39
|
end
|
35
40
|
|
@@ -1,18 +1,38 @@
|
|
1
|
-
|
2
|
-
var
|
3
|
-
|
4
|
-
|
1
|
+
if (typeof daddy === "undefined") {
|
2
|
+
var daddy = {};
|
3
|
+
}
|
4
|
+
daddy.screenshot = {};
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
viewer.empty().append(clone);
|
6
|
+
daddy.screenshot.get_or_create_viewer = function() {
|
7
|
+
if (!this.viewer) {
|
8
|
+
this.viewer = $('<div id="screenshot_viewer" style="display: none;"></div>');
|
9
|
+
this.viewer.css({position: 'absolute'}).appendTo('body');
|
10
|
+
this.viewer.show_image = function(image) {
|
11
|
+
var clone= $(image).clone().removeClass('screenshot');
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
this.empty().append(clone);
|
14
|
+
this.css('left', $(window).scrollLeft());
|
15
|
+
this.css('top', $(window).scrollTop());
|
16
|
+
this.show();
|
17
|
+
};
|
18
|
+
this.viewer.close = function() {
|
19
|
+
this.hide();
|
20
|
+
};
|
21
|
+
}
|
22
|
+
|
23
|
+
return this.viewer;
|
24
|
+
};
|
25
|
+
|
26
|
+
var viewer = null;
|
27
|
+
|
28
|
+
$(document).ready(function() {
|
29
|
+
viewer = daddy.screenshot.get_or_create_viewer();
|
30
|
+
|
31
|
+
$('body').click(function(e) {
|
32
|
+
viewer.close();
|
33
|
+
if ($(e.target).hasClass('screenshot')) {
|
34
|
+
viewer.show_image(e.target);
|
35
|
+
}
|
17
36
|
});
|
37
|
+
|
18
38
|
});
|
data/lib/daddy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: daddy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.27
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ichy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|