https://github.com/tvalentius/WebTestAgenticAI
https://github.com/tvalentius/WebTestAgenticAI
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tvalentius/WebTestAgenticAI
- Owner: tvalentius
- Created: 2024-12-24T10:54:49.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-12-24T10:56:56.000Z (12 months ago)
- Last Synced: 2025-01-06T00:36:02.768Z (11 months ago)
- Language: JavaScript
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome_ai_agents - Webtestagenticai - Web test Agent AI (Building / Testing)
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.