Class | Selenium::RSpec::SeleniumTestReportFormatter
In: | lib/selenium/rspec/reporting/selenium_test_report_formatter.rb
Parent: | Spec::Runner::Formatter::HtmlFormatter

### Methods

capture_system_state example_failed example_pending extra_failure_content file_path_strategy global_scripts global_styles move_progress new start

### Public Class methods

capture_system_state(selenium_driver, example)

Should be called from config.after(:each) in spec helper

[Source]

        # File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 64
    64:       def self.capture_system_state(selenium_driver, example)
    65:         system_capture = Selenium::RSpec::Reporting::SystemCapture.new(selenium_driver, example, file_path_strategy)
    66:         system_capture.capture_system_state
    67:       end

file_path_strategy()

[Source]

        # File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 77
    77:       def self.file_path_strategy
    78:               ### HACK ####
    79:               # When running with DeepTest the class instance variable could not have been set
    80:               # For now you must set the env variable before launching the tests. We need to revisit the way DeepTest
    81:               # and RSpec reporting work for a proper fix.
    82:               @@file_path_strategy ||= Selenium::RSpec::Reporting::FilePathStrategy.new(ENV["SELENIUM_TEST_REPORT_FILE"])
    83:             end

new(options, output)

[Source]

        # File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 22
    22:       def initialize(options, output)
    23:         super
    24:         raise "Unexpected output type #{output.inspect}" unless output.kind_of?(String)
    25:         @@file_path_strategy = Selenium::RSpec::Reporting::FilePathStrategy.new(output)
    26:       end

### Public Instance methods

example_failed(example, counter, failure)

[Source]

        # File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 49
    49:       def example_failed(example, counter, failure)
    50:         old_output = @output
    51:         @output = StringIO.new
    52:         super
    53:
    54:         result = @output.string
    55:         report = Selenium::RSpec::Reporting::HtmlReport.new(@@file_path_strategy)
    56:         report.replace_placeholder_with_system_state_content(result, example)
    57:         old_output.puts result
    58:         old_output.flush
    59:       ensure
    60:         @output = old_output
    61:       end

example_pending(example_proxy, message, deprecated_pending_location=nil)

[Source]

        # File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 45
    45:       def example_pending(example_proxy, message, deprecated_pending_location=nil)
    46:         super
    47:       end

extra_failure_content(failure)

[Source]

        # File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 41
    41:       def extra_failure_content(failure)
    42:         Selenium::RSpec::Reporting::HtmlReport.inject_placeholder(super)
    43:       end

global_scripts()

[Source]

        # File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 69
    69:       def global_scripts
    70:         Selenium::RSpec::Reporting::HtmlReport.append_javascript(super)
    71:       end

global_styles()

[Source]

        # File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 73
    73:       def global_styles
    74:         Selenium::RSpec::Reporting::HtmlReport.append_css(super)
    75:       end

move_progress()

[Source]

        # File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 37
    37:       def  move_progressmove_progress
    38:         # we don't have current_example_number, and we don't really care about the progress bar
    39:       end

start(example_count)

[Source]

        # File lib/selenium/rspec/reporting/selenium_test_report_formatter.rb, line 28
    28:       def start(example_count)
    29:         super
    30:         # ensure there's at least 1 example group header (normally 0 with deep_test)
    31:         # prevents js and html validity errors
    32:         example_group = Object.new
    33:         def example_group.description; ""; end
    34:         example_group_started example_group
    35:       end

[Validate]