soda 1.1.19 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -67,6 +67,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
67
67
  <filefield>
68
68
  <accessor_attributes>
69
69
  <accessor type="string">set</accessor>
70
+ <accessor type="boolean">assertPage</accessor>
70
71
  </accessor_attributes>
71
72
  </filefield>
72
73
 
@@ -87,6 +88,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
87
88
  <accessor type="string">url</accessor>
88
89
  <accessor type="string">send_keys</accessor>
89
90
  <accessor type="boolean">assertPage</accessor>
91
+ <accessor type="boolean">exist</accessor>
90
92
  </soda_attributes>
91
93
  </browser>
92
94
 
@@ -462,6 +464,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
462
464
  <accessor type="integer">timeout</accessor>
463
465
  <accessor type="boolean">required</accessor>
464
466
  <accessor type="boolean">disabled</accessor>
467
+ <accessor type="boolean">assertPage</accessor>
465
468
  </soda_attributes>
466
469
  </checkbox>
467
470
 
@@ -152,16 +152,16 @@ def SodaFireFox.KillProcessWindows()
152
152
  end
153
153
 
154
154
  if (firefox.length < 1)
155
- $curSoda.rep.log("No firefox processes to kill, browser closed clean.\n")
155
+ print "(*)No firefox processes to kill, browser closed clean.\n"
156
156
  end
157
157
 
158
158
  firefox.each do |hash|
159
159
  begin
160
- $curSoda.rep.log("Killing Process ID: #{hash['pid']}, Name:"+
161
- "#{hash['name']}\n")
160
+ print "Killing Process ID: #{hash['pid']}, Name:"+
161
+ "#{hash['name']}\n"
162
162
  Process.kill("KILL", hash['pid'])
163
163
  rescue Exception => e
164
- $curSoda.rep.ReportException(e, true, false)
164
+ print "(!)Exception : #{e.message}\n"
165
165
  result = -1
166
166
  end
167
167
  end
@@ -210,16 +210,16 @@ def SodaFireFox.KillProcessUnix()
210
210
  end
211
211
 
212
212
  if (firefox.length < 1)
213
- $curSoda.rep.log("No firefox processes to kill, browser closed clean.\n")
213
+ print "No firefox processes to kill, browser closed clean.\n"
214
214
  end
215
215
 
216
216
  firefox.each do |hash|
217
217
  begin
218
- $curSoda.rep.log("Killing Process ID: #{hash['pid']}, Name:"+
219
- "#{hash['name']}\n")
218
+ print "Killing Process ID: #{hash['pid']}, Name:"+
219
+ "#{hash['name']}\n"
220
220
  Process.kill("KILL", hash['pid'])
221
221
  rescue Exception => e
222
- $curSoda.rep.ReportException(e, true, false)
222
+ print "(!)Exception: #{e.message}!\n"
223
223
  result = -1
224
224
  end
225
225
  end
@@ -49,30 +49,30 @@ class SodaReporter
49
49
  :assertFails_count, :exception_count, :test_skip_count,
50
50
  :test_blocked_count, :test_watchdog_count
51
51
 
