Test Cases
Test cases are the foundation of your testing strategy. Each test case describes a sequence of actions to perform and the expected results.
What are Test Cases?
A test case simulates how a user interacts with your application. For example:
- Navigate to the login page
- Enter username and password
- Click the “Sign In” button
- Verify the dashboard appears
Creating Test Cases
You have three ways to create test cases in BugBrain:
1. Manual Creation
Build tests step-by-step using our visual editor. Perfect for:
- Specific test scenarios
- Custom workflows
- Edge cases
2. AI Generation
Let AI create comprehensive test suites from descriptions. Best for:
- Rapid test coverage
- Complex user journeys
- Multiple variations
3. Discovery
Automatically generate tests by crawling your application. Ideal for:
- New applications
- Understanding existing flows
- Regression testing
Test Case Structure
Each test case contains:
| Component | Description |
|---|---|
| Title | Descriptive name (e.g., “User can login with valid credentials”) |
| Description | What the test verifies |
| Steps | Sequential actions to perform |
| Expected Results | What should happen at each step |
| Priority | Low, Medium, High, or Critical |
| Tags | Categories for organization (e.g., “login”, “auth”, “smoke”) |
Test Steps
Each step in a test case has:
- Action - What to do (click, type, navigate, assert, wait)
- Target - Where to do it (element selector or URL)
- Value - Input data or expected text
- Description - Human-readable explanation
Common Actions
| Action | Description | Example |
|---|---|---|
| Navigate | Go to a URL | Navigate to /login |
| Click | Click an element | Click the submit button |
| Type | Enter text | Type email into username field |
| Assert | Verify something exists | Assert dashboard heading is visible |
| Wait | Pause execution | Wait 2 seconds for page load |
Pro Tip: Use descriptive selectors like “button with text ‘Sign In’” instead of technical CSS selectors. This makes tests more readable and maintainable.
Organizing Test Cases
Using Priority
Set priority to indicate importance:
- Critical - Core functionality (login, checkout, data integrity)
- High - Important features used frequently
- Medium - Standard features
- Low - Nice-to-have or rarely used features
Using Tags
Tags help you organize and filter tests:
Examples:
- smoke, regression, integration
- login, auth, payment, search
- desktop, mobile, tablet
- production, stagingBest Practice: Use consistent tag naming across your organization. Create a tagging standard that everyone follows.
Test Case Status
Test cases can have different statuses:
| Status | Meaning |
|---|---|
| Draft | Work in progress, not ready to run |
| Active | Ready to run and included in test plans |
| Archived | Old or deprecated, not run anymore |
AI Quality Scoring
AI-generated tests include quality scores:
- 0-100 Score - Overall test quality rating
- Confidence Breakdown - Scores for clarity, completeness, and testability
- Suggestions - How to improve the test