testability-driver 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. data/bin/tdriver-devtools +0 -0
  2. data/ext/native_extensions.c +165 -6
  3. data/lib/tdriver-devtools/behaviour/old/xml/update +0 -0
  4. data/lib/tdriver-devtools/behaviour/xml/generate.rb +0 -0
  5. data/lib/tdriver-devtools/behaviour/xml/rdoc_behaviour_xml_generator.rb +15 -1
  6. data/lib/tdriver-devtools/doc/update +0 -0
  7. data/lib/tdriver-devtools/doc/xslt/template.xsl +24 -14
  8. data/lib/tdriver-devtools/doc/xslt/update +0 -0
  9. data/lib/tdriver-devtools/tdriver-devtools.rb +0 -0
  10. data/lib/tdriver-devtools/tests/feature_tests/update +0 -0
  11. data/lib/tdriver/base/behaviour/{behaviour.rb → abstract.rb} +3 -6
  12. data/lib/tdriver/base/behaviour/behaviours/object_abstract.rb +107 -0
  13. data/lib/tdriver/base/behaviour/behaviours/object_behaviour_composition.rb +2 -2
  14. data/lib/tdriver/base/behaviour/behaviours/object_behaviour_description.rb +47 -37
  15. data/lib/tdriver/base/behaviour/factory.rb +260 -382
  16. data/lib/tdriver/base/behaviour/loader.rb +22 -4
  17. data/lib/tdriver/base/controller/abstraction.rb +56 -0
  18. data/lib/tdriver/base/controller/loader.rb +21 -0
  19. data/lib/tdriver/base/loader.rb +3 -1
  20. data/lib/tdriver/base/sut/controller.rb +91 -74
  21. data/lib/tdriver/base/sut/factory.rb +8 -8
  22. data/lib/tdriver/base/sut/generic/behaviours/agent.rb +77 -0
  23. data/lib/tdriver/base/sut/generic/behaviours/sut.rb +116 -96
  24. data/lib/tdriver/base/sut/generic/commands/agent.rb +43 -0
  25. data/lib/tdriver/base/sut/sut.rb +10 -8
  26. data/lib/tdriver/base/test_object/abstract.rb +25 -24
  27. data/lib/tdriver/base/test_object/adapter.rb +67 -44
  28. data/lib/tdriver/base/test_object/behaviours/test_object.rb +79 -20
  29. data/lib/tdriver/base/test_object/factory.rb +45 -15
  30. data/lib/tdriver/base/test_object/xml/adapter.rb +80 -57
  31. data/lib/tdriver/env.rb +0 -0
  32. data/lib/tdriver/loader.rb +0 -0
  33. data/lib/tdriver/matti.rb +0 -0
  34. data/lib/tdriver/report/error_recovery/tdriver_error_recovery.rb +1 -0
  35. data/lib/tdriver/report/report.rb +2 -1
  36. data/lib/tdriver/report/report_crash_file_capture.rb +12 -0
  37. data/lib/tdriver/report/report_creator.rb +6 -2
  38. data/lib/tdriver/report/report_execution_statistics.rb +27 -11
  39. data/lib/tdriver/report/report_graph_generator.rb +59 -0
  40. data/lib/tdriver/report/report_test_case_run.rb +34 -2
  41. data/lib/tdriver/report/report_writer.rb +12 -0
  42. data/lib/tdriver/tdriver.rb +12 -1
  43. data/lib/tdriver/util/agent/loader.rb +22 -0
  44. data/lib/tdriver/util/agent/service.rb +107 -0
  45. data/lib/tdriver/util/common/crc16.rb +17 -10
  46. data/lib/tdriver/util/common/hash.rb +4 -1
  47. data/lib/tdriver/util/common/kernel.rb +11 -0
  48. data/lib/tdriver/util/common/numeric.rb +48 -0
  49. data/lib/tdriver/util/common/object.rb +5 -2
  50. data/lib/tdriver/util/common/string.rb +8 -1
  51. data/lib/tdriver/util/filters/attribute_filter.rb +121 -0
  52. data/lib/tdriver/util/filters/loader.rb +29 -0
  53. data/lib/tdriver/util/fixture/loader.rb +22 -0
  54. data/lib/tdriver/util/fixture/service.rb +157 -0
  55. data/lib/tdriver/util/loader.rb +8 -2
  56. data/lib/tdriver/util/logger/logger.rb +12 -6
  57. data/lib/tdriver/util/other/config.rb +0 -0
  58. data/lib/tdriver/util/parameter/parameter.rb +221 -152
  59. data/lib/tdriver/util/plugin/error.rb +0 -0
  60. data/lib/tdriver/util/video/camera_linux.rb +36 -22
  61. data/lib/tdriver/util/xml/parsers/nokogiri/abstraction.rb +3 -13
  62. data/lib/tdriver/util/xml/parsers/nokogiri/node.rb +13 -8
  63. data/lib/tdriver/util/xml/parsers/nokogiri/nodeset.rb +51 -9
  64. data/lib/tdriver/util/xml/xml.rb +4 -2
  65. data/lib/tdriver/verify/verify.rb +280 -621
  66. data/lib/tdriver/version.rb +1 -1
  67. data/xml/behaviours/generic.xml +34 -0
  68. data/xml/templates/generic.xml +20 -3
  69. metadata +168 -240
  70. data/lib/tdriver-devtools/tests/feature_tests/output/application_closable_0x3f.feature +0 -10
  71. data/lib/tdriver-devtools/tests/feature_tests/output/application_close.feature +0 -15
  72. data/lib/tdriver-devtools/tests/feature_tests/output/application_environment.feature +0 -10
  73. data/lib/tdriver-devtools/tests/feature_tests/output/application_executable_name.feature +0 -10
  74. data/lib/tdriver-devtools/tests/feature_tests/output/application_uid.feature +0 -10
  75. data/lib/tdriver-devtools/tests/feature_tests/output/created.rid +0 -1
  76. data/lib/tdriver-devtools/tests/feature_tests/output/find_find.feature +0 -15
  77. data/lib/tdriver-devtools/tests/feature_tests/output/flash_behaviour_flash.feature +0 -10
  78. data/lib/tdriver-devtools/tests/feature_tests/output/flash_behaviour_flash_images.feature +0 -15
  79. data/lib/tdriver-devtools/tests/feature_tests/output/sut_application.feature +0 -15
  80. data/lib/tdriver-devtools/tests/feature_tests/output/sut_capture_screen.feature +0 -10
  81. data/lib/tdriver-devtools/tests/feature_tests/output/sut_child.feature +0 -10
  82. data/lib/tdriver-devtools/tests/feature_tests/output/sut_clear_verify_blocks.feature +0 -10
  83. data/lib/tdriver-devtools/tests/feature_tests/output/sut_connect.feature +0 -10
  84. data/lib/tdriver-devtools/tests/feature_tests/output/sut_controller_execution_order.feature +0 -10
  85. data/lib/tdriver-devtools/tests/feature_tests/output/sut_controller_execution_order_0x3d.feature +0 -10
  86. data/lib/tdriver-devtools/tests/feature_tests/output/sut_current_application_id.feature +0 -15
  87. data/lib/tdriver-devtools/tests/feature_tests/output/sut_disconnect.feature +0 -10
  88. data/lib/tdriver-devtools/tests/feature_tests/output/sut_dump_count.feature +0 -15
  89. data/lib/tdriver-devtools/tests/feature_tests/output/sut_freeze.feature +0 -10
  90. data/lib/tdriver-devtools/tests/feature_tests/output/sut_frozen.feature +0 -10
  91. data/lib/tdriver-devtools/tests/feature_tests/output/sut_get_application_id.feature +0 -10
  92. data/lib/tdriver-devtools/tests/feature_tests/output/sut_get_object.feature +0 -10
  93. data/lib/tdriver-devtools/tests/feature_tests/output/sut_get_operator_data.feature +0 -10
  94. data/lib/tdriver-devtools/tests/feature_tests/output/sut_get_ui_dump.feature +0 -15
  95. data/lib/tdriver-devtools/tests/feature_tests/output/sut_get_user_information.feature +0 -10
  96. data/lib/tdriver-devtools/tests/feature_tests/output/sut_input.feature +0 -15
  97. data/lib/tdriver-devtools/tests/feature_tests/output/sut_parameter.feature +0 -15
  98. data/lib/tdriver-devtools/tests/feature_tests/output/sut_press_key.feature +0 -10
  99. data/lib/tdriver-devtools/tests/feature_tests/output/sut_received_data.feature +0 -10
  100. data/lib/tdriver-devtools/tests/feature_tests/output/sut_refresh.feature +0 -20
  101. data/lib/tdriver-devtools/tests/feature_tests/output/sut_refresh_timeout.feature +0 -15
  102. data/lib/tdriver-devtools/tests/feature_tests/output/sut_refresh_tries.feature +0 -15
  103. data/lib/tdriver-devtools/tests/feature_tests/output/sut_refresh_ui_dump.feature +0 -20
  104. data/lib/tdriver-devtools/tests/feature_tests/output/sut_run.feature +0 -10
  105. data/lib/tdriver-devtools/tests/feature_tests/output/sut_sent_data.feature +0 -10
  106. data/lib/tdriver-devtools/tests/feature_tests/output/sut_state.feature +0 -10
  107. data/lib/tdriver-devtools/tests/feature_tests/output/sut_translate.feature +0 -30
  108. data/lib/tdriver-devtools/tests/feature_tests/output/sut_ui_type.feature +0 -10
  109. data/lib/tdriver-devtools/tests/feature_tests/output/sut_ui_version.feature +0 -10
  110. data/lib/tdriver-devtools/tests/feature_tests/output/sut_unfreeze.feature +0 -10
  111. data/lib/tdriver-devtools/tests/feature_tests/output/sut_update.feature +0 -10
  112. data/lib/tdriver-devtools/tests/feature_tests/output/sut_verify_always.feature +0 -20
  113. data/lib/tdriver-devtools/tests/feature_tests/output/sut_verify_blocks.feature +0 -10
  114. data/lib/tdriver-devtools/tests/feature_tests/output/sut_x_path.feature +0 -10
  115. data/lib/tdriver-devtools/tests/feature_tests/output/sut_xml_data.feature +0 -10
  116. data/lib/tdriver-devtools/tests/feature_tests/output/sut_xml_data_0x3d.feature +0 -10
  117. data/lib/tdriver-devtools/tests/feature_tests/output/sut_xml_data_crc.feature +0 -10
  118. data/lib/tdriver-devtools/tests/feature_tests/output/switchbox_behaviour_power_down.feature +0 -10
  119. data/lib/tdriver-devtools/tests/feature_tests/output/switchbox_behaviour_power_status.feature +0 -10
  120. data/lib/tdriver-devtools/tests/feature_tests/output/switchbox_behaviour_power_up.feature +0 -10
  121. data/lib/tdriver-devtools/tests/feature_tests/output/switchbox_behaviour_reset.feature +0 -10
  122. data/lib/tdriver-devtools/tests/feature_tests/output/verification_test_object_exists_0x3f.feature +0 -15
  123. data/lib/tdriver/base/behaviour/factory_new.rb +0 -409
  124. data/lib/tdriver/base/test_object/identificator.rb +0 -518
  125. data/lib/tdriver/util/filters/dynamic_attributes.rb +0 -189
