tags:

views:

105

answers:

1

Hi, I have a task of writing some test cases on Ruby. The task is as in example:

  1. Visit the some website.
  2. (Assert that certain page was displayed)
  3. Enter a text into a textbox
  4. Press the submit button
  5. (Assert that user was redirected to a right page)
  6. (Assert that user was presented with the right information)

So, the question is: how to organize such test cases with a bigger number of asserts. Should I check for example whether step 2 occurred and only then pass to the next steps, because if step 2 fails, there is no sense to move further. I do no not know how to organize such test cases.

+1  A: 

Your approach sounds reasonable. If a step depends on a preceding step, then there seems little point in testing for it if the preceding step has failed. If the depended-upon step fails, then it can be assumed that all subsequent dependent steps will fail as well. Overall, you should force yourself to think like a computer and delineate each step of the process being tested. Isolate each step in order and make sure they're working properly.

Evan Meagher