Permalink
Browse files

Clean up documentation

There were some grammar issues and incorrect information in the system
tests documentation.
  • Loading branch information...
eileencodes committed Feb 20, 2017
1 parent 2d61c5d commit 42a6dbdf8480b96c4a0ac6e1dab215ae9dd77d1d
Showing with 17 additions and 16 deletions.
  1. +10 −9 actionpack/lib/action_dispatch/system_test_case.rb
  2. +7 −7 guides/source/testing.md
@@ -10,7 +10,7 @@ module ActionDispatch
class SystemTestCase < IntegrationTest
# = System Testing
#
- # System tests let you test real application in the browser. Because system
+ # System tests let you test applications in the browser. Because system
# tests use a real browser experience you can test all of your JavaScript
# easily from your test suite.
#
@@ -36,10 +36,10 @@ class SystemTestCase < IntegrationTest
# end
# end
#
- # When generating an application or scaffold a +application_system_test_case.rb+ will also
- # be generated containing the base class for system testing. This is where you
- # can change the driver, add Capybara settings, and other configuration for
- # your system tests.
+ # When generating an application or scaffold a +application_system_test_case.rb+
+ # file will also be generated containing the base class for system testing.
+ # This is where you can change the driver, add Capybara settings, and other
+ # configuration for your system tests.
#
# require "test_helper"
#
@@ -51,7 +51,7 @@ class SystemTestCase < IntegrationTest
# Selenium driver, with the Chrome browser, and a browser size of 1400x1400.
#
# Changing the driver configuration options are easy. Let's say you want to use
- # and the Firefox browser instead. In your +application_system_test_case.rb+
+ # the Firefox browser instead of Chrome. In your +application_system_test_case.rb+
# file add the following:
#
# require "test_helper"
@@ -61,8 +61,9 @@ class SystemTestCase < IntegrationTest
# end
#
# +driven_by+ has a required argument for the driver name. The keyword
- # arguments are +:using+ for the browser (not applicable for headless drivers),
- # and +:screen_size+ to change the size of the screen taking screenshots.
+ # arguments are +:using+ for the browser and +:screen_size+ to change the
+ # size of the browser screen. These two options are not applicable for
+ # headless drivers and will be silently ignored if passed.
#
# To use a headless driver, like Poltergeist, update your Gemfile to use
# Poltergeist instead of Selenium and then declare the driver name in the
@@ -93,7 +94,7 @@ def self.start_application # :nodoc:
# System Test configuration options
#
- # The defaults settings are Selenium, using Chrome, with a screen size
+ # The default settings are Selenium, using Chrome, with a screen size
# of 1400x1400.
#
# Examples:
View
@@ -628,8 +628,8 @@ end
```
By default, system tests are run with the Selenium driver, using the Chrome
-browser, on port 21800 with Puma, and a screen size of 1400x1400. The next
-section explains how to change the default settings.
+browser, and a screen size of 1400x1400. The next section explains how to
+change the default settings.
### Changing the default settings
@@ -654,15 +654,15 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
end
```
-If you want to keep the Selenium driver but change the browser or port you
+If you want to keep the Selenium driver but change the browser you
can pass Firefox and the port to driven by. The driver is a required
argument, all other arguments are optional.
```ruby
require "test_helper"
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
- driven_by :selenium, using: :firefox, on: 3000
+ driven_by :selenium, using: :firefox
end
```
@@ -680,13 +680,13 @@ for additional settings.
### Screenshot Helper
-The `ScreenshotHelper` is a helper designed to capture screenshots of your test.
+The `ScreenshotHelper` is a helper designed to capture screenshots of your tests.
This can be helpful for viewing the browser at the point a test failed, or
to view screenshots later for debugging.
Two methods are provided: `take_screenshot` and `take_failed_screenshot`.
-`take_failed_screenshot` is automatically included in the `application_system_test_case.rb`
-file and will take a screenshot only if the test fails.
+`take_failed_screenshot` is automatically included in `after_teardown` inside
+Rails.
The `take_screenshot` helper method can be included anywhere in your tests to
take a screenshot of the browser.

0 comments on commit 42a6dbd

Please sign in to comment.