@@ -70,9 +70,12 @@ module MobyBase
70
70
  # retrieve sut objects test object adapter
71
71
  test_object_adapter = sut.instance_variable_get( :@test_object_adapter )
72
72
 
73
+ # add object identification attribute keys to dynamic attributes white list
74
+ TDriver::AttributeFilter.add_attributes( rules[ :object_attributes_hash ].keys )
75
+
73
76
  # search parameters for find_objects feature
74
77
  search_parameters = make_object_search_params( rules[ :parent ], rules[ :object_attributes_hash ] )
75
-
78
+
76
79
  # default rules
77
80
  directives.default_values(
78
81
 
@@ -100,7 +103,34 @@ module MobyBase
100
103
  :__retriable_allowed_exceptions => [ MobyBase::TestObjectNotFoundError, MobyBase::MultipleTestObjectsIdentifiedError ]
101
104
 
102
105
  )
103
-
106
+
107
+ # if sorting enabled; retrieve application layout direction first
108
+ if directives[ :__xy_sorting ] == true
109
+
110
+ parent_application = directives[ :__parent_application ] || rules[ :parent_application ]
111
+
112
+ unless parent_application.nil?
113
+
114
+ begin
115
+
116
+ application_layout_direction = parent_application.attribute( 'layoutDirection' ).to_s
117
+
118
+ raise if application_layout_direction.empty?
119
+
120
+ rescue
121
+
122
+ application_layout_direction = 'LeftToRight'
123
+
124
+ end
125
+
126
+ else
127
+
128
+ raise RuntimeError, 'parent application not given, unable to retrieve layoutDirection'
129
+
130
+ end
131
+
132
+ end
133
+
104
134
  # identify objects until desired matches found or timeout exceeds
105
135
  MobyUtil::Retryable.until(
106
136
 
@@ -169,12 +199,9 @@ module MobyBase
169
199
 
170
200
  # sort matches if enabled
171
201
  if directives[ :__xy_sorting ] == true
172
-
202
+
173
203
  # sort elements
174
- test_object_adapter.sort_elements(
175
- matches,
176
- test_object_adapter.application_layout_direction( sut )
177
- )
204
+ test_object_adapter.sort_elements( matches, application_layout_direction )
178
205
 
179
206
  end
180
207
 
@@ -282,7 +309,7 @@ module MobyBase
282
309
  end
283
310
 
284
311
  # add object identification attribute keys to dynamic attributes white list
285
- MobyUtil::DynamicAttributeFilter.instance.add_attributes( object_attributes_hash.keys )
312
+ #TDriver::AttributeFilter.add_attributes( object_attributes_hash.keys )
286
313
 
287
314
  child_objects = identify_object( rules ).collect{ | test_object_xml |
288
315
 
@@ -443,6 +470,9 @@ module MobyBase
443
470
 
444
471
  else
445
472
 
473
+ #trick
474
+ #rules[ :parent_application ] = parent if parent.type == 'vkb'
475
+
446
476
  # create test object
447
477
  test_object = MobyBase::TestObject.new(
448
478
 
@@ -467,18 +497,18 @@ module MobyBase
467
497
  obj_type << ';*' unless obj_type == 'application'
468
498
 
469
499
  # apply behaviours to test object
470
- MobyBase::BehaviourFactory.instance.apply_behaviour!(
500
+ TDriver::BehaviourFactory.apply_behaviour(
471
501
 
472
- :object => test_object,
473
- :object_type => [ *obj_type.split(';') ],
474
- :input_type => [ '*', sut.input.to_s ],
475
- :env => [ '*', *env.to_s.split(";") ],
476
- :version => [ '*', sut.ui_version.to_s ]
502
+ :object => test_object,
503
+ :object_type => [ *obj_type.split(';') ],
504
+ :input_type => [ '*', sut.input.to_s ],
505
+ :env => [ '*', *env.to_s.split(";") ],
506
+ :version => [ '*', sut.ui_version.to_s ]
477
507
 
478
508
  )
479
509
 
480
510
  # create child accessors
481
- test_object_adapter.create_child_accessors!( xml_object, test_object )
511
+ #test_object_adapter.create_child_accessors!( xml_object, test_object )
482
512
 
483
513
  # add created test object to parents child objects cache, unless explicitly disabled
484
514
  parent_cache.add_object( test_object ) unless identification_directives[ :__no_caching ] == true
@@ -95,6 +95,38 @@ module TDriver
95
95
 
96
96
  end # xpath_attributes
97
97
 
98
+ #merges elements from the nodeset, used in hybrid app situations
99
+ def create_merged_element(nodeset, environments, close_element=true)
100
+ merged_element_set = false
101
+
102
+ merged_xml = ""
103
+
104
+ nodeset.each{ | object |
105
+
106
+ # only one top element
107
+ unless merged_element_set
108
+
109
+ # retrieve object attributes
110
+ attributes = object.attributes
111
+
112
+ # merge env to attributes hash
113
+ attributes['env'] = environments.join(';')
114
+
115
+ # add application object xml element to new xml string
116
+ merged_xml << "<obj #{ hash_to_element_attributes( attributes ) }>"
117
+
118
+ # merged element is now set, no need to do it again
119
+ merged_element_set = true
120
+
121
+ end
122
+
123
+ # append all found elements
124
+ object.xpath('./*').each{ | object | merged_xml << object.to_s }
125
+ }
126
+ merged_xml << "</obj>" if close_element and merged_element_set
127
+ merged_xml
128
+ end
129
+
98
130
  # TODO: document me
99
131
  def initialize_class
100
132
 
@@ -341,11 +373,13 @@ module TDriver
341
373
  # TODO: document me
342
374
  def self.test_object_element_attributes( source_data )
343
375
 
344
- Hash[
345
- source_data.attributes.collect{ | key, value |
346
- [ key.to_s, value.to_s ]
347
- }
348
- ]
376
+ #Hash[
377
+ # source_data.attributes.collect{ | key, value |
378
+ # [ key.to_s, value.to_s ]
379
+ # }
380
+ #]
381
+
382
+ source_data.attributes
349
383
 
350
384
  end
351
385
 
@@ -439,50 +473,51 @@ module TDriver
439
473
 
440
474
  # TODO: document me
441
475
  def self.test_object_attributes( source_data, inclusive_filter = [] )
442
-
476
+
443
477
  # convert all keys to lowercase
444
478
  inclusive_filter.collect!{ | key | key.to_s.downcase } unless inclusive_filter.empty?
445
-
479
+
446
480
  # return hash of test object attributes
447
- Hash[
481
+ object_attributes = {}
448
482
 
449
- # iterate each attribute and collect name and value
450
- source_data.xpath( 'attr' ).collect{ | value |
483
+ # iterate each attribute and collect name and value
484
+ source_data.xpath( 'attr' ).collect{ | value |
451
485
 
452
486
  # retrieve attribute name
453
487
  name = value.attribute('name').to_s
454
488
 
455
489
  # collect attribute elements name and content
456
490
  unless inclusive_filter.empty?
457
-
458
- [ name, value.content ] if inclusive_filter.include?( name.downcase )
459
-
460
- else
461
491
 
492
+ object_attributes[name]=value.content if inclusive_filter.include?( name.downcase )
493
+
494
+ else
462
495
  # pass the attribute pair - no filtering done
463
- [ name, value.content ]
464
-
496
+ if object_attributes[name]
497
+ object_attributes[name]="#{object_attributes[name]},#{value.content}"
498
+ else
499
+ object_attributes[name]=value.content
500
+ end
465
501
  end
466
502
 
467
503
  }
468
504
 
469
- ]
505
+ object_attributes
470
506
 
471
507
  end
472
508
 
473
509
  # TODO: document me
474
510
  def self.application_layout_direction( sut )
475
511
 
476
- # temporary fix until testobject will be associated to parent application object
477
- unless MobyUtil::DynamicAttributeFilter.instance.has_attribute?( 'layoutDirection' )
478
-
479
- # temporary fix: add 'layoutDirection' to dynamic attributes filtering whitelist...
480
- MobyUtil::DynamicAttributeFilter.instance.add_attribute( 'layoutDirection' )
481
-
512
+ # temporary fix until testobject will be associated to parent application object; add 'layoutDirection' to dynamic attributes filtering whitelist...
513
+ TDriver::AttributeFilter.add_attribute( 'layoutDirection' ){
514
+
515
+ # this block will be executed if attribute was not in filter list
516
+
482
517
  # temporary fix: ... and refresh sut to retrieve updated xml data
483
518
  sut.refresh
484
-
485
- end
519
+
520
+ }
486
521
 
487
522
  # TODO: parent application test object should be passed to get_test_objects; TestObjectAdapter#test_object_attribute( @app.xml_data, 'layoutDirection')
488
523
  #( sut.xml_data.at_xpath('*//obj[@type="application"]/attr[@name="layoutDirection"]/text()').content || 'LeftToRight' ).to_s
@@ -528,14 +563,17 @@ module TDriver
528
563
 
529
564
  # TODO: document me
530
565
  def self.state_object_xml( source_data, id )
531
-
566
+
532
567
  # collect each object from source xml
533
- objects = source_data.xpath( 'tasInfo/obj' ).collect{ | element | element.to_s }.join
534
-
568
+ #objects = source_data.xpath( 'tasInfo/obj' ).collect{ | element | element.to_s }.join
569
+
570
+ # return xml root element
571
+ #MobyUtil::XML.parse_string(
572
+ # "<sut name='sut' type='sut' id='#{ id }'>#{ objects }</sut>"
573
+ #).root
574
+
535
575
  # return xml root element
536
- MobyUtil::XML.parse_string(
537
- "<sut name='sut' type='sut' id='#{ id }'>#{ objects }</sut>"
538
- ).root
576
+ MobyUtil::XML.parse_string( "<sut name='sut' type='sut' id='#{ id }'>#{ source_data.xpath('tasInfo/obj').inject(""){ | result, element | result << element.to_s; } }</sut>" ).root
539
577
 
540
578
  end
541
579
 
@@ -660,32 +698,17 @@ module TDriver
660
698
  # collect environment values
661
699
  environments = document_root.xpath('/tasMessage/tasInfo/obj[@type="application"]/@env').collect{ | attribute | attribute.to_s }
662
700
 
663
- # iterate through each object found in xml
664
- nodeset.each{ | object |
665
-
666
- # only one application element
667
- unless application_element_set
668
-
669
- #application_objects << object
670
-
671
- # retrieve object attributes
672
- attributes = object.attributes
673
-
674
- # merge env to attributes hash
675
- attributes['env'] = environments.join(';')
676
-
677
- # add application object xml element to new xml string
678
- new_xml << "<obj #{ hash_to_element_attributes( attributes ) }>"
679
-
680
- # application element is now set, no need to do it again
681
- application_element_set = true
682
-
683
- end
684
-
685
- # append all found elements
686
- object.xpath('./*').each{ | object | new_xml << object.to_s }
687
-
688
- }
701
+ #limit to apps
702
+ nodeset = document_root.xpath('/tasMessage/tasInfo/obj[@type="application"]')
703
+ close_vkb = false
704
+ if nodeset.count > 0
705
+ new_xml << create_merged_element(nodeset, environments, false)
706
+ close_vkb = true
707
+ end
708
+ # do the same to the vkbs
709
+ environments = document_root.xpath('/tasMessage/tasInfo/obj[@type="vkb_app"]/@env').collect{ | attribute | attribute.to_s }
710
+ nodeset = document_root.xpath('/tasMessage/tasInfo/obj[@type="vkb_app"]')
711
+ new_xml << create_merged_element(nodeset, environments, close_vkb)
689
712
 
690
713
  # multiple applications found, return merged application xml
691
714
  new_xml << "</obj></tasInfo></tasMessage>"
data/lib/tdriver/env.rb CHANGED
File without changes
File without changes
data/lib/tdriver/matti.rb CHANGED
File without changes
@@ -45,6 +45,7 @@ module TDriverErrorRecovery
45
45
  # === raises
46
46
  def start_error_recovery()
47
47
  resetted=false
48
+ initialize_error_recovery if @recovery_settings==nil
48
49
  if @recovery_settings.get_error_recovery_enabled=='true'
49
50
  MobyUtil::Logger.instance.log "behaviour" , "PASS;Starting error recovery"
50
51
  if @recovery_settings.get_reconnect_device=='true'
@@ -48,6 +48,7 @@ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_cucumber_
48
48
  require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_rspec' ) )
49
49
  require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_test_unit' ) )
50
50
  require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_grouping' ) )
51
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_graph_generator' ) )
51
52
  require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_execution_statistics' ) )
52
53
  require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_data_presentation' ) )
53
54
 
@@ -57,4 +58,4 @@ unless $parameters[ :custom_error_recovery_module, nil ].nil?
57
58
 
58
59
  end
59
60
 
60
- include TDriverReportAPI
61
+ #include TDriverReportAPI
@@ -64,6 +64,18 @@ class TDriverReportCrashFileCapture
64
64
  end
65
65
  end
66
66
 
67
+ def confirm_crash_notes
68
+ MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
69
+ if sut_attributes[:is_connected]
70
+ @crash_file_suts.each do |monitored_sut|
71
+ if monitored_sut == sut_id.to_s
72
+ sut_attributes[:sut].clear_crash_notes(5)
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
78
+
67
79
  def list_sut_crash_files(current_sut)
68
80
  crash_file_arr=Array.new
69
81
  @crash_file_count=0
@@ -286,6 +286,10 @@ module TDriverReportCreator
286
286
  $new_test_case.clean_crash_files_from_sut()
287
287
  $tdriver_reporter.set_total_crash_files(amount_of_crash_files.to_i)
288
288
  $new_test_case.set_test_case_crash_files(amount_of_crash_files.to_i)
289
+ else
290
+ if $parameters[ :report_crash_file_monitor_confirm_any_crash_note, false ]=='true'
291
+ $new_test_case.confirm_crash_notes
292
+ end
289
293
  end
290
294
 
291
295
  amount_of_files=$new_test_case.check_if_files_exist()
@@ -316,7 +320,7 @@ module TDriverReportCreator
316
320
 
317
321
  each_video_device do | video_device, device_index |
318
322
  begin
319
- FileUtils.copy( "cam_" + device_index + "_" + @_video_file_name, "cam_" + device_index + "_" + @_previous_video_file_name )
323
+ FileUtils.mv( "cam_" + device_index + "_" + @_video_file_name, "cam_" + device_index + "_" + @_previous_video_file_name )
320
324
  rescue
321
325
  # do nothing..
322
326
  end
@@ -344,7 +348,7 @@ module TDriverReportCreator
344
348
  # === raises
345
349
  def update_test_case(details)
346
350
  if $new_test_case==nil
347
- @_stored_details<<details
351
+ @_stored_details << details
348
352
  else
349
353
  if @_stored_details!=[]
350
354
  @_stored_details.each do |detail|
@@ -122,12 +122,13 @@ class ReportingStatistics
122
122
  total_run=0
123
123
  total_not_run=0
124
124
  total_passed=0
125
- @statistics_arr.each do |total_status|
126
- if total_status[1]==tc_status && total_status[0]==tc_name
125
+ total_not_run_index=0
126
+ total_passed_index=0
127
+ pass_rate_index=0
128
+ @statistics_arr.each do |total_status|
129
+ if total_status[1]==tc_status && total_status[0]==tc_name
127
130
  b_test_in_statistics=true
128
131
  @statistics_arr[current_index]=[tc_name,tc_status,total_status[2].to_i+1,tc_execution,tc_link]
129
- total_passed=total_status[2].to_i+1 if @pass_statuses.include?(total_status[1])
130
- total_not_run=total_status[2].to_i+1 if @not_run_statuses.include?(total_status[1])
131
132
  end
132
133
  if total_status[1]=="reboots" && total_status[0]==tc_name
133
134
  b_test_in_statistics=true
@@ -164,17 +165,32 @@ class ReportingStatistics
164
165
  end
165
166
  if total_status[1]=="pass rate" && total_status[0]==tc_name
166
167
  b_test_in_statistics=true
167
- pass_rate=(total_passed.to_f/(total_run.to_f-total_not_run.to_f))*100
168
- pass_rate="%0.2f" % pass_rate
169
- @statistics_arr[current_index]=[tc_name,"pass rate",pass_rate,tc_execution,tc_link]
168
+ pass_rate_index=current_index
169
+ end
170
+ if @pass_statuses.include?(total_status[1]) && total_status[0]==tc_name
171
+ total_passed_index=current_index
172
+ end
173
+ if @not_run_statuses.include?(total_status[1]) && total_status[0]==tc_name
174
+ total_not_run_index=current_index
170
175
  end
171
176
  current_index+=1
172
177
  end
178
+
179
+ if b_test_in_statistics==true
180
+ total_passed_result=@statistics_arr[total_passed_index]
181
+ total_not_run_result=@statistics_arr[total_not_run_index]
182
+ total_passed=total_passed_result[2].to_i
183
+ total_not_run=total_not_run_result[2].to_i
184
+ pass_rate=(total_passed.to_f/(total_run.to_f-total_not_run.to_f))*100
185
+ pass_rate="%0.2f" % pass_rate
186
+ @statistics_arr[pass_rate_index]=[tc_name,"pass rate",pass_rate,tc_execution,tc_link]
187
+ end
188
+
173
189
  b_test_in_statistics
174
190
  end
175
191
 
176
192
  def collect_test_case_statistics()
177
- total_duration = 0.0
193
+ total_duration = 0.0
178
194
  @group_test_case_arr.each do |test_case|
179
195
  tc_status=test_case[7]
180
196
  tc_name=test_case[0].to_s.gsub('_',' ')
@@ -188,7 +204,7 @@ class ReportingStatistics
188
204
  memory_usage=test_case[6].to_i
189
205
 
190
206
  duration=test_case[5].to_f
191
- total_duration = total_duration + duration
207
+ total_duration = total_duration + duration
192
208
  b_test_in_statistics=false
193
209
 
194
210
  #Update total statistics
@@ -290,8 +306,8 @@ class ReportingStatistics
290
306
  @statistics_arr.each do |test_case|
291
307
  tc_name=test_case[0].to_s.gsub('_',' ')
292
308
  if test_case_added.include?(tc_name)==false && test_case[1].to_s=="duration"
293
- durations << test_case[2]
294
- labels[current_index] = "#{current_index + 1}" #tc_name
309
+ durations << test_case[2]
310
+ labels[current_index] = "#{current_index + 1}" #tc_name
295
311
  current_index += 1
296
312
  test_case_added << tc_name
297
313
  end