vkmita/volo

Volo notification bot

โ˜… 0Forks 0TypeScriptGitHub โ†—Compare

README

Volo Sports Automation

This project contains Playwright automation scripts for Volo Sports that:

  • Monitors available pickup games at Mission Bay Fields
  • Tracks games you're already registered for
  • Sends email notifications when new games become available
  • Runs automatically on a schedule via GitHub Actions

Features

๐Ÿ” Game Monitoring

  • Automatically logs into your Volo Sports account
  • Checks games you're currently registered for on your dashboard
  • Searches Mission Bay Fields for available pickup soccer games
  • Paginates through all results to find every available game

๐ŸŽฏ Smart Filtering

  • Extracts game details: date, time, skill level, and spots available
  • Filters out games you're already registered for
  • Shows only available games you can join

๐Ÿ“ง Email Notifications

  • Tracks previously found games in previous-games.json
  • Detects when new games are added
  • Sends formatted email notifications with game details
  • Includes a direct link to register

โฐ Automated Scheduling

  • Runs on a schedule via GitHub Actions (default: daily at 9 AM UTC)
  • Automatically commits results to track changes between runs
  • Can be manually triggered anytime from GitHub Actions UI

Setup

Local Development

  1. Install dependencies:

    npm install
  2. Install Playwright browsers:

    npx playwright install chromium
  3. Set environment variables: Create a .env file in the root directory:

    # Required
    VOLO_EMAIL=[email protected]
    VOLO_PASSWORD=your-password
    
    # Optional - Email Notifications
    EMAIL_ENABLED=true
    EMAIL_SERVICE=gmail
    EMAIL_USER=[email protected]
    EMAIL_PASS=your-app-password
    EMAIL_TO=[email protected]

    For Gmail:

    • You'll need to generate an App Password
    • Don't use your regular Gmail password
    • Enable 2-factor authentication first
  4. Run tests locally:

    # Run tests in headless mode
    npm test
    
    # Run tests with browser visible
    npm run test:headed
    
    # Debug tests
    npm run test:debug

GitHub Actions Setup

The workflow is configured to run automatically on a schedule (daily at 9 AM UTC by default).

  1. Add secrets to your GitHub repository:

    • Go to your repository Settings > Secrets and variables > Actions

    • Add the following required secrets:

      • VOLO_EMAIL: Your Volo Sports email
      • VOLO_PASSWORD: Your Volo Sports password
    • Add these optional secrets for email notifications:

      • EMAIL_ENABLED: Set to true to enable notifications
      • EMAIL_SERVICE: Email service (e.g., gmail)
      • EMAIL_USER: Your email address
      • EMAIL_PASS: Your email app password
      • EMAIL_TO: Recipient email address
  2. Modify the schedule (optional): Edit .github/workflows/scheduled-login.yml and change the cron expression:

    schedule:
      - cron: "0 9 * * *" # Runs at 9:00 AM UTC daily

    Common cron examples:

    • '0 */6 * * *' - Every 6 hours
    • '0 9 * * 1-5' - Every weekday at 9 AM
    • '0 0 * * 0' - Every Sunday at midnight
  3. Manual trigger: You can also manually trigger the workflow from the Actions tab in your GitHub repository.

Project Structure

.
โ”œโ”€โ”€ .github/
โ”‚   โ””โ”€โ”€ workflows/
โ”‚       โ””โ”€โ”€ scheduled-login.yml    # GitHub Actions workflow
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ login.spec.ts              # Main automation script
โ”œโ”€โ”€ playwright.config.ts           # Playwright configuration
โ”œโ”€โ”€ package.json                   # Node.js dependencies
โ”œโ”€โ”€ previous-games.json            # Persisted game data (auto-generated)
โ””โ”€โ”€ README.md                      # This file

How It Works

  1. Login: Authenticates with your Volo Sports credentials
  2. Dashboard Check: Retrieves your currently registered games
  3. Discover Search: Navigates to Mission Bay Fields pickup games page
  4. Pagination: Loops through all pages to collect every available game
  5. Date Extraction: Associates games with their date headers ("Today", "Sat Nov 1", etc.)
  6. Filtering: Removes games you're already registered for
  7. Change Detection: Compares current results with previous run
  8. Notification: Sends email if new games are found
  9. Persistence: Saves results for next comparison

Customization

Updating Selectors

The login test uses flexible CSS selectors that should work with most login forms. If the test fails, you may need to update the selectors in tests/login.spec.ts to match the actual form elements on the Volo Sports login page.

Adding More Tests

Create additional test files in the tests/ directory following the pattern:

import { test, expect } from "@playwright/test";

test("my test", async ({ page }) => {
  // Your test code here
});

Troubleshooting

  • Test fails on CI: Check the uploaded artifacts in the GitHub Actions run for screenshots and HTML reports
  • Selector issues: Use npm run test:debug locally to inspect the page and find the correct selectors
  • Environment variables not working: Ensure secrets are properly set in GitHub repository settings

Resources

Contributors

vkmita

Issues