-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Brainstorm a list of critical full-stack system tests we should add #5316
Comments
This seems awesome @jywarren! I will go through the ruby on rails guide first as I haven't written any system test till now 🙈 |
😄 Example test:
|
Nice 🛩️ So every test will have it's own test file under |
Hi, @GettyOrawo -- i think we can put multiple tests in each file! |
Also, i believe it's possible to use anything from Capybara's DSL (domain specific language?) -- https://github.com/teamcapybara/capybara#the-dsl It mentions attaching files: https://github.com/teamcapybara/capybara#interacting-with-forms
And evaluating javascript functions: https://github.com/teamcapybara/capybara#scripting
I'm not /sure/ these will work, but for testing things like image upload, I'd love to try it! |
Attempted to use a JS function in #5525! |
And tried using |
I found this great Capybara cheatsheet!!! https://gist.github.com/zhengjia/428105 |
And, I seem to see a chrome plugin that can generate -- even "record" capybara tests based on your interactions! https://github.com/polarblau/capycorder/ We could use this to quickly generate tests. |
This seems interesting, I also want to contribute on this one. |
OK! With help from Capycorder, I completed a system test of posting at
See it here: plots2/test/system/post_test.rb Lines 10 to 34 in e190eae
We can use this as an example to make more system tests, like for #5526 |
Once #4888 is merged (done!), we'll have system tests running in Travis! This means we can test a full running application on each PR, including javascript, ruby, and everything. We've had some recurring and difficult-to-test issues come up over the past few years, and this is a chance to monitor those delicate and highly integrated scenarios with tests!
Here's our initial test, which is passing, using documentation from https://guides.rubyonrails.org/testing.html#implementing-a-system-test :
plots2/test/system/search_test.rb
Lines 1 to 13 in e8cfcd4
Based on this template, we can do things like interact with Javascript-driven features, click on things, etc. Let's brainstorm a list of the most critical things we should protect first with this powerful new testing system!
plots2/test/system/screenshots_test.rb
Line 18 in 25d7e11
What else has broken recently?
(Note: there is also a means for system tests to take screenshots and upload them as 'artifacts' in Travis... 😮 📸 so if anyone wants to try opening a PR for that we'd love to see it tried out - but maybe best open a new issue for it! -- update: testing here: #5320)
The text was updated successfully, but these errors were encountered: