Prompt Details
Model
Chat - (gpt-5.5)
Token size
633
Example input
[feature_description]: Users can purchase products via a checkout flow supporting multiple payment methods (Credit Card, UPI, Wallet). The system should handle failures such as payment timeout, double payment attempts, and partial success (amount deducted but order not created). Includes retry mechanism and order reconciliation job. Tech stack: React frontend, Java Spring Boot backend, Razorpay integration. Known issue: duplicate order creation during retry.
[application_type]: Web + Mobile
[user_roles]: Guest User, Logged-in User, Payment Gateway
[business_rules]: Order is created only after successful payment confirmation * Payment retries allowed up to 3 times * Refund must be initiated if payment captured but order fails * Guest users must provide email and phone
[priority]: Critical
Example output
This is a strong, high-risk checkout system with real financial impact. I’ll treat it like a production-critical flow where failures = revenue loss + trust damage.
---
# ✅ STEP 1 – CONTEXT VALIDATION
### 🔴 Missing / Ambiguous Areas
1. **Payment confirmation source**
* Is order creation triggered by:
* Frontend success response OR
* Backend webhook from Razorpay?
→ This is critical for duplicate/partial scenarios.
2. **Idempotency handling**
* Is there a unique payment/order idempotency key?
* How are retries identified as same attempt?
3. **Timeout definition**
* What qualifies as timeout? (UI timeout vs gateway timeout vs backend timeout)
4. **Refund trigger mechanism**
* Auto refund via system OR manual reconciliation?
5. **Concurrency control**
* What happens if user clicks “Pay” multiple times?
6. **Retry UX**
* Same order reused OR new order generated on retry?
---
### 📌 Assumptions
* Order is created **only after Razorpay webhook confirmation**
* Backend uses **payment_id as idempotency key**
* Retry uses **same cart but new payment attempt**
* Refund is **auto-triggered via reconciliation job**
* Duplicate order bug exists due to **retry + webhook race condition**
---
# ⚠️ STEP 2 – RISK-BASED TEST DESIGN
### 🔥 Highest Risk Areas (Priority Order)
1. **Duplicate order creation (known bug)**
2. **Payment success but order not created (money loss scenario)**
3. **Retry logic causing inconsistent state**
4. **Webhook vs API race conditions**
5. **Double payment due to UI or network retries**
---
# 🧪 STEP 3 – TEST CASES (SMART GROUPED)
---
## 1️⃣ CRITICAL USER FLOWS (Must Not Fail)
---
### TC_CRIT_01
* **Title:** Successful checkout via Credit Card
* Category: Critical Flow
* Priority: Critical | Risk: High
* Preconditions: Valid cart, payment gateway available
* Steps:
1. Add product → Checkout
2. Enter valid card details
3. Complete payment
* Test Data: Valid Visa card
* Expected: Payment success → Order created once
* Automation: High | Type: API + UI
* Dependency: Razorpay sandbox
* Time: 2 min
* Notes: Validate webhook + DB consistency
---
### TC_CRIT_02
* **Title:** Successful checkout via UPI
* Same structure as above
* Focus: UPI intent + callback handling
---
### TC_CRIT_03
* **Title:** Retry payment after failure (max 3 attempts)
* Steps:
1. Fail payment twice
2. Retry third time
* Expected: Only 3 attempts allowed, 4th blocked
---
### TC_CRIT_04
* **Title:** Payment success but order creation failure → refund triggered
* Steps:
1. Simulate backend failure post payment
* Expected:
* No order created
* Refund initiated automatically
---
### TC_CRIT_05
* **Title:** Prevent duplicate order during retry (known issue validation)
* Steps:
1. Initiate payment
2. Retry quickly
* Expected:
* Only one order created
* Notes: Must validate idempotency
---
---
## 2️⃣ POSITIVE SCENARIOS
---
### TC_POS_01
* Wallet payment success
* Validate balance deduction + order creation
### TC_POS_02
* Guest checkout with valid email & phone
* Ensure order mapped correctly
---
## 3️⃣ NEGATIVE SCENARIOS
---
### TC_NEG_01
* Invalid card details
* Expected: Payment rejected
### TC_NEG_02
* Payment timeout
* Expected: Retry option shown, no order created
### TC_NEG_03
* Exceed retry limit
* Expected: Payment disabled
---
## 4️⃣ BOUNDARY & EQUIVALENCE
---
### TC_BOUND_01
* Minimum order value (₹1)
* Expected: Allowed
### TC_BOUND_02
* Maximum order value (gateway limit)
* Expected: Handled gracefully
---
## 5️⃣ EDGE CASES (REAL-WORLD FAILURES)
---
### TC_EDGE_01
* Network drop after payment success
* Expected:
* Order still created via webhook
---
### TC_EDGE_02
* Double click on “Pay Now”
* Expected:
* Single payment initiated
---
### TC_EDGE_03
* Webhook delayed by 30+ seconds
* Expected:
* Order created eventually
* UI shows pending state
---
### TC_EDGE_04
* Payment captured but webhook lost
* Expected:
* Reconciliation job creates order/refund
---
---
## 6️⃣ UI/UX & ACCESSIBILITY
---
### TC_UI_01
* Loader during payment processing
* No multiple clicks allowed
### TC_UI_02
* Accessible form (keyboard navigation, labels)
---
## 7️⃣ SECURITY (OWASP FOCUSED)
---
### TC_SEC_01
* Payment data not exposed in frontend logs
### TC_SEC_02
* Validate webhook signature
* Expected: Reject tampered requests
---
### TC_SEC_03
* Prevent parameter tampering (amount manipulation)
---
## 8️⃣ PERFORMANCE
---
### TC_PERF_01
* 1000 concurrent checkout requests
* Expected: No duplicate orders
---
### TC_PERF_02
* Payment latency under load
* Expected: < acceptable SLA
---
## 9️⃣ INTEGRATION & DATA CONSISTENCY
---
### TC_INT_01
* Payment success → DB consistency check
* Order + payment status aligned
---
### TC_INT_02
* Refund status sync with gateway
---
---
## 🔟 REGRESSION IMPACT
---
### TC_REG_01
* Cart → Checkout → Payment → Order
* End-to-end validation
### TC_REG_02
* Retry flow stability
---
# 📊 COVERAGE SUMMARY
| Category | Count |
| ----------- | ----- |
| Critical | 5 |
| Positive | 2 |
| Negative | 3 |
| Boundary | 2 |
| Edge | 4 |
| UI/UX | 2 |
| Security | 3 |
| Performance | 2 |
| Integration | 2 |
| Regression | 2 |
✅ **Critical Path Coverage: ~95%**
---
# 🤖 AUTOMATION STRATEGY
### 🚀 Automate First (High ROI)
1. Payment success flow (API + webhook validation)
2. Retry + idempotency scenarios
3. Duplicate order prevention
4. Refund scenarios
---
### 🛠 Suggested Stack
* UI: Playwright (better async handling vs Selenium)
* API: Rest Assured
* Performance: k6 / JMeter
* AI Layer:
* Auto-generate edge cases
* Detect flaky retries
---
# ⚠️ RISK ASSESSMENT
### Top 5 Failure Areas
1. Duplicate order creation
2. Payment success but no order
3. Retry causing inconsistent state
4. Webhook delays/loss
5. Double payment
### 💥 Production Impact
* Direct revenue loss
* Refund overhead
* Customer trust damage
* Support cost spike
---
# ❗ REQUIREMENT GAPS
### Missing
* Idempotency strategy definition
* Retry UX flow
* Webhook vs API source of truth
* Refund SLA
### Assumptions Made
* Webhook is source of truth
* Refund is automated
* Retry creates new payment attempt
---
# 🧾 TEST DATA STRATEGY
### Required
* Valid/invalid cards
* UPI test handles
* Wallet balances
### Edge Data
* Timeout simulation
* Partial success data
* Duplicate payment IDs
### Data Policy
* Use masked real-like data
* Avoid real payment credentials
---
# 🔁 REGRESSION SCOPE
### Must Retest
* Checkout flow
* Payment gateway integration
* Retry mechanism
* Order creation logic
### Can Skip
* Static UI content
* Non-payment pages
---
Get this prompt + 9 more with Select$14 first month, then $19/mo · Cancel anytime$14 first month · then $19/mo
View SelectBy purchasing this prompt, you agree to our terms of service
GPT-5.5
Generate production-grade, risk-prioritized test cases in minutes — designed like a senior QA architect. Covers positive, negative, boundary, edge, security, and performance scenarios. Includes automation strategy, risk assessment, and requirement gap analysis. Perfect for QA Engineers, SDETs, and QA Leads who want senior-level test coverage without spending hours on manual test design.
...more
Added over 1 month ago
