Module: TDriverReportAPI

Defined in:
lib/tdriver/report/report_api.rb

Instance Method Summary collapse

Instance Method Details

#tdriver_capture_screen(arguments = Hash.new) ⇒ Object

This method captures sut state to test case with comments

params

arguments: optional aguments

returns

nil

raises



111
112
113
114
115
# File 'lib/tdriver/report/report_api.rb', line 111

def tdriver_capture_screen(arguments=Hash.new)
  if $tdriver_reporter
    $new_test_case.capture_dump(true,arguments) if $new_test_case
  end
end

#tdriver_capture_state(capture_screen_shot = true) ⇒ Object

This method captures sut state to test case

params

capture_screen_shot: include screenshot to the capture

returns

nil

raises



98
99
100
101
102
# File 'lib/tdriver/report/report_api.rb', line 98

def tdriver_capture_state(capture_screen_shot=true)
  if $tdriver_reporter
    $new_test_case.capture_dump(capture_screen_shot) if $new_test_case
  end
end

#tdriver_get_current_by_status(status_type) ⇒ Object

This method returns all the current executed test by status

params

status_type: tests status

returns

Array

raises

Raises:

  • (TypeError)


30
31
32
33
34
35
36
37
# File 'lib/tdriver/report/report_api.rb', line 30

def tdriver_get_current_by_status( status_type )
  raise TypeError.new("Argument to method cannot be nil.") if status_type.nil?
  ret = []
  if $tdriver_reporter!=nil
    ret = $tdriver_reporter.parse_results_for_current_test(status_type)
  end
  return ret
end

#tdriver_get_sequential_failsObject

This method returns all the sequential fails

params

nil

returns

String

raises



62
63
64
# File 'lib/tdriver/report/report_api.rb', line 62

def tdriver_get_sequential_fails    
  return $tdriver_reporter.get_sequential_fails if $tdriver_reporter
end

#tdriver_get_status(status_type) ⇒ Object

This method returns all the tests

params

status_type: tests status

returns

Array

raises

Raises:

  • (TypeError)


46
47
48
49
50
51
52
53
# File 'lib/tdriver/report/report_api.rb', line 46

def tdriver_get_status(status_type)
  raise TypeError.new("Argument to method cannot be nil.") if status_type.nil?
  ret = []
  if $tdriver_reporter!=nil
    ret = $tdriver_reporter.read_result_storage(status_type)
  end
  return ret
end

#tdriver_log_data(data) ⇒ Object

This method logs data to the test case

params

data: the data to be logged

returns

nil

raises

Raises:

  • (TypeError)


84
85
86
87
88
89
# File 'lib/tdriver/report/report_api.rb', line 84

def tdriver_log_data(data)
  raise TypeError.new("Argument to method cannot be nil.") if data.nil?
  if $tdriver_reporter!=nil
    $tdriver_reporter.set_user_data(data)
  end
end

#tdriver_log_data_in_total_run_table(column_name, value) ⇒ Object

This method logs data to the total run table

params

column_name: name of the column value: value for the entry

returns

nil

raises

Raises:

  • (TypeError)


125
126
127
128
129
130
# File 'lib/tdriver/report/report_api.rb', line 125

def tdriver_log_data_in_total_run_table(column_name,value)
  raise TypeError.new("Argument to method cannot be nil.") if column_name.nil? || value.nil?
  if $tdriver_reporter!=nil
    $tdriver_reporter.set_user_table_data(column_name,value)
  end
end

#tdriver_log_data_in_xml(column_name, value) ⇒ Object

This method logs data to the all_cases.xml

params

column_name: name of the column value: value for the entry

returns

nil

raises

Raises:

  • (TypeError)


140
141
142
143
144
145
# File 'lib/tdriver/report/report_api.rb', line 140

def tdriver_log_data_in_xml(column_name,value)
  raise TypeError.new("Argument to method cannot be nil.") if column_name.nil? || value.nil?
  if $tdriver_reporter!=nil
    $tdriver_reporter.set_user_xml_data(column_name,value)
  end
end

#tdriver_report_combine_reports(reports) ⇒ Object

This method can combine previous results to the current execution

params

nil

returns

Integer

raises



317
318
319
320
321
322
323
324
325
326
# File 'lib/tdriver/report/report_api.rb', line 317

def tdriver_report_combine_reports(reports)
  if $tdriver_reporter!=nil
    $tdriver_reporter.combine_results(reports)
  else
    require 'tdriver'
    include TDriverReportCreator
    start_run
    $tdriver_reporter.combine_results(reports)
  end
end

#tdriver_report_current_test_case_dirObject

This method returns the amount of device resets

params

nil

returns

Integer

raises



335
336
337
338
339
340
341
# File 'lib/tdriver/report/report_api.rb', line 335

def tdriver_report_current_test_case_dir()
  test_case_path=''
  if $new_test_case!=nil
    test_case_path=$new_test_case.test_case_folder
  end
  return test_case_path.to_s
