An open API service indexing awesome lists of open source software.

https://github.com/tvalentius/WebTestAgenticAI


https://github.com/tvalentius/WebTestAgenticAI

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

          

# Website Testing Agentic AI

A proof of concept for website testing software using Playwright and OpenAI's LLM. This tool automates testing of video converter websites and provides detailed reports with AI-powered analysis.

## Features

- Automated testing of video converter websites
- AI-powered analysis of test results
- Screenshot capture at each testing step
- Detailed HTML reports with visual feedback
- RESTful API endpoints for test execution and results

## Prerequisites

- Node.js (v16 or higher)
- npm or yarn
- OpenAI API key

## Installation

1. Clone the repository:
```bash
git clone https://github.com/tvalentius/WebTestAgenticAI.git
cd WebTestAgenticAI
```

2. Install dependencies:
```bash
npm install
```

3. Create a `.env` file in the root directory and add your OpenAI API key:
```env
OPENAI_API_KEY=your_openai_api_key_here
```

## Usage

1. Start the server:
```bash
node server.js
```

2. Run a test:
```bash
curl -X POST http://localhost:3001/api/run-test
```

## API Endpoints

### POST /api/run-test
Executes a website test and returns both JSON results and generates an HTML report.

**Response:**
```json
{
"testName": "YouTube URL Upload Test - video-converter.com",
"status": "pass/fail",
"timestamp": "ISO timestamp",
"steps": ["array of test steps"],
"failedSteps": ["array of failed steps"],
"screenshots": ["array of screenshot filenames"],
"description": "AI-generated analysis",
"htmlReport": "/test-report.html"
}
```

### GET /test-report.html
View the latest test report in a beautifully formatted HTML page.

Features:
- Test status and timing information
- Step-by-step results with success/failure indicators
- Screenshot gallery
- AI analysis and recommendations
- Responsive design for all devices

### GET /screenshots/[filename]
Access individual screenshots captured during the test.

### GET /api/test-results
Retrieve the history of all test results.

## Project Structure

```
.
├── server.js # Main server file with API endpoints
├── playwright.config.js # Playwright configuration
├── screenshots/ # Directory for test screenshots
├── package.json # Project dependencies
└── .env # Environment variables
```

## Test Report Features

The HTML test report includes:

1. Test Information
- Test name and timestamp
- Website being tested
- Test duration
- Overall status

2. Step-by-Step Results
- Visual indicators for pass/fail steps
- Detailed error messages
- Screenshots at each step

3. AI Analysis
- Comprehensive test analysis
- Failure root cause analysis
- Impact assessment

4. Visual Documentation
- Screenshot gallery
- Step annotations
- Error highlights

5. Recommendations
- Suggested improvements
- Next steps
- Best practices

## Contributing

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## License

This project is licensed under the MIT License - see the LICENSE file for details.