sapphire 0.7.22 → 0.7.23

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,172 @@
1
+ require 'teamcity/utils/logger_util'
2
+ require 'teamcity/rake_exceptions'
3
+ require 'teamcity/rakerunner_consts'
4
+
5
+ SPEC_FORMATTER_LOG = ::Rake::TeamCity::Utils::RakeFileLogger.new
6
+ SPEC_FORMATTER_LOG.log_msg("spec formatter.rb loaded.")
7
+
8
+ require 'teamcity/runner_common'
9
+ require 'teamcity/utils/service_message_factory'
10
+ require 'teamcity/utils/std_capture_helper'
11
+ require 'teamcity/utils/runner_utils'
12
+ require 'teamcity/utils/url_formatter'
13
+
14
+ module Sapphire
15
+ module Testing
16
+ module TeamCity
17
+ class RubyMineReporter < Reporter
18
+ include ::Rake::TeamCity::StdCaptureHelper
19
+ include ::Rake::TeamCity::RunnerUtils
20
+ include ::Rake::TeamCity::RunnerCommon
21
+ include ::Rake::TeamCity::Utils::UrlFormatter
22
+
23
+ TEAMCITY_FORMATTER_INTERNAL_ERRORS =[]
24
+ @@reporter_closed = false
25
+ @@RUNNING_EXAMPLES_STORAGE = {}
26
+
27
+ ########## Teamcity #############################
28
+
29
+ def log(msg)
30
+ send_msg(msg)
31
+
32
+ # returns:
33
+ msg
34
+ end
35
+
36
+ def self.closed?()
37
+ @@reporter_closed
38
+ end
39
+
40
+ def self.close()
41
+ @@reporter_closed = true
42
+ end
43
+
44
+ ########## Teamcity #############################
45
+
46
+ def initialize()
47
+ # Setups Test runner's MessageFactory
48
+ set_message_factory(::Rake::TeamCity::MessageFactory)
49
+
50
+ # Initializes
51
+ @groups_stack = []
52
+
53
+ if ::Rake::TeamCity.is_in_idea_mode
54
+ #log(@message_factory.create_tests_count(@example_count))
55
+ elsif ::Rake::TeamCity.is_in_buildserver_mode
56
+ log(@message_factory.create_progress_message("Starting..."))
57
+ end
58
+
59
+ @current = 0
60
+ end
61
+
62
+ def PrintItem(result, depth)
63
+
64
+ end
65
+
66
+ def ScenarioStart(scenario)
67
+ log(@message_factory.create_suite_started("Scenario: " + scenario.text))
68
+ end
69
+
70
+ def ScenarioComplete(scenario)
71
+ log(@message_factory.create_suite_finished("Finally"))
72
+ log(@message_factory.create_suite_finished("Assuming"))
73
+ log(@message_factory.create_suite_finished("Scenario: " + scenario.text))
74
+ end
75
+
76
+ def PrintHeader()
77
+
78
+ end
79
+
80
+ def PrintFooter()
81
+
82
+ end
83
+
84
+ def InsertLineBreak()
85
+
86
+ end
87
+
88
+ def PrePrint
89
+
90
+ end
91
+
92
+ def PostPrint
93
+
94
+ end
95
+
96
+ def TestStarted(test)
97
+
98
+ if test.is_a? Given and @current > 0
99
+ log(@message_factory.create_suite_finished("Then"))
100
+ log(@message_factory.create_suite_finished("When"))
101
+ log(@message_factory.create_suite_finished("Given"))
102
+ elsif test.is_a? Finally
103
+ log(@message_factory.create_suite_finished("Then"))
104
+ log(@message_factory.create_suite_finished("When"))
105
+ log(@message_factory.create_suite_finished("Given"))
106
+ end
107
+
108
+ @current = 1
109
+
110
+ if test.is_a? Given
111
+ log(@message_factory.create_suite_started("Given"))
112
+ elsif test.is_a? When
113
+ log(@message_factory.create_suite_started("When"))
114
+ elsif test.is_a? Then
115
+ log(@message_factory.create_suite_started("Then"))
116
+ elsif test.is_a? Background
117
+ log(@message_factory.create_suite_started("Assuming"))
118
+ elsif test.is_a? Finally
119
+ log(@message_factory.create_suite_started("Finally"))
120
+ end
121
+
122
+ @current = @current + 1
123
+
124
+ log(@message_factory.create_test_started(test.text))
125
+ end
126
+
127
+ def TestPassed(test)
128
+ log(@message_factory.create_test_finished(test.text, test.time))
129
+ log(@message_factory.create_suite_finished("Finally")) if test.item.is_a? Finally
130
+ end
131
+
132
+ def TestFailed(test)
133
+ if test.messages.is_a? Array
134
+ messages = test.messages.join("\n")
135
+ else
136
+ messages = test.messages
137
+ end
138
+ stack = ""
139
+ test.stack.each do |line|
140
+ if (!line.include? "sapphire")
141
+ stack += line + "\n"
142
+ end
143
+ end
144
+ log(@message_factory.create_test_failed(test.text, messages, stack))
145
+ log(@message_factory.create_suite_finished("Finally")) if test.item.is_a? Finally
146
+ end
147
+
148
+ def TestPending(test)
149
+ log(@message_factory.create_test_ignored(test.text, "Pending: Not Yet Implemented"))
150
+ log(@message_factory.create_suite_finished("Finally")) if test.item.is_a? Finally
151
+ end
152
+
153
+ def TestBroken(test)
154
+ log(@message_factory.create_test_ignored(test.text, "Broken"))
155
+ log(@message_factory.create_suite_finished("Finally")) if test.item.is_a? Finally
156
+ end
157
+
158
+ def TestingComplete()
159
+
160
+ end
161
+
162
+ def BeginTesting
163
+ log(@message_factory.create_test_reported_attached)
164
+ end
165
+
166
+ def OutputResults()
167
+
168
+ end
169
+ end
170
+ end
171
+ end
172
+ end
@@ -68,8 +68,6 @@ module Sapphire
68
68
  end
