Web Test Case Generator
Purpose
Analyzes frontend components (.vue , .jsx ) and business requirements to generate comprehensive test plans.
Strategy
- Component Analysis
Input: Login.vue
-
Props: Identify required props -> Test missing/invalid props.
-
Events: Identify emit -> Test interaction triggers event.
-
State: Identify v-if/v-show -> Test conditional rendering.
- E2E Scenario Generation
Input: "User Checkout Flow"
-
Entry Point: Home Page -> Product Page.
-
Action: Click "Add to Cart".
-
Validation: Cart count increases.
-
Checkout: Proceed to payment.
-
Success: Order confirmation shown.
Commands
generate_component_test
Prompt: "Generate unit tests for src/views/agri/cart/index.vue using Vue Test Utils." Action:
-
Read file content.
-
Identify user interactions (clicks, inputs).
-
Mock API calls (@/api/agri/order ).
-
Output cart.spec.js .
generate_e2e_test
Prompt: "Generate Playwright E2E test for the checkout process." Action:
-
Map out user journey.
-
Define test('checkout flow', ...) skeleton.
-
Fill in steps with robust locators.