So I said, narrow the focus.
Your "use case" should be, there's a 22 year old college student
living in the dorms.
How will this software get him laid? - jwz
Practically everyone agrees that selenium testing is a nightmare. The biggest problem is that you end up with too many tests. At WooMe, we think we have a secret sauce for making sure our testing doesn’t become bloatastic.
We have very few core Selenium tests. The payments system, registration and email are the only things we test on every release. Everything else is done with acceptance tests. Acceptance tests, at WooMe, are tests that check a particular feature, bug fix or even a text change.
Sometimes they’re really silly. Just check that a CSS class is being applied to a button, for example.
Acceptance tests have a lifetime. We leave them in for at most a few weeks. Once they’ve been in that long, we remove them. Of course, we are constantly writing acceptance tests but the purging means we don’t get much Selenium bloat.
Our tests are all defined using the Django testrunner. We have something like this in an __init__.py:
from simple import * from profile import * from alert import * from vip import * from ticket_6955 import * from ticket_6997 import * from ticket_7353 import * from ticket_7412 import * from ticket_7454 import * from ticket_7445 import * from ticket_7424 import *
Here’s the command I use to review the acceptance test queue:
sed -rne 's/.*ticket_([0-9]+) .*/\1/p' \ | while read ticket ; do traccmd.py td $ticket | grep summary ; done
traccmd.py is a tool we wrote to pull data out of trac fairly easily.
Are acceptance tests any good? Well, they have their weaknesses but as a strategy for maintaining a light touch but low risk testing environment they work very well. This is because they exercise two important failure points:
Of course, when we do throw a test away, we don’t really throw it away. It’s still in version control and we could potentially go and do a long test where we pull out all tests and run them. We’ve never had to do that yet though.