Skip to content

tvalentius/WebTestAgenticAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:
git clone https://github.com/tvalentius/WebTestAgenticAI.git
cd WebTestAgenticAI
  1. Install dependencies:
npm install
  1. Create a .env file in the root directory and add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_here

Usage

  1. Start the server:
node server.js
  1. Run a test:
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:

{
  "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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published