An AI-powered test automation platform for O9 Supply Chain Planning, built for Mondelez. This system allows non-technical supply chain users to create, manage, and execute automated tests using natural language.
- Natural Language Test Generation: Convert plain English descriptions into automated test scripts
- AI-Powered Script Creation: Uses Claude API to generate Selenium automation scripts
- Inline Editing: Edit test steps directly and regenerate scripts
- Real-time Execution: Watch tests run with live browser screenshots
- Mock O9 Environment: Test automation without access to production O9
- Python 3.12
- FastAPI
- SQLite (development) / PostgreSQL (production)
- Anthropic Claude Sonnet 4 API
- Selenium WebDriver
- WebSocket (FastAPI WebSocket)
- React + Vite
- Tailwind CSS
- Socket.IO Client
O9Automation/
├── backend/
│ ├── app/
│ │ ├── __init__.py
│ │ ├── routes.py
│ │ ├── models.py
│ │ ├── database.py
│ │ ├── websocket_handler.py
│ │ └── services/
│ │ ├── ai_service.py
│ │ ├── ai_selenium_generator.py
│ │ ├── selenium_executor.py
│ │ └── selenium_service.py
│ ├── instance/
│ │ └── test_cases.db
│ ├── requirements.txt
│ ├── .env
│ └── run.py
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ ├── TestStepExecutor.jsx
│ │ │ ├── TestCaseDetail.jsx
│ │ │ └── ...
│ │ ├── App.jsx
│ │ └── main.jsx
│ ├── package.json
│ └── vite.config.js
├── mock-o9-website/
│ ├── index.html
│ ├── dashboard.html
│ ├── forecast.html
│ └── css/
├── .gitignore
└── README.md
-
Navigate to backend directory:
cd backend -
Create virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt --break-system-packages
-
Create .env file:
# Create backend/.env file with: ANTHROPIC_API_KEY=your_api_key_here O9_MOCK_URL=http://localhost:3001 -
Initialize database:
python run.py # Database will be created automatically in instance/ folder -
Run backend:
python run.py # Server will start on http://localhost:8000
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install
-
Run frontend:
npm run dev # App will start on http://localhost:5173
-
Navigate to mock website directory:
cd mock-o9-website -
Serve the website:
# Option 1: Python python3 -m http.server 3001 # Option 2: Node.js npx http-server -p 3001
-
Access at: http://localhost:3001
- Create Test Case: Navigate to the dashboard and create a new test case
- Add Test Steps: Describe each test step in natural language
- Generate Scripts: Click "Generate Script" to create automation
- Edit Steps: Click "Edit Step" to modify descriptions
- Regenerate: Click "Regenerate Script" after editing
- Run Tests: Click "Run Step" to execute automation
- View Results: See execution status and screenshots in real-time
GET /api/test-cases- List all test casesPOST /api/test-cases- Create new test caseGET /api/test-cases/<id>- Get test case detailsPUT /api/test-cases/<id>- Update test caseDELETE /api/test-cases/<id>- Delete test case
GET /api/test-cases/<id>/steps- Get all steps for a test casePOST /api/test-cases/<id>/steps- Create new stepPUT /api/test-cases/<id>/steps/<step_id>- Update stepDELETE /api/test-cases/<id>/steps/<step_id>- Delete stepPOST /api/test-steps/<id>/generate-selenium- Generate automation script
execute_step- Execute a single test stepstatus_update- Real-time execution statusprogress- Execution progress updatesscreenshot- Live browser screenshotsexecution_complete- Step execution finished
User Input (Natural Language)
↓
Claude API (Anthropic)
↓
JSON Commands (for execution) + Python Script (for display)
↓
Selenium WebDriver
↓
Browser Automation
↓
Results + Screenshots
User clicks "Run Step"
↓
WebSocket event triggered
↓
Backend initializes Chrome browser
↓
Executes JSON commands sequentially
↓
Sends real-time updates (progress, screenshots)
↓
Returns final status (passed/failed/error)
↓
Saves results to database
ANTHROPIC_API_KEY=your_key_here
O9_MOCK_URL=http://localhost:3001
DATABASE_URL=sqlite:///instance/test_cases.db
- API URL: http://localhost:8000
- WebSocket: ws://localhost:8000
- ChromeDriver: Managed automatically by Selenium Manager (4.6+)
- Database: SQLite for development, PostgreSQL for production
- AI Model: Claude Sonnet 4 (claude-sonnet-4-20250514)
- Browser: Headless Chrome for automation
- JSON-Only Execution: System only executes JSON commands, never Python scripts
- ChromeDriver may require manual installation on some systems
- WebSocket connections need CORS configuration for different origins
- Database migrations not automated (manual schema updates needed)
- Production deployment configuration
- PostgreSQL migration
- User authentication and multi-tenancy
- Test scheduling and CI/CD integration
- Advanced reporting and analytics
- Element locator recorder tool
- Actual O9 integration (replacing mock)
Proprietary - Mondelez International
For questions or support, contact the development team.
Note: This is an internal tool for Mondelez. Do not share API keys or sensitive information.