diff options
author | eileencodes <eileencodes@gmail.com> | 2016-09-11 17:00:26 -0400 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2017-02-20 15:07:32 -0500 |
commit | b44320254167152383b1fa8792cb17847a51fb49 (patch) | |
tree | f9a7eede21e9feadfd62914f5118fa4feac7a297 /actionpack/lib/system_test_case.rb | |
parent | 9730b1dba6d1bb9684a54915ac3735d9c0eade26 (diff) | |
download | rails-b44320254167152383b1fa8792cb17847a51fb49.tar.gz rails-b44320254167152383b1fa8792cb17847a51fb49.tar.bz2 rails-b44320254167152383b1fa8792cb17847a51fb49.zip |
Add documentation for system tests
* Document Rails::SystemTestCase
* Document setting drivers with the configration options
* Document using the getter/setter for driver adapters
* Document the CapybaraRackTestDriver and defaults
* Document the CapybaraSeleniumDriver and defaults
* Document custom assertions provided by System Testing
* Document custom form helpers provided by System Testing
Diffstat (limited to 'actionpack/lib/system_test_case.rb')
-rw-r--r-- | actionpack/lib/system_test_case.rb | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/actionpack/lib/system_test_case.rb b/actionpack/lib/system_test_case.rb index 2072a88d22..be3858bba8 100644 --- a/actionpack/lib/system_test_case.rb +++ b/actionpack/lib/system_test_case.rb @@ -2,6 +2,51 @@ require 'system_testing/test_helper' require 'system_testing/driver_adapter' module Rails + # System tests are similar to Integration tests in that they incorporate multiple + # controllers and actions, but can be used to similate a real user experience. + # System tests are also known as Acceptance tests. + # + # To create a System Test in your application extend your test class from + # <tt>Rails::SystemTestCase</tt>. System tests use Capybara as a base and + # allows you to configure the driver. The default driver is RackTest. + # + # require 'test_helper' + # + # class Users::CreateTest < Rails::SystemTestCase + # def adding_a_new_user + # visit users_path + # click_on 'New User' + # + # fill_in 'Name', with: 'Arya' + # click_on 'Create User' + # + # assert_text 'Arya' + # end + # end + # + # System tests in your application can be configured to use different drivers. + # + # To specify a driver, add the following to your Rails' configuration file for + # the test environment. + # + # config.system_testing.driver = :capybara_selenium_driver + # + # You can also specify a driver with a new driver object. Through this method + # you can also change the default settings for the driver you're setting. + # + # config.system_testing.driver = SystemTesting::DriverAdapters::CapybaraRackTestDriver.new( + # useragent: 'My Useragent' + # ) + # + # A list of supported adapters can be found in DriverAdapters. + # + # If you want to use a driver that is not supported by Rails but is available + # in Capybara, you can override Rails settings and use Capybara directly by + # setting the +Capybara.default_driver+ and +Capybara.javascript_driver+ in + # your test_help file. + # + # You can also skip using Rails system tests completely by not inheriting from + # <tt>Rails::SystemTestCase</tt> and following Capybara's instructions. class SystemTestCase < ActionDispatch::IntegrationTest include SystemTesting::TestHelper include SystemTesting::DriverAdapter |