1. 24 4月, 2018 1 次提交
  2. 08 4月, 2018 1 次提交
  3. 19 3月, 2018 1 次提交
  4. 27 2月, 2018 1 次提交
    • Z
      Uses the absolute path for system test screenshots · fc778164
      Zamith 提交于
      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
      fc778164
  5. 16 1月, 2018 1 次提交
  6. 10 12月, 2017 1 次提交
  7. 08 12月, 2017 1 次提交
  8. 29 11月, 2017 1 次提交
    • E
      Make screenshots default to "simple" format · 9d6e288e
      eileencodes 提交于
      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
      9d6e288e
  9. 06 11月, 2017 1 次提交
  10. 04 11月, 2017 1 次提交
  11. 28 10月, 2017 1 次提交
  12. 17 10月, 2017 1 次提交
  13. 08 10月, 2017 1 次提交
  14. 18 9月, 2017 1 次提交
  15. 27 8月, 2017 1 次提交
    • Y
      Retrive screenshot in relative path of current directory · 52422f2a
      yuuji.yaginuma 提交于
      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
      52422f2a
  16. 26 8月, 2017 1 次提交
    • Y
      Fix `can't modify frozen String` error in `display_image` · 1fe777ef
      yuuji.yaginuma 提交于
      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>'
      ```
      1fe777ef
  17. 22 8月, 2017 1 次提交
  18. 19 8月, 2017 1 次提交
  19. 29 7月, 2017 1 次提交
  20. 08 7月, 2017 1 次提交
    • E
      Don't call register on custom drivers · 91d22b78
      eileencodes 提交于
      It's possible for developers toadd a custom driver and then call it
      using `driven_by`. Because we were only skipping `register` for
      `:rack_test` that meant any custom driver would attempt to be registered
      as well.
      
      The three listed here are special because Rails registers them with
      special options. If you're registering your own custom driver then you
      don't want to separately register that driver.
      
      Fixes #29688
      91d22b78
  21. 02 7月, 2017 1 次提交
  22. 01 7月, 2017 2 次提交
  23. 25 6月, 2017 1 次提交
    • S
      Add an option to silence puma in system tests. · eba36182
      Sam Phippen 提交于
      This is motivated by our usage of system test in RSpec. Puma lazily
      boots the first time a system test is used, but this causes some
      unfortunate output to appear in the middle of the user's green dots. An
      example of this can be seen in @derekprior's comment
      [here](https://github.com/rspec/rspec-rails/pull/1813#issuecomment-309252314).
      
      There are alternatives in RSpec where we attempt to intercept the puma
      boot and prevent the output from being made there, but that would
      involve some monkey patching. This seems like a cleaner solution.
      eba36182
  24. 03 6月, 2017 1 次提交
  25. 02 4月, 2017 1 次提交
  26. 14 3月, 2017 1 次提交
  27. 13 3月, 2017 1 次提交
    • F
      Pass options to `driven_by` · ec99107a
      Fumiaki MATSUSHIMA 提交于
      Capybara drivers can handle some options such like `url`.
      
      ### before
      
      ```
      # test/test_helper.rb
      Capybara.register_driver :remote_chrome do |app|
        Capybara::Selenium::Driver.new(app, browser: :chrome, url: "http://example.com/wd/hub")
      end
      
      # test/application_system_test_case.rb
      class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
        driven_by :remote_chrome
      end
      ```
      
      ### after
      
      ```
      # test/application_system_test_case.rb
      class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
        driven_by :selenium, using: :chrome, screen_size: [1400, 1400], options: {url: "http://chrome:4444/wd/hub"}
      end
      ```
      ec99107a
  28. 12 3月, 2017 1 次提交
    • R
      Dont always display inline screenshots in system testing (#28133) · 79435c0e
      Renaud Chaput 提交于
      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
      79435c0e
  29. 09 3月, 2017 2 次提交
    • E
      Call system test driver per-instance rather than globally · 7c9af60e
      eileencodes 提交于
      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.
      7c9af60e
    • E
      Refactor system test driver/browser · 4dbebe48
      eileencodes 提交于
      Since using a browser is only for selenium it doesn't really make sense
      to have a separate class for handling it there. This brings a lot of the
      if/else out of the main SystemTestCase class and into the Driver class
      so we can abstract away all that extra work.
      4dbebe48
  30. 05 3月, 2017 1 次提交
  31. 04 3月, 2017 2 次提交
  32. 03 3月, 2017 1 次提交
  33. 28 2月, 2017 1 次提交
    • Y
      Take failed screenshot before reset driver · 3da239a2
      yuuji.yaginuma 提交于
      Now reset the driver before take failed screenshot since #28144.
      However, I think that failed screenshot should be take with the driver
      actually used in the test.
      So, fixed to take screenshot before reset driver.
      3da239a2
  34. 25 2月, 2017 1 次提交
  35. 23 2月, 2017 1 次提交
  36. 21 2月, 2017 2 次提交
    • E
      Rename system_test_helper -> application_system_test_case · 2d61c5d8
      eileencodes 提交于
      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.
      2d61c5d8
    • E
      Fix default host in setup, move teardown to helper file · 161cf89e
      eileencodes 提交于
      * Override integration test default host
      
      Integration tests automatically set the default host to
      'http://example.com'. This works fine for integration tests because they
      are not real browser sessions, but doesn't work fine for system tests
      because they are real browser sessions.
      
      We can override this by setting the `host!` in `before_setup. The
      `Capybara.always_include_port` will allow the test to look at
      `127.0.0.1:port capybara picks` and properly redirect the test.
      
      Any application can override this by setting the `host!` in
      their system test helper. Generally though, applications are going to be
      using localhost.
      
      In this commit I also moved the setup and teardown into their own module
      for tidiness.
      
      * Move teardown settings into system test case
      
      These configuration options can be put into the system test case file
      instead of the generated system tests helper file. This is an
      implementation detail and therefore shouldn't be generated with the
      template.
      161cf89e