69
69
 
70
70
  def ScenarioComplete(scenario)
71
- log(@message_factory.create_suite_finished("Finally"))
72
- log(@message_factory.create_suite_finished("Assuming"))
73
71
  log(@message_factory.create_suite_finished("Scenario: " + scenario.text))
74
72
  end
75
73
 
@@ -94,39 +92,11 @@ module Sapphire
94
92
  end
95
93
 
96
94
  def TestStarted(test)
97
-
98
- if test.is_a? Given and @current > 0
99
- log(@message_factory.create_suite_finished("Then"))
100
- log(@message_factory.create_suite_finished("When"))
101
- log(@message_factory.create_suite_finished("Given"))
102
- elsif test.is_a? Finally
103
- log(@message_factory.create_suite_finished("Then"))
104
- log(@message_factory.create_suite_finished("When"))
105
- log(@message_factory.create_suite_finished("Given"))
106
- end
107
-
108
- @current = 1
109
-
110
- if test.is_a? Given
111
- log(@message_factory.create_suite_started("Given"))
112
- elsif test.is_a? When
113
- log(@message_factory.create_suite_started("When"))
114
- elsif test.is_a? Then
115
- log(@message_factory.create_suite_started("Then"))
116
- elsif test.is_a? Background
117
- log(@message_factory.create_suite_started("Assuming"))
118
- elsif test.is_a? Finally
119
- log(@message_factory.create_suite_started("Finally"))
120
- end
121
-
122
- @current = @current + 1
123
-
124
95
  log(@message_factory.create_test_started(test.text))
125
96
  end
126
97
 
127
98
  def TestPassed(test)
128
99
  log(@message_factory.create_test_finished(test.text, test.time))
129
- log(@message_factory.create_suite_finished("Finally")) if test.item.is_a? Finally
130
100
  end
131
101
 
132
102
  def TestFailed(test)
@@ -137,22 +107,19 @@ module Sapphire
137
107
  end
138
108
  stack = ""
139
109
  test.stack.each do |line|
140
- #if (!line.include? "sapphire")
110
+ if (!line.include? "sapphire")
141
111
  stack += line + "\n"
142
- #end
112
+ end
143
113
  end
144
114
  log(@message_factory.create_test_failed(test.text, messages, stack))
145
- log(@message_factory.create_suite_finished("Finally")) if test.item.is_a? Finally
146
115
  end
147
116
 
148
117
  def TestPending(test)
149
118
  log(@message_factory.create_test_ignored(test.text, "Pending: Not Yet Implemented"))
150
- log(@message_factory.create_suite_finished("Finally")) if test.item.is_a? Finally
151
119
  end
152
120
 
153
121
  def TestBroken(test)
154
122
  log(@message_factory.create_test_ignored(test.text, "Broken"))
155
- log(@message_factory.create_suite_finished("Finally")) if test.item.is_a? Finally
156
123
  end
157
124
 
158
125
  def TestingComplete()
@@ -1,3 +1,3 @@
1
1
  module Sapphire
2
- VERSION = "0.7.22"
2
+ VERSION = "0.7.23"
3
3
  end
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.22
4
+ version: 0.7.23
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-04-10 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver
16
- requirement: &9789756 !ruby/object:Gem::Requirement
16
+ requirement: &9937332 !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: *9789756
24
+ version_requirements: *9937332
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: colorize
27
- requirement: &9789504 !ruby/object:Gem::Requirement
27
+ requirement: &9937080 !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: *9789504
35
+ version_requirements: *9937080
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: Platform
38
- requirement: &9789252 !ruby/object:Gem::Requirement
38
+ requirement: &9936828 !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: *9789252
46
+ version_requirements: *9936828
47
47
  description: An automated web acceptance test framework for non-technical resources
48
48
  using selenium-wedriver.
49
49
  email:
@@ -169,6 +169,7 @@ files:
169
169
  - lib/sapphire/Extensions/Symbol.rb
170
170
  - lib/sapphire/Extensions.rb
171
171
  - lib/sapphire/JobAbstractions/Job.rb
172
+ - lib/sapphire/TeamCity/RubyMineReporter.rb
172
173
  - lib/sapphire/TeamCity/TeamCityReporter.rb
173
174
  - lib/sapphire/TeamCity.rb
174
175
  - lib/sapphire/Testing/ConsoleReporter.rb