Define the Test Cases

Define the test cases to be automated in the upcoming sections.

The following 3 test cases describe user flows for the Vancouver Public Library site.

Test case: Keyword search returns results

  1. Open Home Page.
  2. Search for a keyword.
  3. Verify that the total results count is positive.

Test case: Any results page displays results

  1. Open Home Page.
  2. Search for a keyword.
  3. Verify that the results per page are “1 to 10”.
  4. Go to page 3.
  5. Verify that the results per page are “21 to 30”.
  6. Go to page 5.
  7. Verify that the results per page are “41 to 50”.

Test case: Next page displays results

  1. Open Home Page.
  2. Search for a keyword.
  3. Learn why the TestNg, Maven, and Page Object Model tools are used in the automation project.
  4. Verify that the results per page are “1 to 10”.
  5. Go to the next page.
  6. Verify that the results per page are “11 to 20”.
  7. Go to the next page.
  8. Verify that the results per page are “21 to 30”.

Hints

  1. Some test cases are not suitable for test automation:
    If a test case is not independent of other test cases, tests multiple things, depends on environment data, or has many steps, it is not suitable for test automation. Before implementing the test case, it has to be converted to a format suitable for test automation.
  2. Test case independence:
    Each test case should be independent of the other test cases. It should always start with opening the Home Page of the site and continue from there.
  3. A test case must have at least 1 assertion:
    An automation test case should have a minimum of assertions. These assertions should all be related to the purpose of the test case. All checks that confirm that the site navigation is correct should happen outside of the test case.

Get hands-on with 1200+ tech skills courses.