""" Playwright Automation Script for Screenshot Captures --------------------------------------------------- This script automates login and screenshot capturing from multiple services: - RabbitMQ - Observium - Firewall - SFSSD - NVMe - Ceph (Cockpit) & OwnCloud - Zimbra Mail Admin Each service has a dedicated function for login, navigation, and screenshot capture. """ from playwright.sync_api import sync_playwright, TimeoutError as PWTimeout import time import re def rabbitmq_screenshot(url, username, password, selector, service): """ Capture RabbitMQ dashboard screenshot. Args: url (str): RabbitMQ login page URL username (str): RabbitMQ username password (str): RabbitMQ password selector (str): CSS selector of main element to capture service (str): Service name for screenshot filename """ output = f"service_{service}.png" with sync_playwright() as pw: # Launch browser context ctx = pw.chromium.launch(headless=True).new_context(ignore_https_errors=True) page = ctx.new_page() page.goto(url) print("Current URL:", page.url) # Fill login form page.fill('input[name="username"]', username) page.fill('input[name="password"]', password) # Try , fallback to