Test Descriptions
Write test descriptions that help AI understand exactly what to test and verify.
Test Description Examples
✅Good Examples
"Test user can log in with email and password"
💡 Specific action, clear user context, defined success criteria
authentication"Test shopping cart updates when adding products from product page"
💡 Clear user journey, specific trigger, expected outcome
ecommerce"Test contact form submits successfully with valid data"
💡 Specifies form type, input type, expected result
forms"Test form validation shows error messages for required empty fields"
💡 Tests error state, specific validation type, clear failure scenario
forms"Test mobile navigation menu opens and closes on small screens"
💡 Device-specific, interaction details, responsive behavior
navigation"Test search returns relevant results for product queries"
💡 Function purpose, input type, quality criteria for results
search❌Poor Examples
"Test the login"
⚠️ Too vague - what about login? With what credentials?
authentication"Test the cart works"
⚠️ No context about what "works" means or how to test it
ecommerce"Test the form"
⚠️ No indication of what form or what to test about it
forms"Test search works"
⚠️ Missing search terms, result expectations, success definition
search💡 Quick Tips for Better Descriptions
- • Be specific: "Test login" → "Test user can log in with email and password"
- • Include context: What user type? What page? What state?
- • Define success: What should happen when the test passes?
- • Focus on user intent: What is the user trying to accomplish?
Anatomy of a Good Test Description
Essential Components
- User context: Who is performing the action?
- Action intent: What are they trying to accomplish?
- Expected outcome: What should happen?
- Success criteria: How to know it worked?
Template Pattern
"Test [user type] can [action] and [expected result]"
Examples:
✅ "Test new user can register with email and receive confirmation"
✅ "Test logged-in user can add items to cart and see updated count"
✅ "Test admin can delete posts and see them removed from list"
User Context Patterns
Anonymous Users
"Test visitor can browse products without logging in"
"Test anonymous user can search and view results"
"Test guest can start checkout process"
Authenticated Users
"Test logged-in user can access their profile settings"
"Test user with items in cart can proceed to checkout"
"Test premium subscriber can access exclusive content"
Role-Based Testing
"Test admin can manage user accounts"
"Test editor can publish blog posts"
"Test customer can view their order history"
Action Intent Clarity
Navigation Actions
✅ "Test user can navigate from homepage to product catalog"
✅ "Test mobile menu opens and allows navigation to all sections"
❌ "Test the menu works"
Form Interactions
✅ "Test contact form submits successfully with valid data"
✅ "Test login form shows error for invalid credentials"
❌ "Test the form"
Content Verification
✅ "Test search results display relevant products for 'laptop'"
✅ "Test product page shows price, images, and add to cart button"
❌ "Test the content loads"
Expected Outcomes
State Changes
✅ "Test login redirects to dashboard after successful authentication"
✅ "Test adding to cart updates cart icon with item count"
✅ "Test form submission shows success message and clears fields"
UI Updates
✅ "Test clicking favorite button changes icon to filled heart"
✅ "Test expanding accordion shows additional content below"
✅ "Test tab selection updates visible content panel"
Data Validation
✅ "Test email field shows error message for invalid email format"
✅ "Test required fields prevent form submission when empty"
✅ "Test password strength indicator updates as user types"
Common Patterns by Feature
Authentication Flows
"Test user can log in with valid email and password"
"Test login form shows error for incorrect password"
"Test password reset sends confirmation email"
"Test user can log out and return to homepage"
"Test session expires after inactivity period"
E-commerce Flows
"Test user can add product to cart from product page"
"Test shopping cart updates quantities when changed"
"Test guest checkout collects shipping information"
"Test payment form validates credit card information"
"Test order confirmation shows purchase details"
Content Management
"Test user can create new blog post with title and content"
"Test published posts appear in public blog listing"
"Test draft posts are only visible to author"
"Test comments can be added to published posts"
"Test search finds posts by title and content"
Navigation & Search
"Test main navigation menu works on all screen sizes"
"Test search returns relevant results for product queries"
"Test breadcrumb navigation shows current page location"
"Test pagination allows browsing through result pages"
"Test filters narrow search results appropriately"
Avoiding Common Pitfalls
Too Vague
❌ "Test the app works"
❌ "Make sure everything is okay"
❌ "Check the website"
❌ "Test functionality"
Too Technical
❌ "Test CSS selector button.primary[data-testid='submit'] is clickable"
❌ "Test HTTP POST to /api/login returns 200"
❌ "Test DOM element with ID login-form is visible"
Implementation-Focused
❌ "Test React component renders without errors"
❌ "Test API endpoint handles JSON payload"
❌ "Test database query returns correct records"
Missing Context
❌ "Test login works" (Which user? What credentials?)
❌ "Test search" (Search for what? From where?)
❌ "Test checkout" (With what items? Which user state?)
Advanced Description Techniques
Sequential Flows
"Test complete user registration flow from signup form to email verification"
"Test full purchase journey from product selection to order confirmation"
"Test onboarding process from account creation to first successful action"
Conditional Logic
"Test free trial user sees upgrade prompt when accessing premium features"
"Test mobile users can access all features available on desktop"
"Test empty cart shows promotional content and popular products"
Error Scenarios
"Test form validation prevents submission with invalid email format"
"Test payment processing handles declined credit card gracefully"
"Test network error shows appropriate retry options to user"
Performance Considerations
"Test large product catalog loads within acceptable time limits"
"Test image gallery displays correctly even with slow connections"
"Test search suggestions appear quickly as user types"
Multi-Step Test Descriptions
Single Focused Test
✅ "Test user can log in with valid credentials"
Multi-Step Journey
✅ "Test new user can create account, verify email, and complete profile setup"
✅ "Test shopping flow: browse products, add to cart, checkout, and receive confirmation"
When to Break Down
- If test covers more than 5 distinct user actions
- If failure could be ambiguous about which step failed
- If different parts test unrelated functionality
- If test takes longer than 2 minutes to complete
Writing for Different Platforms
Web Applications
"Test responsive design shows mobile menu on small screens"
"Test keyboard navigation works for accessibility"
"Test browser back button maintains correct page state"
Mobile Applications
"Test swipe gestures navigate between screens"
"Test touch targets are appropriately sized for fingers"
"Test app handles device rotation correctly"
API-Driven Applications
"Test real-time updates appear without page refresh"
"Test offline mode shows cached content"
"Test sync functionality updates data when connection restored"
Ready to test? Apply these patterns in your Workflows to get the most from DebuggAI.