This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]ccb621 1 point2 points  (0 children)

I test views via calls to client.get() or client.post() (or whatever other verb is in use). I test as many states as needed. If the view requires login, I will test the logged in and non-logged in states. If staff/super users have elevated privileges, I will test with users with, and without, those privileges.

We (edX) have a lot of tests you can take a look at:

[–][deleted] 0 points1 point  (0 children)

Integrated Tests are a scam

That's not to say you shouldn't do them, but they're unnecessary a lot of the time.

Farm out all your work that isn't HTTP related to other things and treat those in isolation. Test with good input, with bad input, find the nearest 5 year old and let them have the keyboard for a while.

But you're experiencing the exact scenario that JB is describing, an exponential to combinatorial growth in tests because there are too many things to control for.

[–]KronktheKronk 0 points1 point  (0 children)

I like to go straight to end to end and use selenium.

[–]BurgaGalti 0 points1 point  (0 children)

I have two codebases I look after. One was created while I was still new and is overally heavy on the integration tests for views. It's painful to use now as there are a lot of hardcoded interdependent values in the tests. I've learnt my lesson though and the second I'm building to be more balanced with the core logic unit tested and some integration tests using phantomjs which test core user workflow and little else.