Module: RSpec::Rails::SystemExampleGroup

Extended by:
ActiveSupport::Concern
Includes:
ActionController::TemplateAssertions, ActionDispatch::Assertions, ActionDispatch::Integration::Runner, Matchers::RedirectTo, Matchers::RenderTemplate, RailsExampleGroup
Defined in:
lib/rspec/rails/example/system_example_group.rb

Overview

Container class for system tests

Constant Summary collapse

CHARS_TO_TRANSLATE =

Special characters to translate into underscores for #method_name

['/', '.', ':', ',', "'", '"', " "].freeze
DEFAULT_DRIVER =

Default driver to assign if none specified.

if ::Rails::VERSION::STRING.to_f >= 7.2
  :selenium_chrome_headless
else
  :selenium
end

Instance Method Summary collapse

Methods included from Matchers::RenderTemplate

#have_rendered

Methods included from Matchers::RedirectTo

#redirect_to

Instance Method Details

#appObject

Delegates to Rails.application.



94
95
96
# File 'lib/rspec/rails/example/system_example_group.rb', line 94

def app
  ::Rails.application
end

#passed?Boolean

for the SystemTesting Screenshot situation

Returns:

  • (Boolean)


29
30
31
32
33
34
35
36
37
# File 'lib/rspec/rails/example/system_example_group.rb', line 29

def passed?
  return false if RSpec.current_example.exception
  return true unless defined?(::RSpec::Expectations::FailureAggregator)

  failure_notifier = ::RSpec::Support.failure_notifier
  return true unless failure_notifier.is_a?(::RSpec::Expectations::FailureAggregator)

  failure_notifier.failures.empty? && failure_notifier.other_errors.empty?
end