A comprehensive, standardized template for writing clear, consistent, and executable test cases that improve quality and team efficiency.
This document provides a standardized template for writing clear, consistent, and executable test cases.
โ
Improve test execution efficiency
โ
Reduce ambiguity and confusion
โ
Help new team members understand the system quickly
โ
Serve as reliable documentation
โ
Enable consistent regression testing
โ
Facilitate test automation conversion
[!TIP] Use this template consistently across all projects to maintain quality standards and improve team collaboration.
graph TD
A[๐ Create Test Case] --> B[โ
Review & Approve]
B --> C[๐งช Execute Test]
C --> D{Result?}
D -->|Pass| E[โ๏ธ Mark as Passed]
D -->|Fail| F[๐ Log Defect]
F --> G[๐ Link Defect ID]
G --> H[๐ Retest After Fix]
H --> C
E --> I[๐ Update Metrics]
I --> J[๐ Archive]
| Field | Description | Example |
|---|---|---|
| Test Case ID | Unique identifier following naming convention | TC_LOGIN_001 |
| Title | Short, clear description of the test | Verify login with valid credentials |
| Module | Application module/feature under test | Authentication |
| Requirement ID | Linked requirement / user story / feature ID | REQ-AUTH-101, US-123 |
| Priority | Test importance level | Critical / High / Medium / Low |
| Test Type | Category of testing | Functional / Regression / Smoke / Sanity / Integration |
| Automation Status | Can this be automated? | Automated / Manual / Candidate for Automation |
| Author | Test case creator | John Doe |
| Reviewer | Test case reviewer | Jane Smith |
| Created Date | Date of creation | 2026-02-06 |
| Last Updated | Date of last modification | 2026-02-06 |
[!IMPORTANT] Always use a consistent naming convention for Test Case IDs. Format:
TC_[MODULE]_[NUMBER]
Specify the test environment configuration to ensure reproducibility.
| Field | Description | Example |
|---|---|---|
| Environment | Testing environment name | QA, Staging, Pre-Prod |
| URL/Endpoint | Application URL or API endpoint | https://qa.example.com |
| OS | Operating system | Windows 11, macOS Sonoma, Ubuntu 22.04 |
| Browser | Browser and version (if web app) | Chrome 121, Firefox 122, Safari 17 |
| Device | Device type (if mobile app) | iPhone 14 Pro, Samsung Galaxy S23 |
| App Version | Application version under test | v2.5.3 |
| Database | Database version and configuration | PostgreSQL 15.2 |
| Test Data Set | Dataset being used | Dataset_v1.2 |
[!NOTE] Environment details help reproduce issues and track environment-specific behaviors.
Describe any required setup before executing the test.
Example:
- User account with email "testuser@example.com" exists
- User password is "P@ssw0rd123"
- User account status is "Active"
- No active sessions exist for this user
[!WARNING] If preconditions are not met, test execution may fail or produce unreliable results.
Write clear, sequential steps that anyone can follow.
| Step No | Action | Input Data | Expected Behavior |
|---|---|---|---|
| 1 | Navigate to application URL | https://app.example.com |
Application home page loads |
| 2 | Click on โLoginโ button | - | Login page is displayed |
| 3 | Enter username in username field | testuser@example.com |
Username is accepted |
| 4 | Enter password in password field | P@ssw0rd123 |
Password is masked |
| 5 | Click โSign Inโ button | - | Login attempt is initiated |
Specify the input data required for execution with validity status.
| Data Type | Field Name | Value | Validity | Notes |
|---|---|---|---|---|
| Username | email |
testuser@example.com |
โ Valid | Existing active user |
| Password | password |
P@ssw0rd123 |
โ Valid | Meets password policy |
| Session Token | auth_token |
- | N/A | Generated during test |
Positive Test Data:
{
"username": "valid_user@example.com",
"password": "ValidP@ss123",
"remember_me": true
}
Negative Test Data:
{
"username": "invalid@example.com",
"password": "WrongPassword",
"expected_error": "Invalid credentials"
}
[!TIP] Maintain separate test data sets for positive, negative, and boundary value testing.
Describe the expected system behavior after executing the test steps.
Functional:
UI/UX:
Technical:
200 OKExample:
After clicking "Sign In", user should be:
1. Authenticated successfully
2. Redirected to URL: https://app.example.com/dashboard
3. Greeted with message: "Welcome, Test User!"
4. Session timeout set to 30 minutes
Capture the observed system behavior during execution.
Date/Time: 2026-02-06 10:30:45 IST
Executed By: Ghanendra Kumar
Build Version: v2.5.3-build-456
Observed Behavior:
โ
User authenticated successfully
โ
Redirected to dashboard at https://app.example.com/dashboard
โ
Welcome message displayed: "Welcome, Test User!"
โ
Session cookie "session_id" created with 30min expiry
โ
Last login timestamp updated in database
Deviation from Expected (if any):
None - Test executed as expected
Track the execution status of the test case.
| Status | Icon | Description |
|---|---|---|
| Pass | โ | All expected results matched actual results |
| Fail | โ | At least one expected result did not match |
| Blocked | ๐ซ | Cannot execute due to dependency or environment issue |
| Not Executed | โธ๏ธ | Test has not been run yet |
| Skipped | โญ๏ธ | Test intentionally bypassed (e.g., out of scope) |
Current Status: โ PASS
[!CAUTION] If status is โFailโ, always log a defect and link it in the Defect Tracking section.
Track performance and efficiency metrics.
| Metric | Value | Notes |
|---|---|---|
| Execution Time | 45 seconds |
Time taken to complete all steps |
| Execution Date | 2026-02-06 |
When test was executed |
| Execution Cycle | Sprint 12 - Regression |
Testing phase/cycle |
| Iterations | 1 |
Number of times executed |
| Pass Rate | 100% |
(Passes / Total Executions) ร 100 |
| First Time Pass | Yes |
Passed on first execution? |
| Automation Time Saved | N/A |
If automated |
Attach supporting evidence to validate test execution.
login_page_initial.png - Login page before entering credentialsdashboard_after_login.png - Dashboard after successful loginsession_cookie_validation.png - Browser dev tools showing sessionlogin_flow_recording.mp4 - Complete login flow executionapplication_logs.txt - Application console logsnetwork_logs.har - Network traffic capturedatabase_query_logs.sql - Database queries executedperformance_metrics.json - Performance dataaccessibility_scan.html - Accessibility audit results[!TIP] Always attach screenshots for failed tests showing the exact point of failure.
Link associated defects if test fails.
| Defect ID | Summary | Status | Severity | Assigned To | Link |
|---|---|---|---|---|---|
BUG-1234 |
Login timeout on slow network | Open |
Medium |
Dev Team | View Defect |
Defect ID: BUG-XXXX
Title: [Brief description]
Steps to Reproduce: [Reference test steps]
Expected: [From this test case]
Actual: [What happened instead]
Severity: Critical/High/Medium/Low
Environment: [From Environment Details section]
Attachments: [Screenshots/logs from this test]
Add any additional observations or important information.
[!NOTE] These notes help future testers understand context and edge cases.
Describe system state after test and required cleanup steps.
Cleanup Commands:
# Clear test user session
DELETE FROM sessions WHERE user_id = 'test_user_123';
# Reset login attempt counter
UPDATE users SET failed_login_attempts = 0 WHERE email = 'testuser@example.com';
[!IMPORTANT] Always perform cleanup to maintain test environment integrity and avoid data pollution.
Link to dependent or related test cases.
| Test Case ID | Title | Relationship | Status |
|---|---|---|---|
TC_LOGIN_002 |
Verify login with invalid credentials | Alternative Flow | โ Pass |
TC_LOGIN_003 |
Verify password reset flow | Related Feature | โธ๏ธ Not Executed |
TC_LOGOUT_001 |
Verify logout functionality | Sequential Test | โ Pass |
TC_SESSION_001 |
Verify session timeout | Related Feature | โ Pass |
TC_LOGOUT_001 should be executed after this testBefore finalizing a test case, verify:
Test Case ID: TC_LOGIN_001
Title: Verify successful login with valid credentials
Module: Authentication
Requirement ID: REQ-AUTH-101
Priority: Critical
Test Type: Functional, Smoke
Automation Status: Automated
Author: Ghanendra Kumar
Created Date: 2026-02-06
Environment:
https://qa.example.comPreconditions:
โ
User account exists with email: testuser@example.com
โ
User account is active
โ
User is currently logged out
Test Steps:
| Step | Action | Input | Expected |
|โโ|โโโ|โโ-|โโโ-|
| 1 | Navigate to login page | https://qa.example.com/login | Login form displayed |
| 2 | Enter email address | testuser@example.com | Email field accepts input |
| 3 | Enter password | P@ssw0rd123 | Password is masked |
| 4 | Click โSign Inโ button | - | Login initiated |
Expected Result:
/dashboardActual Result:
โ
All expected results achieved
Status: โ
Pass
Execution Time: 45 seconds
Executed By: Ghanendra Kumar
Execution Date: 2026-02-06
Test Case ID: TC_LOGIN_002
Title: Verify login fails with invalid password
Priority: High
Test Type: Negative Testing
Preconditions:
User account exists: testuser@example.com
Test Data:
testuser@example.com (Valid)WrongPassword123 (Invalid)Test Steps:
testuser@example.comWrongPassword123Expected Result:
Status: โ Pass (correctly rejected invalid credentials)
Test Case ID: TC_LOGIN_005
Title: Verify account lockout after maximum failed attempts
Priority: High
Test Type: Security, Boundary Testing
Preconditions:
Test Steps:
Expected Result:
Status: โ Pass
| Version | Date | Author | Changes |
|---|---|---|---|
| 2.0 | 2026-02-06 | Ghanendra Kumar | Enhanced with GitHub beautification, added metrics, diagrams, alerts |
| 1.5 | 2026-01-15 | QA Team | Added automation status and environment details |
| 1.0 | 2025-11-01 | QA Team | Initial template creation |
We welcome contributions to improve this template!
git checkout -b feature/improvement)This template is licensed under the MIT License.
MIT License - Copyright (c) 2026 QA Team
Permission is hereby granted, free of charge, to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of this template.
Continue Learning:
sample-test-cases.md for more practical examplesโญ If you found this template helpful, please star this repository! โญ
| Made with โค๏ธ by the QA Team | Last Updated: February 2026 |