How freeautomationlearning/playwritepom works
Main Components
• Test Runner & Configuration: Represent Maven (pom.xml) and TestNG (test suite XML files in testsuites/) as the entry point for running tests.
• Base Framework Components: Highlight the “com.freeautomationlearning.base” package that provides shared base classes and utilities for common functionality (session management, browser contexts, reporting).
• UI Module:
– UI Factories & Utilities: Show UIFactoryBase and its implementation classes, which manage browser launch, context, and overall UI operations.
– UI Page Objects: Include key page classes in “com.freeautomationlearning/ui/pages” (like HomePage, DashboardPage, ResetPassword) encapsulating user interactions.
– UI Test Scripts: Represent the tests in “src/test/java/com/freeautomationlearning/ui/testscripts” where the actual UI flows are executed.
• API Module:
– API Factories & Utilities: Display APIFactoryBase and its implementation classes for managing HTTP contexts and API calls.
– API Page Objects: Incorporate API classes in “com.freeautomationlearning/api/pages” (like LoginPage and Users) which encapsulate API endpoint interactions.
– API Test Scripts: Separate out the tests under “src/test/java/com/freeautomationlearning/api/testscripts” that drive API testing.
• Reporting & Listeners:
– Show the ExtentReportManager handling report creation and flushing.
– Include the TestListeners class that integrates with TestNG to capture events and trigger reporting.
• Utilities & Data Handling:
– Highlight the “utlis” package which houses APIConstants, Constants, UtilClass and shows how test data is read from JSON files under “src/test/resources”.
Establish Relationships and Interactions
• How the test scripts depend on Page Objects (using UI or API factories) and interact with utility classes for configuration and JSON test data.
• That both UI and API tests share common base classes and factories from the “base” package.
• Test Listeners to both the test execution process and the reporting component (ExtentReportManager) to illustrate logging and result aggregation.
• Dependency on external libraries such as Playwright for browser/API interactions and Extent Reports for the reporting layer.
Architectural Patterns
• Use of the Page Object Model (POM) which segments interactions for UI and API in dedicated classes.
• Separation of concerns: base functionalities, page interactions, and test scripts are clearly isolated which aids in maintainability.
• The use of TestNG listeners and Maven for integration and build management should be depicted.