Class | Selenium::RSpec::SeleniumTestReportFormatter |
In: |
lib/selenium/rspec/reporting/selenium_test_report_formatter.rb
|
Parent: | Spec::Runner::Formatter::HtmlFormatter |
Should be called from config.after(:each) in spec helper
# File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 66 66: def self.capture_system_state(selenium_driver, example) 67: system_capture = Selenium::RSpec::Reporting::SystemCapture.new(selenium_driver, example, file_path_strategy) 68: system_capture.capture_system_state 69: end
# File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 79 79: def self.file_path_strategy 80: ### HACK #### 81: # When running with DeepTest the class instance variable could not have been set 82: # For now you must set the env variable before launching the tests. We need to revisit the way DeepTest 83: # and RSpec reporting work for a proper fix. 84: @@file_path_strategy ||= Selenium::RSpec::Reporting::FilePathStrategy.new(ENV["SELENIUM_TEST_REPORT_FILE"]) 85: end
# File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 49 49: def example_failed(example, counter, failure) 50: include_example_group_description example 51: 52: old_output = @output 53: @output = StringIO.new 54: super 55: 56: result = @output.string 57: report = Selenium::RSpec::Reporting::HtmlReport.new(@@file_path_strategy) 58: report.replace_placeholder_with_system_state_content(result, example) 59: old_output.puts result 60: old_output.flush 61: ensure 62: @output = old_output 63: end
# File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 39 39: def example_passed(example) 40: include_example_group_description example 41: super 42: end
# File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 44 44: def example_pending(example, message, pending_caller) 45: include_example_group_description example 46: super 47: end
# File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 35 35: def extra_failure_content(failure) 36: Selenium::RSpec::Reporting::HtmlReport.inject_placeholder(super) 37: end
# File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 71 71: def global_scripts 72: Selenium::RSpec::Reporting::HtmlReport.append_javascript(super) 73: end
# File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 75 75: def global_styles 76: Selenium::RSpec::Reporting::HtmlReport.append_css(super) 77: end
# File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 31 31: def move_progressmove_progress 32: # we don't have current_example_number, and we don't really care about the progress bar 33: end
# File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 21 21: def start(example_count) 22: super 23: # ensure there's at least 1 example group header (normally 0 with deep_test) 24: # prevents js and html validity errors 25: example_group = Object.new 26: def example_group.description; ""; end 27: add_example_group(example_group) 28: @@file_path_strategy = Selenium::RSpec::Reporting::FilePathStrategy.new(@where) 29: end