Write end-to-end test scenarios that simulate real user interactions through the full application stack.
Fill in this template
The {{ }} placeholders are variables — drop in your own details, then copy the ready-to-use prompt. (Or copy the template as-is and let your AI assistant fill them in.)
0/3 filled
Preview filled prompt
You are a QA automation engineer writing end-to-end tests.
## User Flow to Test
{{USER_FLOW}}
## Application Description
{{APP_DESCRIPTION}}
## Test Framework
{{TEST_FRAMEWORK}}
## E2E Test Generation
### 1. User Flow Analysis
Break down the user flow into discrete steps:
- What pages/screens does the user visit?
- What actions does the user take? (click, type, select, scroll, drag)
- What does the user expect to see after each action?
- What data does the user need? (test accounts, sample data)
### 2. Test Scenarios
#### Primary Flow (Happy Path)
- Complete the user flow start to finish
- Verify all visual feedback (success messages, navigation, state changes)
- Verify data persistence (refresh the page, check the database)
#### Error Flows
- Submit forms with invalid data
- Interact with loading states
- Handle network failures gracefully
- Test session expiry during flow
#### Accessibility Flows
- Complete the flow using keyboard only
- Verify screen reader announcements for dynamic content
- Check focus management after interactions
#### Responsive Flows
- Test on mobile viewport (375px)
- Test on tablet viewport (768px)
- Test on desktop viewport (1280px)
### 3. Test Implementation Patterns
#### Page Object Model
- Create page objects for each page/component
- Encapsulate selectors and actions
- Use data-testid attributes for stable selectors
#### Test Data Management
- Create test data via API before tests (not via UI)
- Use unique identifiers per test run
- Clean up test data after completion
#### Waiting Strategy
- Wait for network requests to complete (not arbitrary timeouts)
- Wait for elements to be visible and interactive
- Use assertion retries for eventually-consistent UI
#### Screenshot & Visual Regression
- Capture screenshots at key states
- Compare against baseline images for visual regressions
### 4. Test Reliability
- Tests should be independent and can run in any order
- Tests should retry on flaky infrastructure failures (not on app bugs)
- Tests should have clear failure messages with screenshots
## Output Format
1. **Page Objects**: Reusable page object classes
2. **Test Data Setup**: API calls or fixtures for test data
3. **Test Suites**: Organized by user flow
4. **Configuration**: Framework config (baseURL, viewport, timeouts)
5. **CI Pipeline Notes**: How to run in CI with screenshots and videoTags
testinge2eautomationplaywrightcypress
Explore more prompts and rules
BeforeMerge offers hundreds of AI prompts, code review rules, guides, and detection patterns to help your team ship better code.