sapphire 0.7.5 → 0.7.6
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.
- data/lib/sapphire/DSL/Scenarios/{Problematic.rb → Broken.rb} +3 -3
- data/lib/sapphire/DSL/Scenarios/background.rb +2 -2
- data/lib/sapphire/DSL/Scenarios/finally.rb +2 -2
- data/lib/sapphire/DSL/Scenarios/given.rb +4 -4
- data/lib/sapphire/DSL/Scenarios/scenario.rb +4 -4
- data/lib/sapphire/DSL/Scenarios/then.rb +2 -2
- data/lib/sapphire/DSL/Scenarios/when.rb +4 -4
- data/lib/sapphire/TeamCity/TeamCityReporter.rb +2 -2
- data/lib/sapphire/Testing/ConsoleReporter.rb +7 -8
- data/lib/sapphire/Testing/Executable.rb +3 -3
- data/lib/sapphire/Testing/HtmlReporter.rb +4 -4
- data/lib/sapphire/Testing/Reporter.rb +1 -1
- data/lib/sapphire/WebAbstractions/Controls/TextArea.rb +4 -1
- data/lib/sapphire/WebAbstractions/Controls/TextBox.rb +4 -1
- data/lib/sapphire/version.rb +1 -1
- metadata +9 -9
@@ -26,8 +26,8 @@ class Background
|
|
26
26
|
def add_and(pre, text, &block)
|
27
27
|
if(self.value.is_a? Pending)
|
28
28
|
self.and << And.new(self, Pending.new(pre + text), &block)
|
29
|
-
elsif(self.value.is_a?
|
30
|
-
self.and << And.new(self,
|
29
|
+
elsif(self.value.is_a? Broken)
|
30
|
+
self.and << And.new(self, Broken.new(pre + text), &block)
|
31
31
|
else
|
32
32
|
self.and << And.new(self, pre + text, &block)
|
33
33
|
end
|
@@ -20,8 +20,8 @@ class Finally
|
|
20
20
|
def add_and(pre, text, &block)
|
21
21
|
if(self.value.is_a? Pending)
|
22
22
|
self.and << And.new(self, Pending.new(pre + text), &block)
|
23
|
-
elsif(self.value.is_a?
|
24
|
-
self.and << And.new(self,
|
23
|
+
elsif(self.value.is_a? Broken)
|
24
|
+
self.and << And.new(self, Broken.new(pre + text), &block)
|
25
25
|
else
|
26
26
|
self.and << And.new(self, pre + text, &block)
|
27
27
|
end
|
@@ -23,8 +23,8 @@ class Given
|
|
23
23
|
def add_when(pre, text, &block)
|
24
24
|
if(self.value.is_a? Pending)
|
25
25
|
@when << When.new(self, pre, Pending.new(text.to_s), &block)
|
26
|
-
elsif(self.value.is_a?
|
27
|
-
@when << When.new(self, pre,
|
26
|
+
elsif(self.value.is_a? Broken)
|
27
|
+
@when << When.new(self, pre, Broken.new(text), &block)
|
28
28
|
else
|
29
29
|
x = When.new(self, pre, text, &block)
|
30
30
|
@when << x
|
@@ -42,8 +42,8 @@ class Given
|
|
42
42
|
def add_and(pre, text, &block)
|
43
43
|
if(self.value.is_a? Pending or text.is_a? Pending)
|
44
44
|
self.and << And.new(self, Pending.new(pre + text.to_s), &block)
|
45
|
-
elsif(self.value.is_a?
|
46
|
-
self.and << And.new(self,
|
45
|
+
elsif(self.value.is_a? Broken)
|
46
|
+
self.and << And.new(self, Broken.new(pre + text.to_s), &block)
|
47
47
|
else
|
48
48
|
self.and << And.new(self, pre + text.to_s, &block)
|
49
49
|
end
|
@@ -25,8 +25,8 @@ module Sapphire
|
|
25
25
|
def add_given(given)
|
26
26
|
if(self.value.is_a? Pending)
|
27
27
|
@givens << Given.new(self, "", Pending.new(given.text), &block)
|
28
|
-
elsif(self.value.is_a?
|
29
|
-
@givens << Given.new(self, "",
|
28
|
+
elsif(self.value.is_a? Broken)
|
29
|
+
@givens << Given.new(self, "", Broken.new(given.text), &block)
|
30
30
|
else
|
31
31
|
@givens << given
|
32
32
|
end
|
@@ -39,8 +39,8 @@ module Sapphire
|
|
39
39
|
def add_background(background)
|
40
40
|
if(self.value.is_a? Pending)
|
41
41
|
@backgrounds << Background.new(self, "", Pending.new(background.text), &block)
|
42
|
-
elsif(self.value.is_a?
|
43
|
-
@backgrounds << Background.new(self, "",
|
42
|
+
elsif(self.value.is_a? Broken)
|
43
|
+
@backgrounds << Background.new(self, "", Broken.new(background.text), &block)
|
44
44
|
else
|
45
45
|
@backgrounds << background
|
46
46
|
end
|
@@ -20,8 +20,8 @@ class Then
|
|
20
20
|
def add_and(pre, text, &block)
|
21
21
|
if(self.value.instance_of? Pending or text.is_a? Pending)
|
22
22
|
self.and << And.new(self, Pending.new(pre + text.to_s), &block)
|
23
|
-
elsif(self.value.instance_of?
|
24
|
-
self.and << And.new(self,
|
23
|
+
elsif(self.value.instance_of? Broken)
|
24
|
+
self.and << And.new(self, Broken.new(pre + text), &block)
|
25
25
|
else
|
26
26
|
x = And.new(self, pre + text.to_s, &block)
|
27
27
|
self.and << x
|
@@ -22,8 +22,8 @@ class When
|
|
22
22
|
def add_then(pre, text, &block)
|
23
23
|
if(self.value.is_a? Pending or text.is_a? Pending)
|
24
24
|
@then << Then.new(self, pre, Pending.new(text.to_s), &block)
|
25
|
-
elsif(self.value.is_a?
|
26
|
-
@then << Then.new(self, pre,
|
25
|
+
elsif(self.value.is_a? Broken)
|
26
|
+
@then << Then.new(self, pre, Broken.new(text), &block)
|
27
27
|
else
|
28
28
|
@then << Then.new(self, pre, text, &block)
|
29
29
|
end
|
@@ -32,8 +32,8 @@ class When
|
|
32
32
|
def add_and(pre, text, &block)
|
33
33
|
if(self.value.is_a? Pending or text.is_a? Pending)
|
34
34
|
self.and << And.new(self, Pending.new(pre + text.to_s), &block)
|
35
|
-
elsif(self.value.is_a?
|
36
|
-
self.and << And.new(self,
|
35
|
+
elsif(self.value.is_a? Broken)
|
36
|
+
self.and << And.new(self, Broken.new(pre + text), &block)
|
37
37
|
else
|
38
38
|
self.and << And.new(self, pre + text.to_s, &block)
|
39
39
|
end
|
@@ -150,8 +150,8 @@ module Sapphire
|
|
150
150
|
log(@message_factory.create_suite_finished("Finally")) if test.item.is_a? Finally
|
151
151
|
end
|
152
152
|
|
153
|
-
def
|
154
|
-
log(@message_factory.create_test_ignored(test.text, "
|
153
|
+
def TestBroken(test)
|
154
|
+
log(@message_factory.create_test_ignored(test.text, "Broken"))
|
155
155
|
log(@message_factory.create_suite_finished("Finally")) if test.item.is_a? Finally
|
156
156
|
end
|
157
157
|
|
@@ -7,7 +7,7 @@ module Sapphire
|
|
7
7
|
@passing_count = 0
|
8
8
|
@failing_count = 0
|
9
9
|
@pending_count = 0
|
10
|
-
@
|
10
|
+
@broken_count = 0
|
11
11
|
@test_count = 0
|
12
12
|
@output = $stdout
|
13
13
|
end
|
@@ -35,10 +35,10 @@ module Sapphire
|
|
35
35
|
@output.puts result.text
|
36
36
|
Indent(depth+1)
|
37
37
|
@output.puts " ## Not Yet Implemented ##"
|
38
|
-
elsif result.type == '
|
38
|
+
elsif result.type == 'broken'
|
39
39
|
@output.puts result.text
|
40
40
|
Indent(depth+1)
|
41
|
-
@output.puts " ##
|
41
|
+
@output.puts " ## Broken ##"
|
42
42
|
else
|
43
43
|
@output.puts result.text
|
44
44
|
if result.messages.is_a? Array
|
@@ -87,11 +87,10 @@ module Sapphire
|
|
87
87
|
@output.print "*"
|
88
88
|
end
|
89
89
|
|
90
|
-
def
|
91
|
-
@
|
90
|
+
def TestBroken(test)
|
91
|
+
@broken_count = @broken_count + 1
|
92
92
|
Add test
|
93
|
-
|
94
|
-
@output.print "\u0CA0_\u0CA0"
|
93
|
+
@output.print "B"
|
95
94
|
end
|
96
95
|
|
97
96
|
def Add(r)
|
@@ -127,7 +126,7 @@ module Sapphire
|
|
127
126
|
@output.puts "Passing: " + @passing_count.to_s
|
128
127
|
@output.puts "Failing: " + @failing_count.to_s
|
129
128
|
@output.puts "Pending: " + @pending_count.to_s
|
130
|
-
@output.puts "
|
129
|
+
@output.puts "Broken: " + @broken_count.to_s
|
131
130
|
end
|
132
131
|
|
133
132
|
def Output(result, depth)
|
@@ -29,10 +29,10 @@ module Sapphire
|
|
29
29
|
stack = msg.backtrace
|
30
30
|
message = msg.messages if (msg.is_a? ExpectationException)
|
31
31
|
message ||= msg.message
|
32
|
-
if(self.value.is_a?
|
33
|
-
result = ResultTree.new(self.text, TestResult.new("
|
32
|
+
if(self.value.is_a? Broken)
|
33
|
+
result = ResultTree.new(self.text, TestResult.new("broken", self, message, stack, Time.now - start))
|
34
34
|
self.AddResult(result)
|
35
|
-
Report do |x| x.
|
35
|
+
Report do |x| x.TestBroken(result) end
|
36
36
|
else
|
37
37
|
result = ResultTree.new(self.text, TestResult.new("fail", self, message, stack, Time.now - start))
|
38
38
|
self.AddResult(result)
|
@@ -8,7 +8,7 @@ module Sapphire
|
|
8
8
|
@passing_count = 0
|
9
9
|
@failing_count = 0
|
10
10
|
@pending_count = 0
|
11
|
-
@
|
11
|
+
@broken_count = 0
|
12
12
|
@test_count = 0
|
13
13
|
@output = $stdout
|
14
14
|
end
|
@@ -59,10 +59,10 @@ module Sapphire
|
|
59
59
|
@output.puts " <dd class=\"spec not_implemented\"><span class=\"not_implemented_spec_name\">#{test.text} (PENDING: ### Not Yet Implemented ###)</span></dd>"
|
60
60
|
end
|
61
61
|
|
62
|
-
def
|
62
|
+
def TestBroken(test)
|
63
63
|
@output.puts " <script type=\"text/javascript\">makeOrange('rspec-header');</script>" unless @header_red
|
64
64
|
@output.puts " <script type=\"text/javascript\">makeOrange('example_group_#{@example_group_number}');</script>" unless @example_group_red
|
65
|
-
@output.puts " <dd class=\"spec not_implemented\"><span class=\"not_implemented_spec_name\">#{test.text} (
|
65
|
+
@output.puts " <dd class=\"spec not_implemented\"><span class=\"not_implemented_spec_name\">#{test.text} (BROKEN: ### Broken ###)</span></dd>"
|
66
66
|
end
|
67
67
|
|
68
68
|
def TestingComplete
|
@@ -70,7 +70,7 @@ module Sapphire
|
|
70
70
|
|
71
71
|
totals = "#{@test_count} example#{'s' unless @test_count == 1}, #{@failure_count} failure#{'s' unless @failure_count == 1}"
|
72
72
|
totals << ", #{@pending_count} pending" if @pending_count > 0
|
73
|
-
totals << ", #{@
|
73
|
+
totals << ", #{@broken_count} broken" if @broken_count > 0
|
74
74
|
|
75
75
|
@output.puts "<script type=\"text/javascript\">document.getElementById('duration').innerHTML = \"Finished in <strong>#{(@end - @start).round(2).to_s} seconds</strong>\";</script>"
|
76
76
|
@output.puts "<script type=\"text/javascript\">document.getElementById('totals').innerHTML = \"#{totals}\";</script>"
|
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.6
|
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-02 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: selenium-webdriver
|
16
|
-
requirement: &
|
16
|
+
requirement: &9795012 !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: *9795012
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: colorize
|
27
|
-
requirement: &
|
27
|
+
requirement: &9794760 !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: *9794760
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: Platform
|
38
|
-
requirement: &
|
38
|
+
requirement: &9794508 !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: *9794508
|
47
47
|
description: An automated web acceptance test framework for non-technical resources
|
48
48
|
using selenium-wedriver.
|
49
49
|
email:
|
@@ -137,12 +137,12 @@ files:
|
|
137
137
|
- lib/sapphire/DSL/Events/Expect.rb
|
138
138
|
- lib/sapphire/DSL/Scenarios/and.rb
|
139
139
|
- lib/sapphire/DSL/Scenarios/background.rb
|
140
|
+
- lib/sapphire/DSL/Scenarios/Broken.rb
|
140
141
|
- lib/sapphire/DSL/Scenarios/dsl.rb
|
141
142
|
- lib/sapphire/DSL/Scenarios/finally.rb
|
142
143
|
- lib/sapphire/DSL/Scenarios/given.rb
|
143
144
|
- lib/sapphire/DSL/Scenarios/Is.rb
|
144
145
|
- lib/sapphire/DSL/Scenarios/Pending.rb
|
145
|
-
- lib/sapphire/DSL/Scenarios/Problematic.rb
|
146
146
|
- lib/sapphire/DSL/Scenarios/runner.rb
|
147
147
|
- lib/sapphire/DSL/Scenarios/scenario.rb
|
148
148
|
- lib/sapphire/DSL/Scenarios/then.rb
|