Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Turbo::SystemTestHelper #577

Merged

Commits on Sep 16, 2024

  1. Introduce Turbo::SystemTestHelper

    Introduce the `Turbo::SystemTestHelper` module to be included into
    [ActionDispatch::SystemTestCase][] when it's available.
    
    The module is named to mimic [ActionText::SystemTestHelper][].
    
    The module defines a `#connect_turbo_cable_stream_sources` helper
    method extracted from this project's System Test suite. It aims to
    synchronize the test harness with Turbo's Action Cable-powered broadcast
    support. The method will find all `<turbo-cable-stream-source>` elements
    that are present but not yet `[connected]` (returning the results
    immediately with Capybara's `:wait`), then wait for them to connect
    (using whatever Capybara's configured wait value).
    
    In addition to the `connect_turbo_cable_stream_sources`, also introduce
    a `:turbo_cable_stream_source` Capybara selector, along with
    `assert_turbo_cable_stream_source` and
    `assert_no_turbo_cable_stream_source` helper methods.
    
    [ActionDispatch::SystemTestCase]: https://edgeapi.rubyonrails.org/classes/ActionDispatch/SystemTestCase.html
    [ActionText::SystemTestHelper]: https://edgeapi.rubyonrails.org/classes/ActionText/SystemTestHelper.html
    seanpdoyle committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    bab6a70 View commit details
    Browse the repository at this point in the history