Clipboard with a test case

Test Case — a document that contains a sequence of steps to verify a specific piece of functionality against the requirements.

Each test case describes a concrete test scenario that must be executed during testing.

The artifact we studied earlier, the checklist, may reference test cases.

Test Case Format

Test Case Attributes

ID: a unique identifier, for example, a number.

Priority: the execution priority of the test case

Title: a clear and concise title that quickly conveys the essence of the check.

Precondition: the system setup that must be completed before testing begins.

Steps: a step-by-step instruction on how to carry out the test.

Expected result: what should happen after completing the steps.

Test Case Example

ID: #1.

Priority: High

Title: «Login to the system».

Precondition: the user is registered in the system.

Steps:

  1. open the login page
  2. enter a valid username and password
  3. click the «Log in» button

Expected result: the user successfully logs into the system.


Depending on a company’s internal standards, a test case may also include the author’s name, creation and modification dates, attachments, references, and comments.

Positive and Negative Test Cases

Testing any functionality should start with positive scenarios. Users do not visit a website to break something; they want to get information or a service. Positive scenarios reflect typical user behavior and check whether the functionality works as intended.

After that, negative scenarios and variations of «what could go wrong» should be tested to ensure the system handles errors and edge cases correctly.


Positive Test Case Example
#1. Successful login with valid credentials.

Precondition: the user is registered in the system.

Steps:

  1. open the login page
  2. enter a valid username and password

Expected result: the user successfully logs into the system.

Negative Test Case Example
#3. Error when attempting to log in with an incorrect password.

Precondition: the user is registered in the system.

Steps:

  1. open the login page
  2. enter a valid username but the wrong password

Expected result: an error message «Incorrect username or password».

Test Suite

Test cases can be grouped into a test suite. Test suites help organise them logically and fully cover a specific functionality, for example, «Login to the system»:


#1. Successful login with valid credentials.

Precondition: the user is registered in the system.

Steps:

  1. open the login page
  2. enter a valid username and password

Expected result: the user successfully logs into the system.

#3. Error when attempting to log in with an incorrect password.

Precondition: the user is registered in the system.

Steps:

  1. open the login page
  2. enter a valid username but the wrong password

Expected result: an error message «Incorrect username or password».

#4. Lockout after three failed login attempts.

Precondition: the user’s IP address does not change.

Steps:

  1. open the login page
  2. attempt to log in with an invalid username or password more than three times

Expected result: an error message «Too many failed login attempts».

Task

Test the «Login» form. Complete the scenario described in the test case.


#2. Username case insensitivity during login.

Precondition: a user with the username tester-today and password password is registered in the system.

Steps:

  1. change the letter case of the valid username
  2. click the «Log in» button

Expected result: the user successfully logs into the system.

Actual result:

Status:

Date: 18.04.2023

Login
Cat is logging in
Task available to premium users!
Sidebar arrow