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
- Open Home Page.
- Search for a keyword.
- Verify that the total results count is positive.
Test case: Any results page displays results
- Open Home Page.
- Search for a keyword.
- Verify that the results per page are “1 to 10”.
- Go to page 3.
- Verify that the results per page are “21 to 30”.
- Go to page 5.
- Verify that the results per page are “41 to 50”.
Test case: Next page displays results
- Open Home Page.
- Search for a keyword.
- Learn why the TestNg, Maven, and Page Object Model tools are used in the automation project.
- Verify that the results per page are “1 to 10”.
- Go to the next page.
- Verify that the results per page are “11 to 20”.
- Go to the next page.
- Verify that the results per page are “21 to 30”.
Hints
- 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.
- 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.
- 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 1400+ tech skills courses.