acceptance_test 1.7.12 → 1.7.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGES +4 -0
- data/lib/acceptance_test/screenshot_maker.rb +29 -9
- data/lib/acceptance_test/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjI3YTg0NzY4YjYwMjY0YTUzZTEwOTU1MjQ2ZDk5NjBhYTU4ZTliMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjgwMGM3YjcxYTM2YzgxY2YxZDEyMWVjYzA4MDJmZWJhNTdlYWZmNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzliYmI5M2UwMjFhOTZhZDkzNzlkNGY5ZWUzYmFhMWE1MGY4ODhjZDgyZDU2
|
10
|
+
MzIxZmNlMTdjOWZhZDc0M2JiYjIxZTYwNDdlNGZkMzlmMjk2MTE2ZTNhMTdj
|
11
|
+
ZWE2ZjVlYWQ0M2I4OTY5NDVkZGUyNWU5ZDc3MGE5YjQ1NGFmMmI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NjNiYjVlYjQzZGM5MWFkNjhiMjAyNjFmMTUzM2RmM2UzOTNmY2QxMGE0Nzkz
|
14
|
+
MWE3NzQxYTdiY2RhNGFmYjIxZjAxYWE0ZDI2ZmI0Yzg2YmEwYTU4MDg2YmQx
|
15
|
+
MjMyNzU5Mzg5Y2MzNmUyN2QwODBlNThlYmM5OGQ0MzNmMmYwMGY=
|
data/CHANGES
CHANGED
@@ -6,25 +6,23 @@ class ScreenshotMaker
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def make page, options
|
9
|
-
|
9
|
+
file_path = options[:file_path]
|
10
|
+
|
11
|
+
name = screenshot_name(build_name(file_path), options[:line_number])
|
10
12
|
path = File.expand_path("#{basedir}/#{name}")
|
11
13
|
|
12
14
|
page.save_screenshot(path)
|
13
15
|
end
|
14
16
|
|
15
|
-
def screenshot_name filename, line_number=nil
|
16
|
-
"#{filename}#{line_number ? '-'+line_number : ''}.png"
|
17
|
-
end
|
18
|
-
|
19
17
|
def screenshot_url options
|
20
18
|
file_path = options[:file_path]
|
21
19
|
|
22
|
-
if
|
23
|
-
name = screenshot_name(
|
20
|
+
if options[:screenshot_url_base]
|
21
|
+
name = screenshot_name(build_name(file_path), options[:line_number])
|
24
22
|
|
25
|
-
"#{
|
23
|
+
"#{options[:screenshot_url_base]}/#{name}"
|
26
24
|
else
|
27
|
-
name = screenshot_name(
|
25
|
+
name = screenshot_name(build_name(file_path), options[:line_number])
|
28
26
|
|
29
27
|
path = File.expand_path("#{basedir}/#{name}")
|
30
28
|
|
@@ -32,4 +30,26 @@ class ScreenshotMaker
|
|
32
30
|
end
|
33
31
|
end
|
34
32
|
|
33
|
+
private
|
34
|
+
|
35
|
+
def screenshot_name name, line_number=nil
|
36
|
+
"#{name}#{line_number ? '-'+line_number.to_s : ''}.png"
|
37
|
+
end
|
38
|
+
|
39
|
+
def build_name path
|
40
|
+
full_path = File.expand_path(path)
|
41
|
+
extension = File.extname(path)
|
42
|
+
|
43
|
+
index1 = full_path.index("/spec")
|
44
|
+
index2 = full_path.index(extension)
|
45
|
+
|
46
|
+
name = full_path[index1+1..index2-1].gsub("/", "_")
|
47
|
+
|
48
|
+
name = name[5..-1] if name =~ /^spec_/
|
49
|
+
name = name[9..-1] if name =~ /^features_/
|
50
|
+
name = name[11..-1] if name =~ /^acceptance_/
|
51
|
+
|
52
|
+
name
|
53
|
+
end
|
54
|
+
|
35
55
|
end
|