This project provides a Selenium + TestNG automation framework for testing Google Cloud's Pricing Calculator and disposable email functionality. It supports automated generation of compute engine estimates, sharing via temporary email, and verification of the estimate consistency.
The framework is modular, with clearly defined page objects, models, utils, drivers, and data providers for scalable tests automation.
- Navigate Google Cloud and interact with the Pricing Calculator
- Fill Compute Engine configurations dynamically via data providers
- Generate pricing estimates and verify calculated costs
- Share estimates via disposable email services
- Validate email inbox accessibility and received emails
- Utilities for browser tab management, clipboard, logging, and screenshots
- Multi-browser support (Chrome, Firefox, Edge) via WebDriverManager
This project was deliberately refactored to apply object-oriented design principles and proven design patterns, improving maintainability, extensibility, and test isolation. Below is a summary of the key patterns used and the problems they solve.
Used in: DriverFactory, EmailPageFactory
Purpose: Decouple object creation from usage.
- Centralizes WebDriver instantiation logic, separating browser creation from lifecycle management.
- Simplifies creation of complex page objects related to email functionality.
- Makes the framework easier to extend (e.g., adding new browsers or new email pages) without modifying client code.
Used in: ComputeEngineConfigurator and its decorators
Purpose: Extend behavior without modifying existing code (Open/Closed Principle).
- Optional compute engine features (GPU, commitment) are implemented as decorators.
- New configuration options can be added by creating new decorators rather than changing core logic.
- Avoids large conditional blocks and feature-specific branching.
Used in: EmailFacade
Purpose: Provide a simplified interface to complex subsystems.
- Encapsulates coordination between multiple email-related page objects.
- Test code interacts with a single, high-level API instead of orchestrating multiple pages.
- Reduces coupling and improves readability of test scenarios.
Used in: TestContext
Purpose: Encapsulate environment and execution context.
- Centralizes access to shared test state such as base URLs and WebDriver instances.
- Keeps test classes focused purely on test logic rather than setup and configuration.
- Improves consistency across tests and environments.
Used in: TestSession
Purpose: Ensure a single shared instance for global session data.
- Provides a single source of truth for session-level metadata (environment, execution time).
- Prevents duplication and inconsistent state across tests.
Used in: RetryTransformer
Purpose: Apply cross-cutting behavior dynamically.
- Automatically attaches retry logic to tests without modifying individual test classes.
- Standardizes retry behavior across the entire test suite.
- Keeps retry concerns separate from test logic.
Applied across the framework
- UI interaction logic extracted into
UiActions, decoupling pages from low-level actions. - Page objects depend on abstractions rather than concrete implementations.
- Each class has a clearly defined responsibility.
- Manage browser tabs and windows
- Read from the system clipboard
- Clear the system clipboard
- Centralized WebDriver lifecycle and configuration management
- Log info, debug, and error messages using Log4j2
- Capture screenshots for:
- Test failures
- Verification and reporting
- Represents a compute engine configuration
- Represents an email entity with:
- Recipient
- Subject
- Body
- Main landing page
- Performs search actions
- Handles navigation through search results
- Accesses:
- Pricing calculator forms
- Promotional banners
- Handles filling out the compute engine configuration form
- EmailHomePage
- EmailGeneratorPage
- EmailInboxPage
Responsibilities:
- Disposable email generation
- Inbox access and interaction
- Framework: TestNG
smokeregression
- Uses
ComputeEngineDataProvider - Supplies multiple compute engine configurations
- Verifies accessibility of the pricing calculator
- Verifies:
- Disposable email generation
- Inbox accessibility
- End-to-end flow:
- Generate a pricing estimate
- Share the estimate via email
- Verify price consistency between UI and email