How alumnium-hq/alumnium works
Main Components
• Alumni (Core Interface): This is the primary high-level interface (see alumni.py and the Alumni class in the README). It serves as the entry point where users call methods like “do”, “check”, and “get” to perform testing actions.
• Drivers Layer: Located in “alumnium/drivers”, this layer abstracts the actual browser drivers. There are implementations for Selenium and Playwright (plus scripts for supporting operations). This layer is responsible for interacting directly with the browser.
• Tools Layer: Found under “alumnium/tools”, these components (e.g., click_tool, drag_and_drop_tool, type_tool) encapsulate specific actions that streamline element interactions on web pages.
• Integration and Utility Modules: Additional files like alumni.py and aria.py act as orchestrators that tie the agents and drivers together, facilitating the overall test automation flow.
Relationships and Interactions
• The Client Code: Users write tests (as shown in the Quick Start section) which create an instance of Alumni. This instance then serves as the orchestrator.
• Command Flow: High-level test instructions are passed from the user code to the Alumni component. Alumni then leverages the appropriate Agent (actor, planner, or retriever) to parse and transform the instructions into actionable tasks.
• Action Execution: The Agents’ decisions are translated into operations provided by the Tools. These operations reach out to the Drivers, which interact with the actual browser.
• Data Flow & API Integration: Note the dependency on external services like OpenAI (indicated by the need for the “OPENAI_API_KEY”), suggesting that parts of the agents might use language models to interpret test commands.
Architectural Patterns and Design Principles
• Abstraction and Modularity: Different types of drivers and tools indicate the use of abstraction to support multiple interaction methods (i.e., Selenium vs. Playwright).
• Extensibility: The use of agents with prompt directories suggests that the system is designed to be extended with more behaviors and possibly further agent types.
Technologies and Frameworks
• AI and Language Processing: Likely integration with OpenAI’s API for natural language understanding.
• Test Automation: Use of Selenium, Playwright, and testing frameworks (pytest and behave) that interact with the underlying drivers.
• Python Ecosystem: The overall system is implemented in Python with a structured package (as evident from the pyproject.toml and Makefile).
• Integration: Clearly note the dependencies (e.g., environment variables like the API keys, and browser drivers).