Note: From the below post, "Prompt Template" and "Example Usage" are for you to copy/modify/reuse. The remaining fields are added for you to gain more knowledge about the Prompt. Happy learning!
Purpose
Any Functionality | Generate step-by-step test cases with guided instructions | Test Case Generation | Instructional Prompt
QE Category
Test Case Generation
Prompt Type
Instructional
Typical SUTs and Quality Phases
Ideal for novice testers or structured environments requiring detailed, step-by-step test instructions.
Prompt Template
Role: A QA engineer following a guided approach to create test cases for [Feature Description].
Context:
- **User Story**: [Insert User Story]
- **Acceptance Criteria**: [List Criteria]
- **Priority**: High/Medium/LowInstructions:
1. Begin with understanding the user story and acceptance criteria.
2. Identify key scenarios based on acceptance criteria.
3. For each scenario, generate test cases with the following structure:
- **Test Case ID**
- **Title**
- **Preconditions**
- **Steps**
- **Expected Results**
4. Ensure test cases cover:
- Positive scenarios (successful outcomes).
- Negative scenarios (error handling).
- Edge cases (boundary conditions).
5. Add a summary explaining how the test cases align with the user story and acceptance criteria.Task:
Generate at least 5 formal test cases following these instructions, ensuring clarity and completeness.
Example Usage
Role: A QA engineer following a guided approach to create test cases for a subscription cancellation workflow in a SaaS platform.
Context:
- **User Story**: As a user, I want to cancel my subscription easily so that I am not billed further.
- **Acceptance Criteria**:
- Users must confirm cancellation through a confirmation dialog.
- Users must receive an email confirming the cancellation.
- Cancellation must take effect immediately, stopping future billing.
- **Priority**: HighInstructions:
1. Begin with understanding the user story and acceptance criteria.
2. Identify key scenarios based on acceptance criteria.
3. For each scenario, generate test cases with the following structure:
- **Test Case ID**
- **Title**
- **Preconditions**
- **Steps**
- **Expected Results**
4. Ensure test cases cover:
- Positive scenarios (successful outcomes).
- Negative scenarios (error handling).
- Edge cases (boundary conditions).
5. Add a summary explaining how the test cases align with the user story and acceptance criteria.Output Example:
1. **Test Case ID**: TC-001
- **Title**: Validate successful subscription cancellation.
- **Preconditions**: User has an active subscription.
- **Steps**:
1. Navigate to the subscription management page.
2. Click on 'Cancel Subscription'.
3. Confirm cancellation in the dialog box.
- **Expected Results**: Subscription is cancelled, and a confirmation email is sent to the user.2. **Test Case ID**: TC-002
- **Title**: Validate error handling during subscription cancellation.
- **Preconditions**: Network connectivity is interrupted during the cancellation process.
- **Steps**:
1. Navigate to the subscription management page.
2. Click on 'Cancel Subscription'.
3. Disconnect the network before confirming cancellation.
- **Expected Results**: The cancellation fails gracefully with an error message prompting the user to retry.Summary:
The generated test cases address all acceptance criteria, covering positive, negative, and edge scenarios, ensuring a comprehensive evaluation of the subscription cancellation workflow.
Tested in GenAI Tools
Extensively optimized for ChatGPT, Claude, Microsoft Copilot, Google Gemini, and Perplexity-- delivering reliable and actionable results across leading GenAI platforms.
Value of the Prompt
This prompt provides structured guidance, ensuring clear, actionable test cases even for novice testers.
Hands-On Exercise
Use the prompt to generate test cases for a user notification system. Include scenarios like email delivery failures or delayed notifications due to high system load.
Want More?
Challenge the instructions by adding constraints like system latency or intermittent network conditions. Observe how the test cases adapt to these challenges.
Author
Ashwin Palaparthi
© 2023 Ai4Testers.com™ All rights reserved | Made with ❤️ by ContentShastra.com™
Check your inbox to confirm your subscription to Ai4Testers™. In the coming days, you will receive the FREE E-Book, GenAI for Software Testers – An Intro by Ashwin Palaparthi, along with ongoing GenAI knowledge assets.