π¨ UNDER CONSTRUCTION π¨
β οΈ This project is currently in development phase β οΈ
π More features and improvements coming soon! π
A Python-based web automation testing framework using NovaAct for browser automation and testing workflows. This framework enables automated testing of web applications with intelligent step execution, result validation, and comprehensive reporting.
- Prerequisites
- Installation
- Configuration
- Usage
- JSON Configuration
- Results Export and Chain of Thought Capture
- Understanding the Results
- Deployment to AWS Lambda
- Project Structure
- Utilities
- Dependencies
- Troubleshooting
- Contributing
- Python 3.8 or higher
- AWS Account (for Lambda deployment and Secrets Manager)
- NovaAct API Key
- Web browser (Chrome/Chromium recommended)
-
Clone the repository:
git clone <repository-url> cd novaact-web-testing
-
Install dependencies:
pip install -r src/requirements.txt
-
Set up environment variables: Create a
.envfile in thesrc/directory:NOVA_ACT_API_KEY="your-nova-act-api-key" LOGS_DIRECTORY="./tmp/temp/" TEMP_FOLDER="./tmp/temp-session" SECRET_NAME="your-aws-secret-name"
-
Configure AWS credentials (for Secrets Manager access):
aws configure
| Variable | Description | Default |
|---|---|---|
NOVA_ACT_API_KEY |
Your NovaAct API key | Required |
LOGS_DIRECTORY |
Directory for storing logs | ./tmp/temp/ |
TEMP_FOLDER |
Temporary session folder | ./tmp/temp-session |
SECRET_NAME |
AWS Secrets Manager secret name | Required |
Store your test credentials in AWS Secrets Manager with the following structure:
{
"your-platform-name": {
"mail": "test@example.com",
"password": "your-password"
}
}-
Run tests without recording:
cd src python main.py -
Run tests with video recording:
cd src python main.py record -
Manual login/browsing:
cd src python main.py login https://your-test-site.com
python main.py- Run all test cases without recordingpython main.py record- Run all test cases with video recordingpython main.py login <URL>- Open browser for manual login/browsing
Create your test configuration in prompts.json:
{
"test_platform": "your-platform-name",
"test_cases": [
{
"id": 1,
"route": "https://your-test-site.com",
"description": "Test case description",
"prompts": [
{
"step": "Click on email field",
"type": "input"
},
{
"step": "Click on password field",
"type": "input"
},
{
"step": "Click login button",
"type": "none"
},
{
"step": "Verify welcome message appears",
"type": "none"
}
]
}
]
}input: Steps that require user input (email, password, etc.)none: Steps that don't require input (clicks, validations, etc.)
The framework automatically captures and exports:
- Session metadata (session ID, act ID, step count)
- Test execution results (pass/fail status, errors)
- Chain of thought data from NovaAct's decision process
- Excel reports with comprehensive test results
- Automatic Excel file generation (
results.xlsx) - Detailed step-by-step execution logs
- Error tracking and reporting
- Session replay capabilities
Each test execution generates:
{
"session_id": "unique-session-identifier",
"act_id": "action-identifier",
"test_case_id": 1,
"num_steps_executed": 4,
"description": "Test case description",
"prompt": "Last executed prompt",
"test_passed": True/False,
"error": "Error message if failed"
}- β Success: All steps passed
- β Failed: Step validation failed
β οΈ Error: Execution error occurred
cd src
make buildThis creates my_deployment_package.zip ready for Lambda deployment.
- Runtime: Python 3.8+
- Handler:
lambda_function.lambda_handler - Timeout: 15 minutes (recommended)
- Memory: 1024 MB (minimum)
{
"action": "default|record|login",
"url": "https://example.com" // Required for login action
}{
"status": "workflow executed",
"results": [
/* test results array */
]
}src/
βββ classes/
β βββ __init__.py
β βββ classes.py # Pydantic models and type definitions
βββ constants/
β βββ __init__.py
β βββ constants.py # Application constants and messages
βββ libraries/ # Packaged dependencies for Lambda
βββ tmp/ # Temporary files and logs
βββ utils/
β βββ __init__.py
β βββ export_results.py # Excel export functionality
β βββ export_utils.py # Export utility functions
β βββ nova_utils.py # NovaAct integration utilities
βββ .env # Environment configuration
βββ lambda_function.py # AWS Lambda entry point
βββ main.py # Local execution entry point
βββ makefile # Build automation
βββ prompts.json # Test configuration
βββ requirements.txt # Python dependencies
nova_utils.py: NovaAct integration, step execution, AWS Secrets Managerexport_results.py: Excel report generationexport_utils.py: Data processing and formatting utilities
run_test_case(): Execute a complete test caseexecute_step(): Execute individual test stepsget_secret(): Retrieve credentials from AWS Secrets Managerexport_results_to_excel(): Generate Excel reports
python-dotenv # Environment variable management
pydantic # Data validation and serialization
nova-act # Web automation framework
boto3 # AWS SDK
openpyxl # Excel file generation
All dependencies are automatically managed through requirements.txt.
-
NovaAct API Key Issues
Error: Invalid API key Solution: Verify NOVA_ACT_API_KEY in .env file -
AWS Secrets Manager Access
Error: Unable to retrieve secret Solution: Check AWS credentials and secret name -
Browser Automation Issues
Error: Browser launch failed Solution: Ensure Chrome/Chromium is installed -
File Not Found: prompts.json
Error: prompts.json not found Solution: Copy prompts_example.json to prompts.json and configure
Enable verbose logging by setting environment variables:
export NOVA_ACT_DEBUG=true
export LOGS_DIRECTORY="./debug-logs/"- Session logs:
./tmp/temp/ - Video recordings: Available when using
recordmode - Excel reports:
results.xlsxin project root
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow PEP 8 style guidelines
- Add type hints to all functions
- Include docstrings for public methods
- Write tests for new functionality
- Update documentation as needed
def example_function(param: str) -> bool:
"""
Example function with proper typing and documentation.
Args:
param: Description of parameter
Returns:
Boolean indicating success
"""
return TrueThis project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Check the troubleshooting section
- Review the NovaAct documentation
This project uses NovaAct for web automation. Make sure you have proper API credentials configured.
Note: This project is under active development. Features and APIs may change between versions.