
playwright invoice automation
playwright-invoice-automation
Repository Info
About This Server
playwright-invoice-automation
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Playwright Invoice Automation
An automated end-to-end testing solution for generating and verifying invoice workflows using Playwright and Page Object Pattern.
Features
- Invoice Generation: Creates PDF invoices with configurable company details, line items, and totals
- Email Integration: Sends generated invoices via email and verifies receipt
- PDF Verification: Compares PDF content to ensure document integrity
- Reporting: Detailed test reports with screenshots and logs
- Page Object Pattern: Maintainable test architecture with separated concerns
- Error Handling: Robust error handling for network and service issues
- Logging: Comprehensive logging for debugging and monitoring
Project Structure
playwright-invoice-automation/
├── .cursor/ # MCP configuration
├── src/ # Source code
│ ├── config/ # Configuration files
│ ├── pages/ # Page objects
│ ├── reports/ # Test reports
│ ├── templates/ # Invoice templates
│ ├── tests/ # Test files
│ └── utils/ # Utilities (PDF, Email, etc.)
├── downloads/ # Downloaded files during tests
├── logs/ # Log files
├── output/ # Generated invoice PDFs
├── package.json # Dependencies
├── playwright.config.js # Playwright configuration
└── README.md # This file
Prerequisites
- Node.js (v14 or later)
- npm or yarn
Installation
- Clone the repository:
git clone https://github.com/yourusername/playwright-invoice-automation.git
cd playwright-invoice-automation
- Install dependencies:
npm install
- Install Playwright browsers:
npx playwright install
Configuration
The project uses a configuration file located at src/config/config.js. You can customize:
- Company details
- Invoice settings
- Email configuration
- PDF comparison settings
Usage
Running tests
Run all tests:
npx playwright test
Run tests with UI:
npx playwright test --ui
View HTML report:
npx playwright show-report src/reports/html
Using specific components
Invoice Generator
const InvoiceGenerator = require('./src/utils/invoiceGenerator');
const invoiceGenerator = new InvoiceGenerator();
const invoicePath = await invoiceGenerator.generateInvoice({
customer: {
name: 'Customer Name',
address: 'Customer Address',
email: 'customer@example.com'
},
items: [
{
description: 'Service',
quantity: 1,
rate: 100,
amount: 100
}
]
});
Email Service
const EmailService = require('./src/utils/emailService');
const emailService = new EmailService();
await emailService.initialize();
await emailService.sendEmail({
to: 'recipient@example.com',
subject: 'Invoice',
attachmentPath: '/path/to/invoice.pdf'
});
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Quick Start
Clone the repository
git clone https://github.com/lupusludens-se/playwright-invoice-automationInstall dependencies
cd playwright-invoice-automation
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.