-
-
Notifications
You must be signed in to change notification settings - Fork 968
Move browser tests to standard Rails system tests. #3374
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
Conversation
d289215
to
478dcad
Compare
Codecov Report
@@ Coverage Diff @@
## master #3374 +/- ##
=======================================
Coverage 98.58% 98.58%
=======================================
Files 113 113
Lines 3395 3395
=======================================
Hits 3347 3347
Misses 48 48 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
Generally makes sense to me! I'm not too familiar with testing configurations so just to double check that the end product would look like:
- Browser tests under
/system
. These tests areApplicationSystemTestCase
that wereSystemTest
s withheadless_chrome_driver
. - System tests under
/system
. These tests will inherit from something likeApplicationSystemTestCase
but with therack-test
driver instead of the selenium one. Right now, these are currentlySystemTest
that inheritsActionDispatch::IntegrationTest
using the rack-test driver. - Functional tests under
/functional
(some integration tests can be moved here since they often only send one request per test).
If ^ is correct, would it make sense to somehow separate out the browser vs the other system tests into different directories (1 and 2.). At the end, would you suspect there to be any integration tests at all?
@jenshenny small naming issue fixed. Would it be ok to move with this forward? I'll continue on polishing tests. Regarding |
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.
Yeah I'm good to move this forward 👍
Let me know if you need any help with polishing / parallel testing.
Other step into getting tests a little better structured aiming to visual regression testing.
This introduces classic Rails default
ApplicationSystemTestCase
backed byheadless_chrome
(same as before) and utilisestest/system
directory for related tests. That should be equivalent of new Rails app these days.test/integration
still hosts 2 kind of tests.ActionDispatch::IntegrationTest
based tests (usingget
/post
rails helpers to navigate combined with Capybara page assertions)SystemTest
based tests using Capybara style (visit, ...), but running usingrack-test
(not running in browser)I would like to unify those two somehow. Some of the
ActionDispatch::IntegrationTest
tests could be probably migrated tofunctional
folder (for example API controller ones). Some of theActionDispatch::IntegrationTest
could be migrated toSystemTest
using browser like navigation instead ofget
/post
rails helpers.And finally
SystemTest
could be probably moved intosystem
folder using customTestCase
(rack-test
based one).That would be subject of following PRs. Any suggestion is welcomed. 🙏