How anhtester/automationframeworkcucumbertestng works
Main Components
• Test Execution Layer: Represent the runners and test suites located under src/test (e.g., TestRunnerAllFeatureByTag, LoginCMSTestRunner).
• Feature & Step Definitions: Highlight the use of Cucumber feature files (in src/test/resources/features) and step definition classes (e.g., LoginSteps, DashboardSteps).
– Annotations: FrameworkAnnotation for marking tests.
– Config: ConfigFactory and Configuration for managing system settings.
– Constants: FrameworkConstants containing global settings or base paths.
– Driver Management: BrowserFactory, DriverManager, TargetFactory ensuring browser control and Selenium session management.
– Enums & Exceptions: Define types such as Browser, Platform, FailureHandling, and custom exceptions.
– Helpers & Utils: Modular packages providing functionalities for screen recording, file handling, Excel/JSON parsing, logging, etc.
– Keywords: The WebUI class holds core actions (e.g., clicking, waiting, verifying UI elements).
– Mail & Report Modules: EmailConfig, EmailAttachmentsSender for sending test reports via email, and AllureManager, ExtentReportManager, ExtentTestManager, TelegramManager for reporting.
Relationships and Data Flow
• How test cases (under src/test) use the TestNG and Cucumber runners to trigger test execution.
• Demonstrate how the runners call the “WebUI” keyword methods and how these keywords, in turn, interact with the driver layer (BrowserFactory/DriverManager) to open browsers and execute Selenium commands.
• That configuration and constant modules have a cross-cutting role, feeding settings to all components (e.g., specifying browser type from Maven commands).
• CI/CD aspect showing the GitHub Actions workflow (maven.yml) that builds and triggers tests on commit.
Architectural Patterns and Design Principles
• Separation of Concerns: The project clearly delineates responsibilities (tests, drivers, reporting, config, and utilities).
• Factory/Utility Patterns: The driver management package uses factory patterns (e.g., BrowserFactory, TargetFactory) to manage browser instantiation.
• Extensibility: The modular setup (distinct packages for drivers, helpers, reports) makes it easy to add new functionality or adapt to changes.
• Parallel Execution Support: The ability to run tests in parallel (as noted in the README) suggests that the design carefully isolates test execution contexts.