How dntthuan064/e2e-pw-frwd works
Main Components
• Testing Orchestrator: At the core of the system is Cucumber that drives the test scenarios. Represent how Cucumber step definitions (located under src/features) execute test cases defined by the feature files.
• Web Testing Module:
• Use Playwright (with configuration in playwright.config.ts) to run web tests.
• Page Object Model for web pages under src/pages/web.
• Mobile Testing Module:
• Use Appium (configured via src/config/appium.config.ts) for mobile testing (Android/iOS).
• Mobile Page Objects under src/pages/mobile.
• Mobile driver utility (src/utils/mobile-driver.ts) that interacts with the Appium server.
• Common Utilities & Configuration:
• Shared utilities and types (located in src/common, src/common/types) that support both web and mobile testing.
• Configuration files (in src/config) that define environment settings.
• CI/CD Integration:
• Jenkins integration, represented by the Jenkinsfile and GitHub workflows, which trigger test execution and reporting.
• External Dependencies:
• Mention external services, such as the Playwright browsers, the Appium server and mobile emulators (Android SDK and Xcode), and Node.js/Yarn environment usage.
Relationships and Interactions
• Cucumber (test orchestrator) triggers the execution of test scenarios that use step definitions from src/features. These definitions invoke the appropriate page objects and utilities based on the platform.
• For web tests, the step definitions interact with the Playwright-driven page objects (src/pages/web) and then back to Cucumber for result assertions.
• For mobile tests, the step definitions interact with mobile page objects (src/pages/mobile) using mobile-driver utilities that communicate with the Appium server.
• Environment configurations and common shared types ensure consistency across tests.
• CI/CD (with Jenkins) integrates the entire test process, including dependency setup, environment variable usage (from .env), and report generation.
Architectural Patterns and Design Principles
• Page Object Model (POM): Separate page objects for web and mobile interfaces stored in src/pages, simplifying maintenance and reusability.
• Separation of Concerns: Dividing the framework into distinct directories for configuration, features (step definitions and hooks), page objects, common utilities, and scenarios.
• Behavior-Driven Development (BDD): Emphasizing tests written in Gherkin syntax (located in src/scenarios) that are mapped to step definitions.
• CI/CD integration: Use of Jenkinsfile and GitHub workflows to automate test executions.
Final Recommendations
• Every component is clearly named (e.g., “src/pages/web/login.page.ts” also representing a broader component “Web Login Page Object”).