Hello and happy Wednesday!
I have been spending most of my free time lately attempting to implement multi-tenancy in my Rails application. I’ve had to start over a few times for the various strategies I’ve seen online thus far. During this latest restart I had the mind to add functional tests with Capybara to help me isolate where my application breaks if I run into the same sort of issues in future attempts.
I’ll create another post when I finish my project’s functional tests, just to illustrate, but if you’re wanting a better introduction to Capybara testing you can check out this post I wrote back in march for a decent primer on the topic.
Capybara Troubleshooting: Not Finding Form Elements
This find was capybara troubleshooting gold for me.
I remember my first time writing integration tests for an internship, and wrestling at times with capybara being able to locate form fields properly. When I ran into a similar challenge this week, I was able to find this StackOverflow on the issue, and the top answer fixed my issue:
And lastly, I wanted to share a couple of capybara resources I’ve found helpful while building out these tests:
- What is an integration test exactly?
- Simple tricks to clean up your capybara tests
- Practicing Capybara by: jumpstart labs
- Basics of Capybara
Categories: Ruby on rails