This test suite provides comprehensive automated testing for real estate search platform using Playwright and TypeScript.
playwright-test-example/
βββ tests/
β βββ pages/ # Page Object Models
β β βββ BasePage.ts
β β βββ SearchPage.ts
β β βββ PropertyDetailsPage.ts
β βββ fixtures/ # Test data
β β βββ testData.json
β βββ utils/ # Helper functions
β β βββ helpers.ts
β βββ specs/ # Test specifications
β βββ propertySearch.spec.ts
β βββ propertyDetails.spec.ts
βββ playwright.config.ts # Playwright configuration
βββ package.json
-
Install dependencies:
npm install
-
Install Playwright browsers:
npx playwright install
-
Create screenshots directory:
mkdir screenshots
Run all tests:
npx playwright test
Run specific test file:
npx playwright test tests/specs/propertySearch.spec.ts
Run tests in headed mode:
npx playwright test --headed
Run tests in specific browser:
npx playwright test --project=chromium
Generate HTML report:
npx playwright show-report
- β Search by location and price range
- β Verify search results accuracy
- β Invalid parameter handling
- β Multiple filter combinations
- β Sorting functionality
- β Map view toggle
- β Comprehensive information display
- β Image gallery navigation
- β Contact form functionality
- β Agent information display
- β Viewing schedule information
- β Favorite functionality
- β Mobile responsiveness
- Page Object Model: Separates test logic from page structure for maintainability
- Data-Driven Testing: Externalized test data in JSON for easy updates
- Reusable Utilities: Common functions centralized in helpers
- Cross-Browser Testing: Configured for Chrome, Firefox, Safari, and mobile
- Screenshot Documentation: Automatic screenshots on failures and key steps
The framework is designed for easy CI/CD integration with:
- Configurable retry mechanisms
- Parallel execution support
- HTML and video reporting
- Environment-based configuration
- Explicit waits over implicit waits
- Robust error handling
- Meaningful test descriptions
- Isolated test execution
- Comprehensive logging