sapphire 0.7.9 → 0.7.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sapphire/DSL/Browser/Make.rb +10 -0
- data/lib/sapphire/Testing/HtmlReporter.rb +23 -8
- data/lib/sapphire/version.rb +1 -1
- metadata +9 -8
@@ -23,9 +23,24 @@ module Sapphire
|
|
23
23
|
|
24
24
|
end
|
25
25
|
|
26
|
+
def Indent(test)
|
27
|
+
indentation = ""
|
28
|
+
|
29
|
+
count = 0
|
30
|
+
|
31
|
+
count = 1 if test.item.is_a? When or (test.item.is_a? And and test.parent.item.is_a? When)
|
32
|
+
count = 2 if test.item.is_a? Then or (test.item.is_a? And and test.parent.item.is_a? Then)
|
33
|
+
|
34
|
+
count.times do
|
35
|
+
indentation << "<span> </span>"
|
36
|
+
end
|
37
|
+
|
38
|
+
indentation
|
39
|
+
end
|
40
|
+
|
26
41
|
def TestPassed(test)
|
27
42
|
@passing_count = @passing_count + 1
|
28
|
-
@output.puts " <dd class=\"spec passed\"><span class=\"passed_spec_name\">#{test.text}</span></dd>"
|
43
|
+
@output.puts " <dd class=\"spec passed\"><span class=\"passed_spec_name\">#{Indent(test) + test.text}</span></dd>"
|
29
44
|
end
|
30
45
|
|
31
46
|
def TestFailed(test)
|
@@ -36,22 +51,22 @@ module Sapphire
|
|
36
51
|
@output.puts " <script type=\"text/javascript\">makeRed('example_group_#{@example_group_number}');</script>" unless @example_group_red
|
37
52
|
@example_group_red = true
|
38
53
|
@output.puts " <dd class=\"spec #{failure_style}\">"
|
39
|
-
@output.puts " <span class=\"failed_spec_name\">#{test.text}</span>"
|
54
|
+
@output.puts " <span class=\"failed_spec_name\">#{Indent(test) + test.text}</span>"
|
40
55
|
@output.puts " <div class=\"failure\" id=\"failure_#{@test_count}\">"
|
41
56
|
|
42
57
|
if test.messages.is_a? Array
|
43
58
|
message_block = ""
|
44
59
|
test.messages.each do |message|
|
45
|
-
message_block += message + "<br>"
|
60
|
+
message_block += Indent(test) + message + "<br>"
|
46
61
|
end
|
47
62
|
@output.puts " <div class=\"message\"><pre>#{message_block}</pre></div>"
|
48
63
|
else
|
49
|
-
@output.puts " <div class=\"message\"><pre>#{test.messages}</pre></div>"
|
64
|
+
@output.puts " <div class=\"message\"><pre>#{Indent(test) + test.messages}</pre></div>"
|
50
65
|
end
|
51
66
|
|
52
67
|
test.stack.each do |line|
|
53
68
|
if (!line.include? "sapphire")
|
54
|
-
@output.puts " <div class=\"backtrace\"><pre>#{line}</pre></div>"
|
69
|
+
@output.puts " <div class=\"backtrace\"><pre>#{Indent(test) + line}</pre></div>"
|
55
70
|
end
|
56
71
|
end
|
57
72
|
|
@@ -59,7 +74,7 @@ module Sapphire
|
|
59
74
|
content << "<span>"
|
60
75
|
|
61
76
|
file_name = save_screenshot
|
62
|
-
content << link_for(file_name)
|
77
|
+
content << Indent(test) + link_for(file_name)
|
63
78
|
|
64
79
|
content << "</span>"
|
65
80
|
@output.puts content
|
@@ -70,13 +85,13 @@ module Sapphire
|
|
70
85
|
def TestPending(test)
|
71
86
|
@output.puts " <script type=\"text/javascript\">makeYellow('rspec-header');</script>" unless @header_red
|
72
87
|
@output.puts " <script type=\"text/javascript\">makeYellow('example_group_#{@example_group_number}');</script>" unless @example_group_red
|
73
|
-
@output.puts " <dd class=\"spec not_implemented\"><span class=\"not_implemented_spec_name\">#{test.text} (PENDING: ### Not Yet Implemented ###)</span></dd>"
|
88
|
+
@output.puts " <dd class=\"spec not_implemented\"><span class=\"not_implemented_spec_name\">#{Indent(test) + test.text} (PENDING: ### Not Yet Implemented ###)</span></dd>"
|
74
89
|
end
|
75
90
|
|
76
91
|
def TestBroken(test)
|
77
92
|
@output.puts " <script type=\"text/javascript\">makeOrange('rspec-header');</script>" unless @header_red
|
78
93
|
@output.puts " <script type=\"text/javascript\">makeOrange('example_group_#{@example_group_number}');</script>" unless @example_group_red
|
79
|
-
@output.puts " <dd class=\"spec not_implemented\"><span class=\"not_implemented_spec_name\">#{test.text} (BROKEN: ### Broken ###)</span></dd>"
|
94
|
+
@output.puts " <dd class=\"spec not_implemented\"><span class=\"not_implemented_spec_name\">#{Indent(test) + test.text} (BROKEN: ### Broken ###)</span></dd>"
|
80
95
|
end
|
81
96
|
|
82
97
|
def TestingComplete
|
data/lib/sapphire/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sapphire
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-
|
12
|
+
date: 2012-03-15 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: selenium-webdriver
|
16
|
-
requirement: &
|
16
|
+
requirement: &9818676 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *9818676
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: colorize
|
27
|
-
requirement: &
|
27
|
+
requirement: &9818424 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *9818424
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: Platform
|
38
|
-
requirement: &
|
38
|
+
requirement: &9818172 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *9818172
|
47
47
|
description: An automated web acceptance test framework for non-technical resources
|
48
48
|
using selenium-wedriver.
|
49
49
|
email:
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- lib/sapphire/DSL/Browser/Fluff/To.rb
|
71
71
|
- lib/sapphire/DSL/Browser/Fluff/With.rb
|
72
72
|
- lib/sapphire/DSL/Browser/For.rb
|
73
|
+
- lib/sapphire/DSL/Browser/Make.rb
|
73
74
|
- lib/sapphire/DSL/Browser/Nouns/Browser.rb
|
74
75
|
- lib/sapphire/DSL/Browser/Nouns/Day.rb
|
75
76
|
- lib/sapphire/DSL/Browser/Nouns/Enter.rb
|