diff options
author | eileencodes <eileencodes@gmail.com> | 2016-10-02 15:22:27 -0400 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2017-02-20 15:07:33 -0500 |
commit | e9127f7aa082986952ffcc8331b675a3a99c3a83 (patch) | |
tree | 2d9445eb4693b8b0dccd29155581e2364ba174e1 /actionpack/test/system_testing/screenshot_helper_test.rb | |
parent | f482eddbeff9fe3d0dc6cdaa9a4b53df839f667c (diff) | |
download | rails-e9127f7aa082986952ffcc8331b675a3a99c3a83.tar.gz rails-e9127f7aa082986952ffcc8331b675a3a99c3a83.tar.bz2 rails-e9127f7aa082986952ffcc8331b675a3a99c3a83.zip |
Add support for screenshots
This change adds support, tests, and documentation for the screenshot
helper.
If taking screenshots is supported by the driver (for example Rack Test
doesn't support screenshots) then a screenshot will be taken if the test
fails.
Diffstat (limited to 'actionpack/test/system_testing/screenshot_helper_test.rb')
-rw-r--r-- | actionpack/test/system_testing/screenshot_helper_test.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/actionpack/test/system_testing/screenshot_helper_test.rb b/actionpack/test/system_testing/screenshot_helper_test.rb new file mode 100644 index 0000000000..8bf2d0c8d0 --- /dev/null +++ b/actionpack/test/system_testing/screenshot_helper_test.rb @@ -0,0 +1,20 @@ +require 'abstract_unit' + +class ScreenshotHelperTest < ActiveSupport::TestCase + def test_driver_support_for_screenshots + Rails::SystemTestCase.driver = :rails_selenium_driver + assert Rails::SystemTestCase.driver.supports_screenshots? + + Rails::SystemTestCase.driver = :rack_test + assert_not Rails::SystemTestCase.driver.supports_screenshots? + + Rails::SystemTestCase.driver = :selenium + assert Rails::SystemTestCase.driver.supports_screenshots? + + Rails::SystemTestCase.driver = :webkit + assert Rails::SystemTestCase.driver.supports_screenshots? + + Rails::SystemTestCase.driver = :poltergeist + assert Rails::SystemTestCase.driver.supports_screenshots? + end +end |