52
- def initialize(testfile, savehtml = false, resultsdir = nil, debug = 0,
52
+ def initialize(testfile, savehtml = false, resultsdir = nil, debug = 0,
53
53
  callback = nil, rerun = false)
54
- @sodatest_file = testfile
54
+ @sodatest_file = testfile
55
55
  @saveHtmlFiles = savehtml
56
56
  @debug = debug
57
57
  @start_time = nil
58
58
  @end_time = nil
59
59
  @js_error_count = 0
60
60
  @css_error_count = 0
61
- @asserts_count = 0
62
- @assertFails_count = 0
63
- @exception_count = 0
61
+ @asserts_count = 0
62
+ @assertFails_count = 0
63
+ @exception_count = 0
64
64
  @test_count = 0
65
65
  @test_skip_count = 0
66
- @test_blocked_count = 0
67
- @test_failed_count = 0
68
- @test_passed_count = 0
69
- @test_watchdog_count = 0
70
- @test_warning_count = 0
71
- @test_total_count = 0
72
- @fatals = 0
73
- @total = 0
66
+ @test_blocked_count = 0
67
+ @test_failed_count = 0
68
+ @test_passed_count = 0
69
+ @test_watchdog_count = 0
70
+ @test_warning_count = 0
71
+ @test_total_count = 0
72
+ @fatals = 0
73
+ @total = 0
74
74
  @failureCount = 0
75
- @savedPages = 0
75
+ @savedPages = 0
76
76
  @ResultsDir = "#{Dir.pwd}"
77
77
  @path = nil
78
78
  @htmllog_filename = nil
@@ -91,7 +91,7 @@ class SodaReporter
91
91
 
92
92
  SodaUtils.PrintSoda("Debugging: => #{debug}\n")
93
93
  SodaUtils.PrintSoda("Soda Test File: => #{@sodatest_file}\n")
94
- base_testfile_name = File.basename(@sodatest_file, '.xml')
94
+ base_testfile_name = File.basename(@sodatest_file, '.xml')
95
95
 
96
96
  if (rerun)
97
97
  base_testfile_name << "-SodaRerun"
@@ -106,7 +106,7 @@ class SodaReporter
106
106
  FileUtils.mkdir_p(@ResultsDir)
107
107
  @path = "#{@ResultsDir}/#{base_testfile_name}"
108
108
 
109
- if (File.exist?("#{@path}.tmp") || File.exist?("#{@path}.log") )
109
+ if (File.exist?("#{@path}.log"))
110
110
  t = Time.now()
111
111
  t = t.strftime("%Y%m%d%H%M%S")
112
112
  base_testfile_name << "-#{t}"
@@ -114,22 +114,22 @@ class SodaReporter
114
114
  end
115
115
 
116
116
  if (@path =~ /sugarinit/i)
117
- @log_filename = "#{@path}-#{hostname}.tmp"
117
+ @log_filename = "#{@path}-#{hostname}.log"
118
118
  @htmllog_filename = "#{@ResultsDir}/Report-#{base_testfile_name}"+
119
119
  "-#{hostname}.html"
120
120
  else
121
121
  @htmllog_filename = "#{@ResultsDir}/Report-#{base_testfile_name}.html"
122
- @log_filename = "#{@path}.tmp"
122
+ @log_filename = "#{@path}.log"
123
123
  end
124
124
 
125
- @logfile = File.new(@log_filename, 'w+')
125
+ @logfile = File.new(@log_filename, 'w+')
126
126
  @logfile.sync = true # force buffers to write to disk asap! #
127
127
  SodaUtils.PrintSoda("Created log file: => #{@log_filename}\n")
128
128
  log("[New Test]\n")
129
129
  log("Starting soda test: #{@sodatest_file}\n")
130
130
  log("Saving HTML files => #{@saveHtmlFiles.to_s()}.\n")
131
131
  @start_time = Time.now().strftime("%m/%d/%Y-%H:%M:%S")
132
- end
132
+ end
133
133
 
134
134
  ###############################################################################
135
135
  # GetRawResults -- Method
@@ -203,18 +203,18 @@ class SodaReporter
203
203
 
204
204
  ###############################################################################
205
205
  # GetResultDir -- Method
206
- # This method returns the current result dir.
206
+ # This method returns the current result dir.
207
207
  #
208
208
  # Input:
209
- # None.
209
+ # None.
210
210
  #
211
211
  # Output:
212
- # returns the current result directory.
212
+ # returns the current result directory.
213
213
  #
214
214
  ###############################################################################
215
- def GetResultDir()
216
- return @ResultsDir
217
- end
215
+ def GetResultDir()
216
+ return @ResultsDir
217
+ end
218
218
 
219
219
  ###############################################################################
220
220
  # IncSkippedTest -- Method
@@ -424,7 +424,7 @@ class SodaReporter
424
424
  # always returns 0.
425
425
  #
426
426
  ###############################################################################
427
- def SavePage(reason = "")
427
+ def SavePage(reason = "")
428
428
  if (@saveHtmlFiles != true)
429
429
  return 0
430
430
  end
@@ -439,7 +439,7 @@ class SodaReporter
439
439
  log("HTML Saved: #{save_file_name}\n")
440
440
 
441
441
  return 0
442
- end
442
+ end
443
443
 
444
444
  ###############################################################################
445
445
  # AddEventCount -- Method
@@ -452,9 +452,9 @@ class SodaReporter
452
452
  # None.
453
453
  #
454
454
  ###############################################################################
455
- def AddEventCount
455
+ def AddEventCount
456
456
  @total += 1
457
- end
457
+ end
458
458
 
459
459
  ###############################################################################
460
460
  # EndTestReport -- Method
@@ -472,63 +472,46 @@ class SodaReporter
472
472
  log("Soda test: #{@sodatest_file} finished.\n")
473
473
  log("[End Test]\n")
474
474
  @logfile.close()
475
-
476
- tmp_logfile = File.dirname(@log_filename)
477
- tmp_logfile += "/"
478
- tmp_logfile += File.basename("#{@log_filename}", ".tmp")
479
- tmp_logfile += ".log"
480
- # File.rename(@log_filename, tmp_logfile) # put back after hack!!!
481
- NFSRenameHack(@log_filename, tmp_logfile)
482
-
483
- @log_filename = tmp_logfile
484
475
  @end_time = Time.now().strftime("%m/%d/%Y-%H:%M:%S")
485
476
  end
486
477
 
487
478
  ###############################################################################
488
479
  # NFSRenameHack -- hack!!!
489
480
  #
490
- # This is a total hack because of the very lame ass way hudson was setup
491
- # to run soda tests using an nfs mount as a writing point for test
492
- # results!!! This hack will be taken out as soon as hudson is updated.
493
- #
494
- ###############################################################################
495
- def NFSRenameHack(old_file, new_file)
496
- err = false
497
- count = 0
498
-
499
- while (err != true)
500
- err = @logfile.closed?()
501
- count += 1
502
- sleep(1)
503
- break if (count > 20)
504
- end
505
-
506
- tmp_log = File.open(old_file, "r")
507
- new_log = File.new(new_file, "w+")
508
- line = nil
509
- while (line = tmp_log.gets)
510
- new_log.write(line)
511
- end
512
- tmp_log.close()
513
- new_log.close()
514
-
515
- sleep(1)
516
-
517
- is_deleted = false
518
- for i in 0..30
519
- begin
520
- File.unlink(old_file)
521
- is_deleted = true
522
- rescue Exception => e
523
- print "(!)Failed calling delete on file: '#{old_file}'!\n"
524
- is_deleted = false
525
- ensure
526
- end
527
-
528
- break if (is_deleted)
529
- sleep(1)
530
- end
531
- end
481
+ # This is a total hack because of the very lame ass way hudson was setup
482
+ # to run soda tests using an nfs mount as a writing point for test
483
+ # results!!! This hack will be taken out as soon as hudson is updated.
484
+ #
485
+ ###############################################################################
486
+ def NFSRenameHack(old_file, new_file)
487
+ err = false
488
+ count = 0
489
+
490
+ while (err != true)
491
+ err = @logfile.closed?()
492
+ count += 1
493
+ sleep(1)
494
+ break if (count > 20)
495
+ end
496
+
497
+ tmp_log = File.open(old_file, "r")
498
+ new_log = File.new(new_file, "w+")
499
+ line = nil
500
+ while (line = tmp_log.gets)
501
+ new_log.write(line)
502
+ end
503
+ tmp_log.close()
504
+ new_log.close()
505
+
506
+ # using this because on Windows File.unlink doesn't want to remove the
507
+ # file. There might be a file descripter hanging around but I can't
508
+ # find it and it is working fine one linux. This shoudl be looked into
509
+ # at a later time...
510
+ begin
511
+ File.unlink(old_file)
512
+ rescue Exception => e
513
+ end
514
+ end
532
515
 
533
516
  ###############################################################################
534
517
  # log -- Method
@@ -547,7 +530,7 @@ class SodaReporter
547
530
  def log(msg, error = 0)
548
531
  SodaUtils.PrintSoda(msg, error, @logfile, @debug)
549
532
  SodaUtils.PrintSoda(msg, error, nil, @debug, 1, @print_callback)
550
- end
533
+ end
551
534
 
552
535
  ###############################################################################
553
536
  # ReportException -- Method
@@ -570,7 +553,7 @@ class SodaReporter
570
553
  def ReportException(sodaException, file = false)
571
554
  msg = nil
572
555
  @exception_count += 1
573
-
556
+
574
557
  if (sodaException.message.empty?)
575
558
  msg = "No exception message found!"
576
559
  else
@@ -583,12 +566,12 @@ class SodaReporter
583
566
  log("Exception raised: #{msg}\n", SodaUtils::ERROR)
584
567
  end
585
568
 
586
- bt = "--Exception Backtrace: " + sodaException.backtrace.join("--") +
587
- "\n"
588
- btm = "--Exception Message: #{msg}\n"
589
- log("Exception raised for file: #{file}" + btm + bt,
590
- SodaUtils::ERROR)
591
- end
569
+ bt = "--Exception Backtrace: " + sodaException.backtrace.join("--") +
570
+ "\n"
571
+ btm = "--Exception Message: #{msg}\n"
572
+ log("Exception raised for file: #{file}" + btm + bt,
573
+ SodaUtils::ERROR)
574
+ end
592
575
 
593
576
  ###############################################################################
594
577
  # Assert -- Method
@@ -605,7 +588,7 @@ class SodaReporter
605
588
  ###############################################################################
606
589
  def Assert(exp, msg = "", file = "", line_number = "")
607
590
  result = 0
608
- @asserts_count += 1
591
+ @asserts_count += 1
609
592
  url = nil
610
593
 
611
594
  url = "#{$curSoda.browser.url}"
@@ -625,27 +608,27 @@ class SodaReporter
625
608
  line_number = "Unknown line number"
626
609
  end
627
610
 
628
- if (!exp)
611
+ if (!exp)
629
612
  ass_msg = "Assertion: Failed!:--#{url}--#{file}" +
630
613
  "--Assertion Message: #{msg}--Line: #{line_number}"
631
614
  ass_msg = ass_msg.sub(/\n/,"")
632
615
  ass_msg << "\n"
633
616
 
634
617
  log(ass_msg, 1)
635
- SavePage(msg)
636
- @assertFails_count += 1
618
+ SavePage(msg)
619
+ @assertFails_count += 1
637
620
  result = -1
638
- else
621
+ else
639
622
  if (msg.empty?)
640
- log("Assertion: Passed.\n")
623
+ log("Assertion: Passed.\n")
641
624
  else
642
- log("Assertion: Passed: #{msg}.\n")
625
+ log("Assertion: Passed: #{msg}.\n")
643
626
  end
644
627
  result = 0
645
- end
628
+ end
646
629
 
647
630
  return result
648
- end
631
+ end
649
632
 
650
633
  ###############################################################################
651
634
  # AssertNot -- Method
@@ -658,8 +641,8 @@ class SodaReporter
658
641
  #
659
642
  ###############################################################################
660
643
  def AssertNot(exp, msg = "", file = "")
661
- Assert(!exp, msg, file)
662
- end
644
+ Assert(!exp, msg, file)
645
+ end
663
646
 
664
647
  ###############################################################################
665
648
  # SodaPrintCurrentReport -- Method
@@ -683,6 +666,6 @@ class SodaReporter
683
666
  "--Test Assert Count:#{@asserts_count}" +
684
667
  "--Test Exceptions:#{@exception_count}\n"
685
668
  log(msg)
686
- end
669
+ end
687
670
  end
688
671
 
@@ -41,18 +41,15 @@ $HTML_HEADER = <<HTML
41
41
  body {
42
42
  background: #e5eef3;
43
43
  }
44
-
45
44
  .highlight {
46
45
  background-color: #8888FF;
47
46
  }
48
-
49
47
  .unhighlight {
50
48
  background: #e5eef3;
51
49
  }
52
-
53
50
  .td_header_master {
54
51
  white-space: nowrap;
55
- background: #99CCFF;
52
+ background: #b6dde8;
56
53
  text-align: center;
57
54
  font-family: Arial;
58
55
  font-weight: bold;
@@ -61,10 +58,9 @@ body {
61
58
  border-right: 2px solid black;
62
59
  border-bottom: 2px solid black;
63
60
  }
64
-
65
61
  .td_header_sub {
66
62
  white-space: nowrap;
67
- background: #99CCFF;
63
+ background: #b6dde8;
68
64
  text-align: center;
69
65
  font-family: Arial;
70
66
  font-weight: bold;
@@ -73,10 +69,9 @@ body {
73
69
  border-right: 0px solid black;
74
70
  border-bottom: 2px solid black;
75
71
  }
76
-
77
72
  .td_header_skipped {
78
73
  white-space: nowrap;
79
- background: #99CCFF;
74
+ background: #b6dde8;
80
75
  text-align: center;
81
76
  font-family: Arial;
82
77
  font-weight: bold;
@@ -85,10 +80,9 @@ body {
85
80
  border-right: 2px solid black;
86
81
  border-bottom: 2px solid black;
87
82
  }
88
-
89
83
  .td_header_watchdog {
90
84
  white-space: nowrap;
91
- background: #99CCFF;
85
+ background: #b6dde8;
92
86
  text-align: center;
93
87
  font-family: Arial;
94
88
  font-weight: bold;
@@ -97,7 +91,6 @@ body {
97
91
  border-right: 0px solid black;
98
92
  border-bottom: 2px solid black;
99
93
  }
100
-
101
94
  table {
102
95
  width: 100%;
103
96
  border: 2px solid black;
@@ -105,7 +98,18 @@ table {
105
98
  padding: 0px;
106
99
  background: #FFFFFF;
107
100
  }
108
-
101
+ .td_failed_suite {
102
+ white-space: nowrap;
103
+ text-align: left;
104
+ font-family: Arial;
105
+ font-weight: bold;
106
+ color: #FF0000;
107
+ font-size: 12px;
108
+ border-left: 1px solid black;
109
+ border-right: 1px solid black;
110
+ border-bottom: 1px solid black;
111
+ background-color: #fde9d9;
112
+ }
109
113
  .td_file_data {
110
114
  white-space: nowrap;
111
115
  text-align: left;
@@ -116,7 +120,6 @@ table {
116
120
  border-right: 2px solid black;
117
121
  border-bottom: 2px solid black;
118
122
  }
119
-
120
123
  .td_run_data {
121
124
  white-space: nowrap;
122
125
  text-align: center;
@@ -127,7 +130,6 @@ table {
127
130
  border-right: 0px solid black;
128
131
  border-bottom: 0px solid black;
129
132
  }
130
-
131
133
  .td_run_data_error {
132
134
  white-space: nowrap;
133
135
  text-align: center;
@@ -139,19 +141,17 @@ table {
139
141
  border-right: 0px solid black;
140
142
  border-bottom: 0px solid black;
141
143
  }
142
-
143
144
  .td_passed_data {
144
145
  white-space: nowrap;
145
146
  text-align: center;
146
147
  font-family: Arial;
147
148
  font-weight: bold;
148
- color: #00FF00;
149
+ color: #00cc00;
149
150
  font-size: 12px;
150
151
  border-left: 0px solid black;
151
152
  border-right: 0px solid black;
152
153
  border-bottom: 0px solid black;
153
154
  }
154
-
155
155
  .td_failed_data {
156
156
  white-space: nowrap;
157
157
  text-align: center;
@@ -163,8 +163,18 @@ table {
163
163
  border-right: 0px solid black;
164
164
  border-bottom: 0px solid black;
165
165
  }
166
-
167
- .td_blocked_data {
166
+ .td_failed_data_zero {
167
+ white-space: nowrap;
168
+ text-align: center;
169
+ font-family: Arial;
170
+ font-weight: normal;
171
+ color: #000000;
172
+ font-size: 12px;
173
+ border-left: 0px solid black;
174
+ border-right: 0px solid black;
175
+ border-bottom: 0px solid black;
176
+ }
177
+ ._data {
168
178
  white-space: nowrap;
169
179
  text-align: center;
170
180
  font-family: Arial;
@@ -175,19 +185,28 @@ table {
175
185
  border-right: 0px solid black;
176
186
  border-bottom: 0px solid black;
177
187
  }
178
-
179
- .td_skipped_data {
188
+ .td_blocked_data {
180
189
  white-space: nowrap;
181
190
  text-align: center;
182
191
  font-family: Arial;
183
192
  font-weight: bold;
184
- color: #D9D9D9;
193
+ color: #FF8200;
194
+ font-size: 12px;
195
+ border-left: 0px solid black;
196
+ border-right: 2px solid black;
197
+ border-bottom: 0px solid black;
198
+ }
199
+ .td_blocked_data_zero {
200
+ white-space: nowrap;
201
+ text-align: center;
202
+ font-family: Arial;
203
+ font-weight: normal;
204
+ color: #000000;
185
205
  font-size: 12px;
186
206
  border-left: 0px solid black;
187
207
  border-right: 2px solid black;
188
208
  border-bottom: 0px solid black;
189
209
  }
190
-
191
210
  .td_watchdog_data {
192
211
  white-space: nowrap;
193
212
  text-align: center;
@@ -198,7 +217,6 @@ table {
198
217
  border-right: 0px solid black;
199
218
  border-bottom: 0px solid black;
200
219
  }
201
-
202
220
  .td_watchdog_error_data {
203
221
  white-space: nowrap;
204
222
  color: #FF0000;
@@ -210,7 +228,6 @@ table {
210
228
  border-right: 0px solid black;
211
229
  border-bottom: 0px solid black;
212
230
  }
213
-
214
231
  .td_exceptions_data {
215
232
  white-space: nowrap;
216
233
  text-align: center;
@@ -221,7 +238,6 @@ table {
221
238
  border-right: 0px solid black;
222
239
  border-bottom: 0px solid black;
223
240
  }
224
-
225
241
  .td_exceptions_error_data {
226
242
  white-space: nowrap;
227
243
  text-align: center;
@@ -233,7 +249,6 @@ table {
233
249
  border-right: 0px solid black;
234
250
  border-bottom: 0px solid black;
235
251
  }
236
-
237
252
  .td_javascript_data {
238
253
  white-space: nowrap;
239
254
  text-align: center;
@@ -244,7 +259,6 @@ table {
244
259
  border-right: 0px solid black;
245
260
  border-bottom: 0px solid black;
246
261
  }
247
-
248
262
  .td_javascript_error_data {
249
263
  white-space: nowrap;
250
264
  text-align: center;
@@ -256,7 +270,6 @@ table {
256
270
  border-right: 0px solid black;
257
271
  border-bottom: 0px solid black;
258
272
  }
259
-
260
273
  .td_assert_data {
261
274
  white-space: nowrap;
262
275
  text-align: center;
@@ -267,7 +280,6 @@ table {
267
280
  border-right: 0px solid black;
268
281
  border-bottom: 0px solid black;
269
282
  }
270
-
271
283
  .td_assert_error_data {
272
284
  white-space: nowrap;
273
285
  text-align: center;
@@ -279,7 +291,6 @@ table {
279
291
  border-right: 0px solid black;
280
292
  border-bottom: 0px solid black;
281
293
  }
282
-
283
294
  .td_other_data {
284
295
  white-space: nowrap;
285
296
  text-align: center;
@@ -290,7 +301,6 @@ table {
290
301
  border-right: 0px solid black;
291
302
  border-bottom: 0px solid black;
292
303
  }
293
-
294
304
  .td_other_error_data {
295
305
  white-space: nowrap;
296
306
  text-align: center;
@@ -313,18 +323,16 @@ table {
313
323
  border-right: 0px solid black;
314
324
  border-bottom: 0px solid black;
315
325
  }
316
-
317
326
  .td_total_data {
318
327
  white-space: nowrap;
319
328
  text-align: center;
320
329
  font-family: Arial;
321
- font-weight: normal;
330
+ font-weight: bold;
322
331
  font-size: 12px;
323
332
  border-left: 0px solid black;
324
333
  border-right: 2px solid black;
325
334
  border-bottom: 0px solid black;
326
335
  }
327
-
328
336
  .td_total_error_data {
329
337
  white-space: nowrap;
330
338
  text-align: center;
@@ -336,7 +344,6 @@ table {
336
344
  border-right: 2px solid black;
337
345
  border-bottom: 0px solid black;
338
346
  }
339
-
340
347
  .td_css_data {
341
348
  white-space: nowrap;
342
349
  text-align: center;
@@ -347,8 +354,18 @@ table {
347
354
  border-right: 0px solid black;
348
355
  border-bottom: 0px solid black;
349
356
  }
350
-
351
357
  .td_sodawarnings_data {
358
+ white-space: nowrap;
359
+ text-align: center;
360
+ font-family: Arial;
361
+ font-weight: normal;
362
+ font-size: 12px;
363
+ color: #FF8200;
364
+ border-left: 0px solid black;
365
+ border-right: 2px solid black;
366
+ border-bottom: 0px solid black;
367
+ }
368
+ .td_sodawarnings_data_zero {
352
369
  white-space: nowrap;
353
370
  text-align: center;
354
371
  font-family: Arial;
@@ -358,7 +375,6 @@ table {
358
375
  border-right: 2px solid black;
359
376
  border-bottom: 0px solid black;
360
377
  }
361
-
362
378
  .td_time_data {
363
379
  white-space: nowrap;
364
380
  text-align: center;
@@ -369,10 +385,9 @@ table {
369
385
  border-right: 1px solid black;
370
386
  border-bottom: 0px solid black;
371
387
  }
372
-
373
388
  .td_footer_run {
374
389
  white-space: nowrap;
375
- background: #99CCFF;
390
+ background: #b6dde8;
376
391
  text-align: center;
377
392
  font-family: Arial;
378
393
  font-weight: bold;
@@ -383,24 +398,22 @@ table {
383
398
  border-right: 2px solid black;
384
399
  border-bottom: 2px solid black;
385
400
  }
386
-
387
401
  .td_footer_passed {
388
402
  white-space: nowrap;
389
- background: #99CCFF;
403
+ background: #b6dde8;
390
404
  text-align: center;
391
405
  font-family: Arial;
392
406
  font-weight: bold;
393
407
  font-size: 12px;
394
- color: #00FF00;
408
+ color: #00cc00;
395
409
  border-top: 2px solid black;
396
410
  border-left: 0px solid black;
397
411
  border-right: 0px solid black;
398
412
  border-bottom: 2px solid black;
399
413
  }
400
-
401
414
  .td_footer_failed {
402
415
  white-space: nowrap;
403
- background: #99CCFF;
416
+ background: #b6dde8;
404
417
  text-align: center;
405
418
  font-family: Arial;
406
419
  font-weight: bold;
@@ -411,38 +424,22 @@ table {
411
424
  border-right: 2px solid black;
412
425
  border-bottom: 2px solid black;
413
426
  }
414
-
415
- .td_footer_blocked {
416
- white-space: nowrap;
417
- background: #99CCFF;
418
- text-align: center;
419
- font-family: Arial;
420
- font-weight: bold;
421
- font-size: 12px;
422
- color: #FFCF10;
423
- border-top: 2px solid black;
424
- border-left: 0px solid black;
425
- border-right: 0px solid black;
426
- border-bottom: 2px solid black;
427
- }
428
-
429
427
  .td_footer_skipped {
430
428
  white-space: nowrap;
431
- background: #99CCFF;
429
+ background: #b6dde8;
432
430
  text-align: center;
433
431
  font-family: Arial;
434
432
  font-weight: bold;
435
433
  font-size: 12px;
436
- color: #D9D9D9;
434
+ color: #FF8200;
437
435
  border-top: 2px solid black;
438
436
  border-left: 0px solid black;
439
437
  border-right: 2px solid black;
440
438
  border-bottom: 2px solid black;
441
439
  }
442
-
443
440
  .td_footer_watchdog {
444
441
  white-space: nowrap;
445
- background: #99CCFF;
442
+ background: #b6dde8;
446
443
  text-align: center;
447
444
  font-family: Arial;
448
445
  font-weight: bold;
@@ -453,10 +450,9 @@ table {
453
450
  border-right: 0px solid black;
454
451
  border-bottom: 2px solid black;
455
452
  }
456
-
457
453
  .td_footer_exceptions {
458
454
  white-space: nowrap;
459
- background: #99CCFF;
455
+ background: #b6dde8;
460
456
  text-align: center;
461
457
  font-family: Arial;
462
458
  font-weight: bold;
@@ -467,10 +463,9 @@ table {
467
463
  border-right: 0px solid black;
468
464
  border-bottom: 2px solid black;
469
465
  }
470
-
471
466
  .td_footer_javascript {
472
467
  white-space: nowrap;
473
- background: #99CCFF;
468
+ background: #b6dde8;
474
469
  text-align: center;
475
470
  font-family: Arial;
476
471
  font-weight: bold;
@@ -481,10 +476,9 @@ table {
481
476
  border-right: 0px solid black;
482
477
  border-bottom: 2px solid black;
483
478
  }
484
-
485
479
  .td_footer_assert {
486
480
  white-space: nowrap;
487
- background: #99CCFF;
481
+ background: #b6dde8;
488
482
  text-align: center;
489
483
  font-family: Arial;
490
484
  font-weight: bold;
@@ -495,10 +489,9 @@ table {
495
489
  border-right: 0px solid black;
496
490
  border-bottom: 2px solid black;
497
491
  }
498
-
499
492
  .td_footer_other {
500
493
  white-space: nowrap;
501
- background: #99CCFF;
494
+ background: #b6dde8;
502
495
  text-align: center;
503
496
  font-family: Arial;
504
497
  font-weight: bold;
@@ -509,10 +502,9 @@ table {
509
502
  border-right: 0px solid black;
510
503
  border-bottom: 2px solid black;
511
504
  }
512
-
513
505
  .td_footer_total {
514
506
  white-space: nowrap;
515
- background: #99CCFF;
507
+ background: #b6dde8;
516
508
  text-align: center;
517
509
  font-family: Arial;
518
510
  font-weight: bold;
@@ -523,10 +515,9 @@ table {
523
515
  border-right: 2px solid black;
524
516
  border-bottom: 2px solid black;
525
517
  }
526
-
527
518
  .td_footer_css {
528
519
  white-space: nowrap;
529
- background: #99CCFF;
520
+ background: #b6dde8;
530
521
  text-align: center;
531
522
  font-family: Arial;
532
523
  font-weight: bold;
@@ -537,10 +528,9 @@ table {
537
528
  border-right: 0px solid black;
538
529
  border-bottom: 2px solid black;
539
530
  }
540
-
541
531
  .td_footer_sodawarnings {
542
532
  white-space: nowrap;
543
- background: #99CCFF;
533
+ background: #b6dde8;
544
534
  text-align: center;
545
535
  font-family: Arial;
546
536
  font-weight: bold;
@@ -551,10 +541,9 @@ table {
551
541
  border-right: 0px solid black;
552
542
  border-bottom: 2px solid black;
553
543
  }
554
-
555
544
  .td_footer_times {
556
545
  white-space: nowrap;
557
- background: #99CCFF;
546
+ background: #b6dde8;
558
547
  text-align: center;
559
548
  font-family: Arial;
560
549
  font-weight: bold;
@@ -571,7 +560,7 @@ table {
571
560
  <tr>
572
561
  <td class="td_header_master" rowspan="2">Suite</br>
573
562
  (click link for full report)</td>
574
- <td class="td_header_master" colspan="5">Tests</td>
563
+ <td class="td_header_master" colspan="4">Tests</td>
575
564
  <td class="td_header_master" colspan="6">Failures</td>
576
565
  <td class="td_header_master" colspan="2">Warnings</td>
577
566
  <td class="td_header_master" rowspan="2">Run Time</br>(hh:mm:ss)</td>
@@ -580,8 +569,7 @@ table {
580
569
  <td class="td_header_sub">Run</td>
581
570
  <td class="td_header_sub">Passed</td>
582
571
  <td class="td_header_sub">Failed</td>
583
- <td class="td_header_sub">Blocked</td>
584
- <td class="td_header_skipped">Skipped</td>
572
+ <td class="td_header_skipped">Blocked</td>
585
573
  <td class="td_header_watchdog">Watchdogs</td>
586
574
  <td class="td_header_sub">Exceptions</td>
587
575
  <td class="td_header_sub">JavaScript</br>Errors</td>
@@ -636,17 +624,9 @@ def initialize(dir ="", outfile = "", create_links = false)
636
624
  sleep(1)
637
625
  end
638
626
 
639
- # This should go back into production after moving away from our
640
- # internal nfs sever we are using for reporting...
641
- #
642
- # if (timeout != false)
643
- # raise "Timed out waiting for lock to be released on file:"+
644
- # " \"#{html_tmp_file}\"!\n"
645
- # end
646
-
647
627
  log_files = GetLogFiles(dir)
648
628
  if ( (log_files == nil) || (log_files.length < 1) )
649
- raise "Failed calling: GetLogFiles(#{dir})!"
629
+ raise "Error: No log files found in directory: '#{dir}'!"
650
630
  end
651
631
 
652
632
  report_data = GenerateReportData(log_files)
@@ -759,6 +739,8 @@ def GenerateReportData(files)
759
739
  when "test"
760
740
  tmp_test_data = GetTestInfo(kid.children)
761
741
  tmp_hash['tests'].push(tmp_test_data)
742
+ else
743
+ tmp_hash[kid.name] = kid.content()
762
744
  end # end case #
763
745
  end
764
746
 
@@ -809,21 +791,21 @@ def SumSuiteTests(tests, suitename)
809
791
  dir_name = File.dirname(test['testfile'])
810
792
  if (dir_name =~ /lib/i)
811
793
  lib_file_count += 1
812
- # skip libs david doesn't want them.
813
- next
794
+ else
795
+ report['Test Ran Count'] += 1
814
796
  end
815
797
 
816
798
  summary_int_fields.each do |total_field|
817
799
  report[total_field] += test[total_field].to_i()
818
800
  end
819
801
 
820
- report['Test Ran Count'] += 1
821
-
822
- # count tests that pass and fail. #
823
- if (test['result'].to_i != 0)
824
- report['Test Failed Count'] += 1
825
- else
826
- report['Test Pass Count'] += 1
802
+ if (dir_name !~ /lib/i)
803
+ # count tests that pass and fail. #
804
+ if (test['result'].to_i != 0)
805
+ report['Test Failed Count'] += 1
806
+ else
807
+ report['Test Pass Count'] += 1
808
+ end
827
809
  end
828
810
 
829
811
  # add up times #
@@ -843,14 +825,15 @@ def SumSuiteTests(tests, suitename)
843
825
 
844
826
  # need to do away with tests that did not run for a good reason #
845
827
  report['Test Ran Count'] -= report['Test Blocked Count']
846
- report['Test Ran Count'] -= report['Test Skip Count']
847
-
828
+ # report['Test Ran Count'] -= report['Test Skip Count']
829
+ report['Test Pass Count'] -= report['Test Blocked Count']
848
830
  report['Total Test Count'] = tests.length()
831
+
849
832
  if (lib_file_count > 0)
850
833
  report['Total Test Count'] -= lib_file_count
851
834
  end
852
835
 
853
- print "\b\b\b: Done.\n"
836
+ print ":Done.\n"
854
837
 
855
838
  return report
856
839
  end
@@ -870,15 +853,22 @@ end
870
853
  def GenHtmlReport2(data, reportfile, create_links = false)
871
854
  suites_totals = {}
872
855
  summary_totals = {}
856
+ suite_errors = []
857
+ row_id = 0
873
858
 
874
859
  print "(*)Processing data...\n"
875
860
 
876
861
  # first sum up all of the test results for each suite #
877
862
  suites = data.keys.sort()
878
863
  suites.each do |suite_name|
879
- suites_totals[suite_name] = {} # new suite name for the totals #
880
- suite_data = data[suite_name]
881
- suites_totals[suite_name] = SumSuiteTests(suite_data['tests'], suite_name)
864
+ if (!data[suite_name].key?("Suite_Failure"))
865
+ suites_totals[suite_name] = {} # new suite name for the totals #
866
+ suite_data = data[suite_name]
867
+ suites_totals[suite_name] = SumSuiteTests(suite_data['tests'],
868
+ suite_name)
869
+ else
870
+ suite_errors.push(data[suite_name])
871
+ end
882
872
  end
883
873
 
884
874
  # second sum up all of the suite sums for the totals for the summary #
@@ -905,7 +895,22 @@ def GenHtmlReport2(data, reportfile, create_links = false)
905
895
  fd = File.new(reportfile, "w+")
906
896
  fd.write($HTML_HEADER)
907
897
 
908
- row_id = 0
898
+ print "(*)Processing suite errors...\n"
899
+ suite_errors.sort_by{|hash| hash['suitefile']}.each do |e_suite|
900
+ row_id += 1
901
+
902
+ str = "<tr id=\"#{row_id}\" class=\"unhighlight\" "+
903
+ "onMouseOver=\"this.className='highlight'\" "+
904
+ "onMouseOut=\"this.className='unhighlight'\">\n"+
905
+ "\t<td class=\"td_file_data\">"+
906
+ "#{e_suite['suitefile']}</td>\n"+
907
+ "\t<td colspan=\"13\" class=\"td_failed_suite\">"+
908
+ "#{e_suite['Suite_Error']}</td>\n"+
909
+ "</tr>\n"
910
+ fd.write(str)
911
+ end
912
+ print "(*)Finished.\n"
913
+
909
914
  suites_totals.sort.each do |suite_name, suite_data|
910
915
  row_id += 1
911
916
  report_file = "#{suite_name}"
@@ -932,12 +937,6 @@ def GenHtmlReport2(data, reportfile, create_links = false)
932
937
  seconds = 0
933
938
  end
934
939
 
935
- test_run_class = "td_run_data"
936
- if (suite_data['Test Assert Failures'] > 0 ||
937
- suite_data['Test Exceptions'] > 0)
938
- test_run_class = "td_run_data_error"
939
- end
940
-
941
940
  exceptions_td = "td_exceptions_data"
942
941
  if (suite_data['Test Exceptions'] > 0)
943
942
  exceptions_td = "td_exceptions_error_data"
@@ -974,6 +973,26 @@ def GenHtmlReport2(data, reportfile, create_links = false)
974
973
  total_failures_td = "td_total_error_data"
975
974
  end
976
975
 
976
+ test_run_class = "td_run_data"
977
+ if (suite_data['Test Ran Count'] != suite_data['Total Test Count'])
978
+ test_run_class = "td_run_data_error"
979
+ end
980
+
981
+ td_failed = "td_failed_data_zero"
982
+ if (suite_data['Test Failed Count'].to_i > 0)
983
+ td_failed = "td_failed_data"
984
+ end
985
+
986
+ td_blocked = "td_blocked_data_zero"
987
+ if (suite_data['Test Blocked Count'].to_i > 0)
988
+ td_blocked = "td_blocked_data"
989
+ end
990
+
991
+ td_warnings = "td_sodawarnings_data_zero"
992
+ if (suite_data['Test Warning Count'].to_i > 0)
993
+ td_warnings = "td_sodawarnings_data"
994
+ end
995
+
977
996
  reportdir = File.dirname(reportfile)
978
997
  suite_mini_file = GenSuiteMiniSummary(data[suite_name], reportdir)
979
998
 
@@ -987,12 +1006,10 @@ def GenHtmlReport2(data, reportfile, create_links = false)
987
1006
  "#{suite_data['Total Test Count']}</td>\n"+
988
1007
  "\t<td class=\"td_passed_data\">"+
989
1008
  "#{suite_data['Test Pass Count']}</td>\n"+
990
- "\t<td class=\"td_failed_data\">"+
1009
+ "\t<td class=\"#{td_failed}\">"+
991
1010
  "#{suite_data['Test Failed Count']}</td>\n"+
992
- "\t<td class=\"td_blocked_data\">"+
1011
+ "\t<td class=\"#{td_blocked}\">"+
993
1012
  "#{suite_data['Test Blocked Count']}</td>\n"+
994
- "\t<td class=\"td_skipped_data\">"+
995
- "#{suite_data['Test Skip Count']}</td>\n"+
996
1013
  "\t<td class=\"#{watchdog_td}\">"+
997
1014
  "#{suite_data['Test WatchDog Count']}</td>\n"+
998
1015
  "\t<td class=\"#{exceptions_td}\">"+
@@ -1006,15 +1023,21 @@ def GenHtmlReport2(data, reportfile, create_links = false)
1006
1023
  "\t<td class=\"#{total_failures_td}\">#{total_failures}</td>\n"+
1007
1024
  "\t<td class=\"td_css_data\">"+
1008
1025
  "#{suite_data['Test CSS Error Count']}</td>\n"+
1009
- "\t<td class=\"td_sodawarnings_data\">"+
1026
+ "\t<td class=\"#{td_warnings}\">"+
1010
1027
  "#{suite_data['Test Warning Count']}</td>\n"+
1011
1028
  "\t<td class=\"td_time_data\">"+
1012
1029
  "#{hours}:#{minutes}:#{seconds}</td>\n</tr>\n"
1013
1030
  fd.write(str)
1014
1031
  end # end suites_totals loop #
1015
1032
 
1016
- hours,minutes,seconds,frac =
1017
- Date.day_fraction_to_time(summary_totals['Total Time'])
1033
+ if (summary_totals['Total Time'] != nil)
1034
+ hours,minutes,seconds,frac =
1035
+ Date.day_fraction_to_time(summary_totals['Total Time'])
1036
+ else
1037
+ hours = 0
1038
+ minutes = 0
1039
+ seconds = 0
1040
+ end
1018
1041
 
1019
1042
  if (hours < 10)
1020
1043
  hours = "0#{hours}"
@@ -1046,10 +1069,8 @@ def GenHtmlReport2(data, reportfile, create_links = false)
1046
1069
  "</td>\n"+
1047
1070
  "\t<td class=\"td_footer_failed\">"+
1048
1071
  "#{summary_totals['Test Failed Count']}</td>\n"+
1049
- "\t<td class=\"td_footer_blocked\">"+
1050
- "#{summary_totals['Test Blocked Count']}</td>\n"+
1051
1072
  "\t<td class=\"td_footer_skipped\">"+
1052
- "#{summary_totals['Test Skip Count']}</td>\n"+
1073
+ "#{summary_totals['Test Blocked Count']}</td>\n"+
1053
1074
  "\t<td class=\"td_footer_watchdog\">"+
1054
1075
  "#{summary_totals['Test WatchDog Count']}</td>\n"+
1055
1076
  "\t<td class=\"td_footer_exceptions\">"+
@@ -1082,8 +1103,20 @@ end
1082
1103
 
1083
1104
  def GenSuiteMiniSummary(suite_hash, reportdir)
1084
1105
  suite_file = suite_hash['suitefile']
1106
+ suite_dup_id = nil
1107
+
1108
+ if (suite_file =~ /\.xml(-\d+)/i)
1109
+ suite_dup_id = "#{$1}"
1110
+ suite_file = suite_file.gsub(/\.xml#{$1}/, ".xml")
1111
+ end
1112
+
1085
1113
  suite_file = File.basename(suite_file, ".xml")
1086
1114
  suite_name = "#{suite_file}"
1115
+
1116
+ if (suite_dup_id != nil)
1117
+ suite_file << "#{suite_dup_id}"
1118
+ end
1119
+
1087
1120
  suite_file << ".html"
1088
1121
  href = "#{suite_name}/#{suite_file}"
1089
1122
  suite_file = "#{reportdir}/#{suite_name}/#{suite_file}"
@@ -1099,7 +1132,7 @@ table {
1099
1132
  }
1100
1133
  .td_header_master {
1101
1134
  white-space: nowrap;
1102
- background: #99CCFF;
1135
+ background: #b6dde8;
1103
1136
  text-align: center;
1104
1137
  font-family: Arial;
1105
1138
  font-weight: bold;
@@ -1123,13 +1156,13 @@ table {
1123
1156
  text-align: center;
1124
1157
  font-family: Arial;
1125
1158
  font-weight: bold;
1126
- color: #00FF00;
1159
+ color: #00cc00;
1127
1160
  font-size: 12px;
1128
1161
  border-left: 0px solid black;
1129
1162
  border-right: 0px solid black;
1130
1163
  border-bottom: 2px solid black;
1131
1164
  }
1132
- .td_blocked_data {
1165
+ ._data {
1133
1166
  white-space: nowrap;
1134
1167
  text-align: center;
1135
1168
  font-family: Arial;
@@ -1151,6 +1184,17 @@ table {
1151
1184
  border-right: 0px solid black;
1152
1185
  border-bottom: 2px solid black;
1153
1186
  }
1187
+ .td_failed_data_zero {
1188
+ white-space: nowrap;
1189
+ text-align: center;
1190
+ font-family: Arial;
1191
+ font-weight: normal;
1192
+ color: #FFFFFF;
1193
+ font-size: 12px;
1194
+ border-left: 0px solid black;
1195
+ border-right: 0px solid black;
1196
+ border-bottom: 2px solid black;
1197
+ }
1154
1198
  .td_report_data {
1155
1199
  white-space: nowrap;
1156
1200
  text-align: center;
@@ -1209,7 +1253,7 @@ HTML
1209
1253
 
1210
1254
  # hack #
1211
1255
  if (test['Test Blocked Count'].to_i > 0)
1212
- result_str = "\t<td class=\"td_blocked_data\">Blocked</td>\n"
1256
+ result_str = "\t<td class=\"_data\">Blocked</td>\n"
1213
1257
  end
1214
1258
 
1215
1259
  str << "#{result_str}"