Now for a test plan
So far we have built a Puffin configuration file. Puffin will use this file to know "how" to communicate with your Web application. However, it does not know "what" communication you want it to execute. For this, you need a test plan file. For now, rename the test.plan file that comes with Puffin to test.planORIG or similar, delete the old test.plan file, and create a new empty file of that name.
Puffin allows for two different test plan formats: a simple format that allows you to make quick and dirty test plans that you don't expect to grow in complexity and you may not even keep -- and a complex, XML-based format that allows for the following:
- Including plans in other plans
- Iterating over plans until some condition occurs
- Grouping multiple test actions into a task that gets executed as a whole
- Dependencies between tasks (if one fails, then a dependent task is not executed)
- And more
That's too much to tackle here. We will attack those in the next article. We will focus here on simple test plans, so in your new test.plan file, enter the following (with no preceding spaces), and save it in the same folder as puffin.py:
As you might guess, Puffin will ignore any line starting with a # character or a whitespace as not containing the name of a test action. It will "assume" every other line contains the name of a test action and will attempt to retrieve the test action's configuration information from the current Puffin config file.
You can create as many test plans as you like with the test actions in
whatever order. There is no need to keep them called test.plan other than
convenience (other names or placement in other folders requires using the
--test.plan=... command-line argument when you run Puffin).
This is one of the fundamental strengths of Puffin. You configure a given test action in one place. Then you can use it in as many test plans as you like.