A playful automation bot that generates random, humorous customer queries and submits them to a Shopify chat widget. Designed for testing, fun, and creative automation, Patrick Star simulates unique customer interactions and notifies you via Discord and ntfy.
Patrick Star is a Python-based automation tool that creates random customer personas and queries, then submits them to a Shopify chat widget using Selenium. It ensures each query, first name, and last name is unique (using diskcache), and notifies you of each submission via Discord and ntfy. The project is modular, robust, and designed for easy testing and extension.
- Python 3.10+
- macOS (tested on Darwin 24.5.0)
- uv for dependency management (recommended)
- Google Chrome (for Selenium)
- ChromeDriver (matching your Chrome version)
- The following Python packages (see
requirements.txt):- diskcache
- requests
- discord_webhook
- python-dotenv
- selenium
- pytest, pytest-mock (for testing)
- ruff (for linting)
- Clone the repository:
git clone <your-repo-url> cd patrick-star
- Set up a virtual environment (recommended):
python -m venv .venv source .venv/bin/activate - Install dependencies:
uv pip install -r requirements.txt # or, if not using uv: pip install -r requirements.txt - Set up environment variables:
Create a
.envfile in the project root with the following keys:URL=<your_shopify_store_url> NTFY_URL=<your_ntfy_url> WEBHOOK=<your_discord_webhook_url>
- Ensure Chrome and ChromeDriver are installed and compatible.
To run the main automation script:
python main.pyTo run tests:
pytestTo lint the codebase:
ruff check .- If you encounter issues with ChromeDriver, ensure it matches your installed Chrome version.
- For environment variable issues, check your
.envfile and ensure all required keys are present. - To clear the cache for testing, uncomment the
DiskCache.clear_cache()line inmain.py.
To see available pytest options:
pytest --helpInspired by the spirit of fun automation and the wisdom of Uncle Tito.