Topic: Integration Test Options...
I've been battling with integration/acceptance testing for the past week and have been getting extremely frustrated. I wanted to see what other people's experiences have been and if anyone can suggest a better way forward.
I spent most of five evenings working on standard Rails integration tests; but its been such an annoying process that I don't really want to go back to them. The current issue is an inexplicable failure for the integration test to find the form element after the first submit (its a two step wizard process). If I manually print out the response object in the test case, it shows the exact string that the assert_select is saying isn't there.
I've spent the past two days working with Selenium on Rails, but am bumping into other issues there that are starting to be deal breakers... I suspect many of my selenium issues can be overcome, but there's one that's unlikely to be resolved. I'm trying to wrap the account creation process in an acceptance test. In large scale terms this is
Click "Create Account"
Fill out step one form and submit
Fill out step two form and submit *** My Rails Tests fail here
Confirm account pending page
Click link in email *** I think this is impossible in Selenium on Rails
Confirmed logged in
Since Selenium is driving the app from the client side it doesn't have access to ActionMailer::Base.deliveries so I can't find the link to click/open/get.
The minor annoyances with SoR is that it looks like client testing, but it still requires too much knowledge of the app. Rails integration testing doesn't look like client testing so the spillover of concern doesn't bother me as much, even though I'd rather be closer to client testing. I like that in Selenium I say "Click this button" rather than "issue a post to this url". If I change the form handler, but preserve behavoir that shouldn't break the acceptance test, but would break rails integration test. I dislike that I need to find the input elements in selenium (and in rails) by name/parameter. I'd greatly prefer to match the text contained in a <lable> and then "foo" from "for=foo" as the paramter to set to a value.. Thus everything is end-user visible defined, not "view source" based.
I suppose if I can figure out why my Rails integration tests are failing, I can build enough DSL around it to make it what I want. But I'm running out of ideas on how to figure out why its failing...
Does anyone know any other acceptance testing options? Anyone have any experience with assert_select failing when the content is present?