end

#tdriver_report_folderObject

This method returns current report folder

params

nil

returns

String

raises



242
243
244
245
246
247
248
# File 'lib/tdriver/report/report_api.rb', line 242

def tdriver_report_folder()
  folder=nil
  if $tdriver_reporter!=nil
    folder=$tdriver_reporter.report_folder
  end
  return folder.to_s
end

#tdriver_report_log(message) ⇒ Object

This method logs data test case details

params

message: message to be logged in to details(Supports html for formatting the entry)

returns

nil

raises

Raises:

  • (TypeError)


154
155
156
157
158
159
# File 'lib/tdriver/report/report_api.rb', line 154

def tdriver_report_log(message)
	raise TypeError.new("Argument message was not a String.") unless message.nil? or message.kind_of?(String)
  if $tdriver_reporter
    $new_test_case.set_test_case_execution_log(message) if $new_test_case
  end
end

#tdriver_report_run_timeObject

This method current execution time

params

nil

returns

String

raises



272
273
274
275
276
277
278
# File 'lib/tdriver/report/report_api.rb', line 272

def tdriver_report_run_time()
  run_time=nil
  if $tdriver_reporter!=nil
    run_time=$tdriver_reporter.run_time
  end
  return run_time.to_s
end

#tdriver_report_set_test_case_status(status) ⇒ Object

This method changes the test case result

params

status: new test case status

returns

nil

raises

Raises:

  • (TypeError)


168
169
170
171
172
173
# File 'lib/tdriver/report/report_api.rb', line 168

def tdriver_report_set_test_case_status(status)
	raise TypeError.new("Argument status was not a String.") unless status.nil? or status.kind_of?(String)
  if $tdriver_reporter!=nil
    $tdriver_reporter.set_test_case_user_defined_status(status)
  end
end

#tdriver_report_start_timeObject

This method returns test case start time

params

nil

returns

String

raises



257
258
259
260
261
262
263
# File 'lib/tdriver/report/report_api.rb', line 257

def tdriver_report_start_time()
  start_time=nil
  if $tdriver_reporter!=nil
    start_time=$tdriver_reporter.start_time
  end
  return start_time.to_s
end

#tdriver_report_total_crash_filesObject

This method returns the amount of crash files

params

nil

returns

Integer

raises



287
288
289
290
291
292
293
# File 'lib/tdriver/report/report_api.rb', line 287

def tdriver_report_total_crash_files()
  crash_files=0
  if $tdriver_reporter!=nil
    crash_files=$tdriver_reporter.total_crash_files
  end
  return crash_files.to_i
end

#tdriver_report_total_device_resetsObject

This method returns the amount of device resets

params

nil

returns

Integer

raises



302
303
304
305
306
307
308
# File 'lib/tdriver/report/report_api.rb', line 302

def tdriver_report_total_device_resets()
  device_resets=0
  if $tdriver_reporter!=nil
    device_resets=$tdriver_reporter.total_device_resets
  end
  return device_resets.to_i
end

#tdriver_report_total_failed_testsObject

This method returns how many tests has failed

params

nil

returns

Integer

raises



212
213
214
215
216
217
218
# File 'lib/tdriver/report/report_api.rb', line 212

def tdriver_report_total_failed_tests()
  total=0
  if $tdriver_reporter!=nil
    total=$tdriver_reporter.total_failed
  end
  return total.to_i
end

#tdriver_report_total_not_run_testsObject

This method returns how many tests were not run

params

nil

returns

Integer

raises



227
228
229
230
231
232
233
# File 'lib/tdriver/report/report_api.rb', line 227

def tdriver_report_total_not_run_tests()
  total=0
  if $tdriver_reporter!=nil
    total=$tdriver_reporter.total_not_run
  end
  return total.to_i
end

#tdriver_report_total_passed_testsObject

This method returns how many tests has passed

params

nil

returns

Integer

raises



197
198
199
200
201
202
203
# File 'lib/tdriver/report/report_api.rb', line 197

def tdriver_report_total_passed_tests()
  total=0
  if $tdriver_reporter!=nil
    total=$tdriver_reporter.total_passed
  end
  return total.to_i
end

#tdriver_report_total_tests_runObject

This method returns how many tests has been executed

params

nil

returns

Integer

raises



182
183
184
185
186
187
188
# File 'lib/tdriver/report/report_api.rb', line 182

def tdriver_report_total_tests_run()
  total=0
  if $tdriver_reporter!=nil
    total=$tdriver_reporter.total_run
  end
  return total.to_i
end

#tdriver_update_sequential_fails(status) ⇒ Object

This method updates the sequential fail status

params

status: fail status

returns

nil

raises



73
74
75
# File 'lib/tdriver/report/report_api.rb', line 73

def tdriver_update_sequential_fails( status )
   $tdriver_reporter.update_sequential_fails( status ) if $tdriver_reporter
end