This project provides end-to-end test automation for the JDXP (Jamaica Digital Exchange Platform) using Playwright with BDD (Behavior Driven Development) approach.
- Isolated Modules: Each test area (membership, third-party-accreditation) is completely separate
- Page Object Model: Enhanced page objects with your existing locator entity approach
- Entity-Aware Testing: Automatic handling of local vs foreign entity differences
- Fixtures: Dependency injection for clean, reusable test code
jdxp-test-automation-playwright-bdd/
βββ test/
β βββ Modules/
β βββ membership/ # Membership module (isolated)
β β βββ config/
β β β βββ entity-types.ts # Entity type definitions
β β β βββ locators.config.ts # Your locator entity approach
β β βββ features/ # Gherkin feature files
β β βββ fixtures/ # Playwright BDD fixtures
β β βββ pages/ # Page Object Models
β β βββ steps/ # Step definitions
β β βββ playwright.config.ts # Module-specific config
β β
β βββ third-party-accreditation/ # Future module (isolated)
β
βββ test-results/ # Test outputs
βββ .generated/ # Auto-generated test files
βββ package.json
npm installnpm run test:install# Generate BDD tests and run membership module
npm run bdd:membership
# Run on different environments
npm run bdd:membership:dev # Development environment
npm run bdd:membership:qa # QA environment
npm run bdd:membership:sandbox # Sandbox environment
# Run with different modes
npm run bdd:membership:headed # With browser UI
npm run bdd:membership:headless # Headless mode# Third-party accreditation (when implemented)
npm run bdd:accreditation
npm run bdd:accreditation:qa
# Run all modules
npm run bdd:allTests automatically adapt to local vs foreign entities using tags:
@local-entity
Scenario: Local entity registration
# Uses local entity locators and flow
@foreign-entity
Scenario: Foreign entity registration
# Uses foreign entity locators and flowYour existing locator configuration is enhanced for Playwright BDD:
// Automatic locator selection based on entity type
const memberDetailsPage = new MemberDetailsPage(page, entityType);
await memberDetailsPage.fillCompanyTRN("123456789"); // Uses correct locatorPage objects provide both granular and workflow methods:
// Granular control
await memberDetailsPage.fillCompanyTRN("123456789");
await memberDetailsPage.fillBranchNumber("001");
// Workflow methods
await memberDetailsPage.fillBasicCompanyInfo(companyData);
await memberDetailsPage.completeForm(fullData);Automatic dependency injection:
// Step definitions get pre-configured page objects
Given('I am on the member details page', async ({ memberDetailsPage }) => {
await memberDetailsPage.goto(); // Already configured for correct entity type
});Write business-readable scenarios in features/ directories:
Feature: Member Details Registration
@local-entity
Scenario: Complete local entity registration
Given I am on the member details page
When I complete the member details form
Then the form should be submitted successfullyImplement steps using fixtures in steps/ directories:
When('I complete the member details form', async ({ memberDetailsPage, entityType }) => {
console.log(`Completing form for ${entityType} entity`);
await memberDetailsPage.completeForm(testData);
});Create page objects in pages/ directories using your locator entity approach:
export class MemberDetailsPage extends BasePage {
private locators = getPageLocators('memberDetails', this.entityType);
async fillCompanyTRN(trn: string) {
await this.fillInput(this.locators.companyTRN, trn);
}
}Set via environment variables or npm scripts:
- Development:
https://jdxp.nginxdev.egovja.com - QA:
https://jdxp.appsqa.egovja.com - Sandbox:
https://jdxp.appsandbox.egovja.com - Pre-prod:
https://jdxp.appspreprod.egovja.com
Each module can configure its own browsers and settings in playwright.config.ts.
npm run test:report- HTML Report:
test-results/membership-playwright-report/ - JSON Results:
test-results/membership-results.json - JUnit XML:
test-results/membership-results.xml
npm run test:debugnpm run test:uiAutomatic screenshots on failure, stored in test-results/screenshots/
- Create new module directory:
test/Modules/new-module/ - Copy structure from membership module
- Update locators, pages, and features for new module
- Add npm scripts in
package.json - Create module-specific
playwright.config.ts
- β Isolated Modules: One module failure doesn't affect others
- β Entity-Aware: Automatic local/foreign entity handling
- β Maintainable: Your existing locator entity approach preserved
- β Scalable: Easy to add new modules and tests
- β Reliable: Playwright's robust automation
- β Fast: Parallel execution and efficient test runs
- Developer Guide - Comprehensive development documentation and patterns
- Implementation Notes - Technical implementation details and context
- Architecture Decisions - Decision rationale and trade-offs
- Quick Reference - Commands, patterns, and troubleshooting
- Project Summary - Overview and achievements
- Architecture Patterns - Modular design, entity-aware testing, locator entity pattern
- Development Workflows - Adding modules, pages, entity types, and test scenarios
- Troubleshooting Guide - Common issues and solutions
- Best Practices - Code organization, testing strategies, and maintenance
- Extension Guide - How to scale and extend the framework
- Getting Started: See installation and setup instructions above
- Adding Tests: Check Developer Guide
- Troubleshooting: See Quick Reference
- Architecture: Review Architecture Decisions
This architecture provides a robust, scalable foundation for comprehensive test automation while maintaining the flexibility to adapt to changing business requirements.