woothemes/woocommerce — Issue #172: Add Testing Suite
Author: joeblackwaslike
Created: 2011-11-09 11:56:08+00:00
State: open

I've noticed a few times functionality has broken causing downloads to be corrupt, when you sell 20 downloads a day and don't know if the error is your server or a new commit it can be a little nerve-wracking.

Being a huge fan of testing I thought i'd propose a few things to start off the test suite, it'd be a nice automated way of being sure functionality isn't broken before pushing a commit(you should be able to even hook it into any of gits functions to execute automatically, I use a similar system in rails religiously. It'd be nice to have locally as well to run from the CLI just to be sure everything is peaches before sending out a email campaign to our 10,000 subscribers. :D

assert success - add to/remove to cart for each product
assert success - add all downloadable items to cart, checkout using each each active gateway(for paypal sandbox mode, etc)
assert success - locally download using custom urls,
assert md5 checksum and filesize matches (here are some CLI commands you can use to verify this if that
helps)
openssl md5 /path/to/file | awk '{ print $2 }' returns just the md5 checksum itself
ls -la /path/to/file | awk '{ print $5 }' returns just the file size

possibly assert specific values returned in http header match those expected using curl -I downloadlink

etc.