Open tleish opened 3 years ago
@tleish Yes, 100%. Seems like this would be a major improvement!
@tleish Hey, I just realized this probably won't work. You can't inject the JS until you're ready to start recording, which shouldn't happen until the user has actually hit magic_test
in the test. Otherwise, it will re-record actions that the earlier Capybara code is triggering.
Actually, I take that back... it could work, we just need to add a method to activate the recording, vs. it happening automatically, then issue that command via JS when they hit magic_test
. I think this will help solve some of the jitteriness that happens right now on full page refreshes.
We've got an update on the JS side coming that will help support this.
Meaning you are working on the injection, or refactoring the JS to make injection easier?
@tleish Hey, sorry to drop the ball on this. Forget what I said before! I would definitely be interested in your approach. Want to take a stab at it?
I've seen other gems which use Rack to inject javascript into head of an html request (e.g rack-livereload).
Found the line: https://github.com/jaredmdobson/rack-livereload/blob/42ab828ca73dcbebbc516b95b2f4b24541c228a5/README.md?plain=1#L29
Will have to think about how to implement this one moving forward.
I've seen other gems which use Rack to inject javascript into head of an html request (e.g rack-livereload).
The user would then add:
This approach might be a bit cleaner than modifying layouts to include the javascript.
Would you be interested in this approach?