aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb
Commit message (Collapse)AuthorAgeFilesLines
* Uses the absolute path for system test screenshotsZamith2018-02-271-1/+1
| | | | | | | | | | | | | Why: * When getting an error that generates a screenshot it would be helpful to be able to ctrl+click it to quickly open it in the browser, which does not work with relative paths This change addresses the need by: * Changing `image_path` to disregard the relative path and use the absolute one instead
* Make screenshots default to "simple" formateileencodes2017-11-291-10/+6
| | | | | | | | | Not everyone uses iTerm2 and whereas Terminal.app on a mac just ignores that and outputs the path, other terminals like those on Ubuntu do not. A friendlier default is one that works by default. Closes #31159 Closes #30957
* Retrive screenshot in relative path of current directoryyuuji.yaginuma2017-08-271-5/+9
| | | | | | | | | | In Rails engine `Rails.root `returns the path of the dummy application. Therefore, there is no `tmp` directly where the test is running, so can not get the screenshot. For this reason, instead of directly specifying tmp, retrive screenshot by relative path from the current directory. Fixes #30405
* Fix `can't modify frozen String` error in `display_image`yuuji.yaginuma2017-08-261-1/+1
| | | | | | | | | | Without this, `display_image` raises an error as follwing: ``` RuntimeError: can't modify frozen String rails/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:72:in `display_image' rails/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb:40:in `block (2 levels) in <class:ScreenshotHelperTest>' ```
* Update links to use https link instead of http [ci skip]Yoshiyuki Hirano2017-08-221-1/+1
|
* Use ssl in guide and comment [ci skip]Yoshiyuki Hirano2017-08-191-1/+1
|
* Use frozen string literal in actionpack/Kir Shatrov2017-07-291-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Merge pull request #28394 from shime/docs-action-dispatchXavier Noria2017-03-221-1/+1
|\ | | | | [docs] fix ActionDispatch documentation
| * [docs] fix ActionDispatch documentationHrvoje Šimić2017-03-131-1/+1
| |
* | Dont always display inline screenshots in system testing (#28133)Renaud Chaput2017-03-111-5/+34
|/ | | | | | | | | 3 output types are supported: - simple: only display the screenshot path - artifact: display the screenshot in the terminal, using the artifact protocol (supported by some CI) - inline (default): display the screenshot in the terminal, inline (supported by some terminals) You can force the output type by setting the `RAILS_SYSTEM_TESTING_SCREENSHOT` environment variable
* Call system test driver per-instance rather than globallyeileencodes2017-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | Previously the system test subclasses would call `driven_by` when the app booted and not again when the test was initialized which resulted in the driver from whichever class was called last to be used in tests. In rails/rails#28144 the `driven_by` method was changed to run `use` on setup and `reset` on teardown. While this was a viable fix this really pointed to the problem that system test `driven_by` was a global setting, rather than a per-class setting. To alieviate this problem calling the driver should be done on an instance level, rather than on the global level. I added an `initialize` method to `SystemTestCase` which will call `use` on the superclass driver. Running the server has been moved to `start_application` so that it only needs to be called once on boot and no options from `driven_by` were being passed to it. This required a largish rewrite of the tests. Each test needs to utilize the subclass so that it can properly test the drivers. `ActionDispatch::SystemTestCase` shouldn't be called directly anymore.
* Do not take screenshot if driver does not support screenshotyuuji.yaginuma2017-03-041-1/+5
| | | | | | | | | | | | | `Capybara::RackTest::Driver` does not support taking screenshots. If call `#save_screenshot` on `Capybara::RackTest::Driver` will raise the error. ```ruby Error: UsersTest#test_visiting_the_index: Capybara::NotSupportedByDriverError: Capybara::Driver::Base#save_screenshot ``` To prevent errors, if driver does not support screenshot, do not call it.
* Do not take screenshot when test skippedyuuji.yaginuma2017-02-231-2/+6
|
* Rename system_test_helper -> application_system_test_caseeileencodes2017-02-201-3/+3
| | | | | | This renames the system test helper file to be application system test case to match what the rest of Rails does. In the future we should consider changing the test_helper to match.
* Fix screenshot helper to provide correct file nameeileencodes2017-02-201-2/+6
| | | | | We only want the file name to include the word `failures` if it failed, not any time the user wants to take a screenshot during a test run.
* Move and rename system testseileencodes2017-02-201-0/+53
* Move system tests back into Action Pack * Rename `ActionSystemTest` to `ActionDispatch::SystemTestCase` * Remove private base module and only make file for public `SystemTestCase` class, name private module `SystemTesting` * Rename `ActionSystemTestCase` to `ApplicationSystemTestCase` * Update corresponding documentation and guides * Delete old `ActionSystemTest` files