-
Notifications
You must be signed in to change notification settings - Fork 328
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
jorgemanrubia
merged 1 commit into
hotwired:main
from
seanpdoyle:wait-for-cable-stream-sources
Sep 17, 2024
Merged
Introduce Turbo::SystemTestHelper
#577
jorgemanrubia
merged 1 commit into
hotwired:main
from
seanpdoyle:wait-for-cable-stream-sources
Sep 17, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
seanpdoyle
commented
Feb 11, 2024
seanpdoyle
force-pushed
the
wait-for-cable-stream-sources
branch
7 times, most recently
from
February 13, 2024 18:45
f9c07f7
to
b6774ee
Compare
@jorgemanrubia @afcapel have you encountered this in your test suites? |
seanpdoyle
commented
Feb 13, 2024
seanpdoyle
commented
Feb 13, 2024
seanpdoyle
force-pushed
the
wait-for-cable-stream-sources
branch
12 times, most recently
from
February 17, 2024 22:19
add742f
to
d7c74a1
Compare
seanpdoyle
force-pushed
the
wait-for-cable-stream-sources
branch
from
July 13, 2024 09:56
d7c74a1
to
6cf1d3a
Compare
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
force-pushed
the
wait-for-cable-stream-sources
branch
from
September 16, 2024 14:55
6cf1d3a
to
bab6a70
Compare
@brunoprietog are you able to review this? |
Bless you and your bumps across PRs @seanpdoyle — I see you and thank you. |
jorgemanrubia
approved these changes
Sep 17, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great one @seanpdoyle
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduce the
Turbo::SystemTestHelper
module to be included intoActionDispatch::SystemTestCase when it's available.
The module is named to mimic ActionText::SystemTestHelper.
The module defines a
#connect_turbo_cable_stream_sources
helpermethod 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>
elementsthat are present but not yet
[connected]
(returning the resultsimmediately 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 introducea
:turbo_cable_stream_source
Capybara selector, along withassert_turbo_cable_stream_source
andassert_no_turbo_cable_stream_source
helper methods.