For a Drupal 7 Commerce site, I am working on the behavior of a payment and invoicing service during checkout. Among other things, there is one implementation of hook_commerce_checkout_complete()
, the behavior of which I want to improve.
So far, for testing this, I always do a complete shopping and checkout process:
- Visit a product page.
- Add the product to the cart.
- Enter a (new) address. (For a realistic experience, I think I need to type in a new address, because most buyers on this site are one-time anonymous customers.)
- Choose a payment method, confirm.
After this, I will look at the logs, the order that was created, and the emails I received. Then I will start over with the next iteration.
My browser does a half-decent job of prefilling the form with the address. Just one field (city) is left empty consistently.
But even if this would work, there are still some steps too many for my taste, for rapid iteration of manual tests.
Is there a way to automate some of this?
Note: I am not talking about automated tests here. I am talking about manual testing during development.