Writing tests can often be a boring, repetitive slog. Let me show you what I mean.

For an example Ill use a login pagesomething small and simple that were all familiar with.

Here a user enters a user ID (which, in the case of our application, is the users email address), a password, and then clicks the blue Log in button. If all goes well, theyre logged in to the application.

Lets start with the happy pathwhat the use case writers call the “main success scenario.”

  1. Enter “gary@tametest.com” into the User ID field.
  2. Enter “Test.123” into the Password field.
  3. Click the blue “Log in” button.
  4. Verify that you are logged in to the application.

Thats one test case. But as you can guess, there are many more test cases. For example, what happens if I leave the user ID blank?

Id write a different scenario:

  1. Leave the User ID field blank.
  2. Enter “Test.123” into the Password field.
  3. Click the blue “Log in” button.
  4. Verify that you are still on the login page and that you see the error message “The user ID field is required.”

Or what happens if I enter the user ID but leave the password blank?

Thats a third scenario:

  1. Enter “gary@tametest.com” into the User ID field.
  2. Leave the Password field blank.
  3. Click the blue “Log in” button.
  4. Verify that you are still on the login page and that you see the error message “The password field is required.”

Or what happens if the user ID isnt in the form of a good email address?  Or what if the user is locked out…?  Or what…? You can see that there are many situations that can lead to different results.

All of these tests fit within the same framework, but involve different values for the two inputs.

The process for writing test cases with these many alternatives is pretty repetitive.  Done by hand, it often involves simple copying and pasting.  Such techniques, while simple, are prone to errors and not terribly resilient in the face of changes.

So rather than writing tests one scenario at a time, with TAME were going to create a framework for a whole series of tests.  The process of building tests with TAME follows these steps:

Now you let TAME generate different scenarios by forming combinations of inputs and match those to the expected results.