AI Test Generation
Writing test cases from scratch is time-consuming. ProvaLab.io AI can generate comprehensive test cases for you in seconds -- from requirements documents, user stories, or even a short description of what you want to test. You review and refine the results, then add them straight to your project.
Two Ways to Generate Test Cases
Method 1: Generate from Requirements
If you have a user story, acceptance criteria, or requirements text, ProvaLab.io AI can turn it into a full set of test cases.
-
Navigate to AI Assistant in the sidebar (or press
Ctrl+K/Cmd+K). -
Select Generate Test Cases from the quick actions menu.
-
Paste or type your requirement. For example:
"As a user, I want to reset my password via email so that I can regain access if I forget my password."
-
Choose a target module (e.g., Authentication) and set the priority (e.g., High).
-
Click Generate.
-
ProvaLab.io AI analyzes the requirement and creates a set of test cases covering the feature.
Method 2: Generate from a Description
You do not need a formal requirement. Just describe what you want to test in your own words.
-
Open the AI Assistant chat panel.
-
Type something like:
"Generate test cases for the shopping cart checkout flow, including adding items, updating quantities, applying coupons, and completing payment."
-
The AI generates a full set of test cases based on your description.
-
Review the results in the chat panel.
The more detail you provide in your description, the better the generated test cases will be. Mention specific features, edge cases, and user roles if relevant.
Method 3: Generate from a Document
If your requirements live in a document, you can upload it directly.
- Go to AI Assistant and select Generate from Document.
- Upload your file (PDF, DOCX, or TXT).
- Select the document type:
- Requirements Document
- User Story
- API Specification
- Click Analyze & Generate.
- The AI extracts requirements from the document and generates corresponding test cases.
- Review the results and save the ones you want.
Reviewing AI-Generated Test Cases
After generation, each test case is presented with:
- Title -- A clear, descriptive name (e.g., "Verify user can reset password with valid email")
- Steps -- Numbered actions with expected results for each step
- Priority -- Suggested priority level (Critical, High, Medium, Low)
- Type -- Suggested test type (Functional, Regression, Smoke, etc.)
- Preconditions -- Any setup required before the test can run
- Tags -- Suggested tags for easy filtering
You can:
- Accept as-is -- Click "Add to Project" to save the test case without changes.
- Edit before saving -- Click "Edit" to modify the title, steps, priority, or any other field before adding it.
- Discard -- Click "Remove" to skip a test case you do not need.
- Accept all -- Use the "Add All to Project" button to save the entire batch at once.
Types of Test Cases AI Can Generate
When you generate test cases, ProvaLab.io AI produces a well-rounded mix of test types:
Positive Tests (Happy Path)
Tests that verify the feature works correctly under normal conditions.
Example: "Verify that a user with a valid email receives a password reset link within 2 minutes."
Negative Tests
Tests that verify the system handles invalid input and error conditions gracefully.
Example: "Verify that entering an unregistered email address displays an appropriate error message."
Edge Cases
Tests for boundary conditions and uncommon scenarios.
Example: "Verify that a password reset link expires after 24 hours and cannot be reused."
Security Tests
Tests that check for common security vulnerabilities related to the feature.
Example: "Verify that the password reset token cannot be brute-forced by rate-limiting requests."
You can guide the AI to focus on specific test types. For example: "Generate only negative and edge case tests for the file upload feature." This is especially useful when you already have good happy-path coverage and want to strengthen other areas.
Example: Full Generation Workflow
Here is a complete example of generating test cases from a requirement:
Your Requirement:
"As a user, I want to log in with my Google account so that I don't have to remember another password."
AI-Generated Test Cases:
| # | Title | Type | Priority |
|---|---|---|---|
| 1 | Verify user can log in with a valid Google account | Positive | High |
| 2 | Verify "Sign in with Google" button is visible on the login page | UI | Medium |
| 3 | Verify user is redirected to Google OAuth consent screen | Functional | High |
| 4 | Verify user account is created on first Google login | Positive | High |
| 5 | Verify existing user can link Google account to their profile | Positive | Medium |
| 6 | Verify login fails gracefully when Google OAuth is unavailable | Negative | High |
| 7 | Verify user can cancel Google login and return to the login page | Negative | Medium |
| 8 | Verify Google login works across Chrome, Firefox, and Safari | Compatibility | Medium |
| 9 | Verify Google login token cannot be intercepted or replayed | Security | High |
| 10 | Verify session is created with correct permissions after Google login | Security | High |
Each test case includes full step-by-step instructions and expected results that you can view by expanding the row.
Best Practices
- Start with a clear requirement. A well-written user story produces better test cases than a vague description.
- Review every generated test case. AI is a starting point, not a final answer. Adjust steps and expected results to match your application's actual behavior.
- Generate in batches by feature. Rather than generating test cases for an entire project at once, work feature by feature for better results.
- Combine with manual test cases. AI-generated tests complement your manually written ones. Use AI for breadth, then add your domain expertise for depth.
- Regenerate when requirements change. If a feature's requirements evolve, generate a fresh set of test cases and compare them with your existing ones to find gaps.