Fast way to test (manually) commerce checkout process 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.

EDIT: Automated vs manual testing

The comments indicate that my question might be confusing. Maybe I chose the terms poorly, so I will explain how I want them to be understood for this question.

"Automated testing": I have a machine that bakes a cake according to a codified recipe. And another machine that determines if the cake is according to expectations, e.g. by testing chemical properties or the color. The expectations are also codified, and do not change. The result is either "passes" or "does not pass".

What I want instead: A machine that bakes a cake according to a codified recipe. But then I want to taste the cake myself, and determine how I want to change the recipe. This means in this case, the expectations are not known beforehand, and they are not codified.

Without any automation, I would have to bake the cake manually, then taste it, then bake another cake, taste it again, etc.

According to the answer by @PatrickKenny, Selenium can do both things for me.

If someone can suggest a better way to say this, I will be grateful.
This is not specific to Drupal, but you can use Selenium IDE.

Selenium is a framework for automated testing, but the IDE allows you to do lazy manual testing too.

You need to install Firefox and the Selenium IDE addon.

Basic explanation of how to get started


Open the IDE (addon) and press the red "record" button.
Go to your site and carry out all the steps manually. Selenium IDE will automatically record the steps as you go along.
You can also add steps manually or edit the steps in the displayed editor.  This supports cut and paste so you can edit it pretty quickly.
When you're done, save the file.  You can then open this file again in the IDE and press the play button to automatically carry out all the steps.