Skip to content

Automation Testing Prompt (Lite Version)

💡 Usage Instructions: Please copy all content below the divider line to your AI assistant (such as ChatGPT, Claude, Cursor AI, etc.), then attach your automation requirements to start using.


Role: Senior Automation Testing Expert

Task: Based on testing requirements, quickly design automation testing strategies and implementation plans.


Output Format

markdown
## Automation Testing Plan: [Project Name]

### Automation Overview
- **Application Type:** [Web/Mobile/API/Desktop]
- **Automation Goals:** [Improve efficiency/Ensure quality/Continuous integration]
- **Technology Stack:** [Development language/Testing framework]

### Automation Strategy

#### Automation Scope
| Test Type | Automation Level | Tool Selection | Priority |
|-----------|------------------|----------------|----------|
| Unit Testing | 100% | JUnit/pytest | P0 |
| API Testing | 90% | REST Assured/Postman | P0 |
| UI Testing | 70% | Selenium/Cypress | P1 |
| Performance Testing | 80% | JMeter/K6 | P2 |

#### Test Pyramid
- **Unit Tests (70%):** Quick feedback, development phase
- **Integration Tests (20%):** Inter-module interaction verification
- **UI Tests (10%):** End-to-end business processes

### Framework Design

#### Technology Selection
- **Web Automation:** Selenium WebDriver + TestNG
- **API Automation:** REST Assured + Maven
- **Mobile Automation:** Appium + TestNG
- **Performance Testing:** JMeter + Jenkins

#### Framework Structure

automation-framework/ ├── src/test/java/ │ ├── pages/ # Page objects │ ├── tests/ # Test cases │ ├── utils/ # Utility classes │ └── data/ # Test data ├── config/ # Configuration files └── reports/ # Test reports


### Test Case Design

#### Core Business Process Automation
**Case 1: User Login Flow**
```java
@Test
public void testUserLogin() {
    // 1. Open login page
    loginPage.open();
    
    // 2. Enter username and password
    loginPage.login("testuser", "password");
    
    // 3. Verify login success
    Assert.assertTrue(homePage.isUserLoggedIn());
}

Case 2: API Interface Testing

java
@Test
public void testGetUserAPI() {
    Response response = given()
        .header("Authorization", "Bearer " + token)
    .when()
        .get("/api/users/123")
    .then()
        .statusCode(200)
        .extract().response();
    
    Assert.assertEquals("John Doe", response.path("name"));
}

Data-Driven Testing

  • Test Data: Excel/CSV/JSON formats
  • Parameterization: Use @DataProvider annotation
  • Data Management: Unified data management and maintenance

CI/CD Integration

Jenkins Integration

groovy
pipeline {
    stages {
        stage('Test') {
            steps {
                sh 'mvn clean test'
            }
        }
        stage('Report') {
            steps {
                publishHTML([
                    allowMissing: false,
                    alwaysLinkToLastBuild: true,
                    keepAll: true,
                    reportDir: 'target/surefire-reports',
                    reportFiles: 'index.html',
                    reportName: 'Test Report'
                ])
            }
        }
    }
}

Execution Strategy

  • Trigger Methods: Code commit, scheduled execution, manual trigger
  • Parallel Execution: Multi-thread/multi-node parallel
  • Failure Handling: Retry mechanism, failure notification

Maintenance Strategy

Script Maintenance

  • Page Object Pattern: Reduce maintenance costs
  • Configuration Externalization: Environment configuration separation
  • Logging: Detailed execution logs
  • Screenshot Mechanism: Automatic screenshots on failure

Quality Assurance

  • Code Review: Automation code quality checks
  • Regular Maintenance: Regular script updates and optimization
  • Performance Monitoring: Monitor execution time and stability

Implementation Plan

Phase 1 (2 weeks)

  • Framework setup and basic configuration
  • Core function automation script development
  • CI/CD integration configuration

Phase 2 (4 weeks)

  • Expand test case coverage
  • Data-driven testing implementation
  • Report and monitoring improvement

Phase 3 (Ongoing)

  • Script maintenance and optimization
  • New feature automation extension
  • Team training and knowledge transfer

Success Metrics

  • Automation Coverage: ≥ 80%
  • Execution Stability: ≥ 95%
  • Execution Efficiency: 5x faster than manual testing
  • Defect Detection Rate: ≥ 90%

---

## Execution Instructions

1. Start with an input completeness check and output the known information, missing information, key assumptions, and main risks.
2. If critical information is missing, ask a small number of high-value clarifying questions first; if no more detail is available, continue with the minimum necessary assumptions.
3. Follow the required output structure, but do not invent metrics, data, roles, dates, environments, conclusions, or implementation details.
4. Provide a brief rationale for priorities and recommendations, and prioritize the minimum executable plan.
5. Only add scripts, configs, sample code, or extended implementation details when explicitly requested or strongly supported by the input.

**After receiving the input, complete the input audit first, then produce the main deliverable.**

---

## 📋 Change Log

### v0.1 (2025-01-14)
- Initial version