Class: SpecData
- Inherits:
-
Object
- Object
- SpecData
- Defined in:
- lib/spec_data.rb
Class Method Summary collapse
- .add_spec_stats_to_suite_stats ⇒ Object
- .clear_all_spec_stats ⇒ Object
- .clear_spec_state ⇒ Object
- .determine_spec_result ⇒ Object
- .execution_warnings ⇒ Object
- .load_spec_state ⇒ Object
- .load_suite_state ⇒ Object
- .reset_captured_screenshots ⇒ Object
- .screenshots_captured ⇒ Object
- .screenshots_message ⇒ Object
- .verification_errors ⇒ Object
Class Method Details
.add_spec_stats_to_suite_stats ⇒ Object
58 59 60 61 62 |
# File 'lib/spec_data.rb', line 58 def self.add_spec_stats_to_suite_stats $verifications_total += $verification_passes $warnings_total += execution_warnings.length $errors_total += verification_errors.length end |
.clear_all_spec_stats ⇒ Object
64 65 66 67 68 |
# File 'lib/spec_data.rb', line 64 def self.clear_all_spec_stats $verifications_total = 0 $warnings_total = 0 $errors_total = 0 end |
.clear_spec_state ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/spec_data.rb', line 15 def self.clear_spec_state execution_warnings.clear verification_errors.clear $verification_passes = 0 $fail_test_instantly = false $fail_test_at_end = false end |
.determine_spec_result ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/spec_data.rb', line 30 def self.determine_spec_result if execution_warnings.empty? Log.info("[GRIDIUM::SpecData] No warnings detected during test run.") else Log.info("[GRIDIUM::SpecData]Warnings detected during test run: (#{execution_warnings.length} total).") msg = "Warning detected during test execution:" execution_warnings.each { || msg << "\n\t" + } end if verification_errors.empty? Log.info("[GRIDIUM::SpecData]No errors detected during test run.") else Log.info("[GRIDIUM::SpecData]Errors detected during test run: (#{verification_errors.length} total).") msg = "TEST FAILURE: Errors detected during test execution:" verification_errors.each { || msg << "\n\t" + } end if $fail_test_instantly Log.info("[GRIDIUM::SpecData]TEST FAILED - CRITICAL ERROR DETECTED") Kernel.fail("TEST FAILED - CRITICAL ERROR DETECTED\n") elsif $fail_test_at_end Log.info("[GRIDIUM::SpecData]TEST FAILED - VERIFICATION ERRORS DETECTED") Kernel.fail("TEST FAILED - VERIFICATION ERRORS DETECTED\n") else Log.info("[GRIDIUM::SpecData]TEST PASSED\n") end end |
.execution_warnings ⇒ Object
78 79 80 |
# File 'lib/spec_data.rb', line 78 def self.execution_warnings @execution_warnings ||= Array.new end |
.load_spec_state ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/spec_data.rb', line 7 def self.load_spec_state execution_warnings verification_errors $verification_passes = 0 $fail_test_instantly = false $fail_test_at_end = false end |
.load_suite_state ⇒ Object
2 3 4 5 |
# File 'lib/spec_data.rb', line 2 def self.load_suite_state screenshots_captured end |
.reset_captured_screenshots ⇒ Object
23 24 25 26 27 28 |
# File 'lib/spec_data.rb', line 23 def self.reset_captured_screenshots .clear screenshots_captured.clear $screenshots_data = {} $fail_screenshot = nil end |
.screenshots_captured ⇒ Object
74 75 76 |
# File 'lib/spec_data.rb', line 74 def self.screenshots_captured @screenshots_captured ||= Array.new end |
.screenshots_message ⇒ Object
70 71 72 |
# File 'lib/spec_data.rb', line 70 def self. @screenshots_message ||= Array.new end |
.verification_errors ⇒ Object
82 83 84 |
# File 'lib/spec_data.rb', line 82 def self.verification_errors @verification_errors ||= Array.new end |