DigitalConsumer.FixMyGlass/playwright-tests/README.md
maguire-arman 35e804e979 Updates environment config and test grep
Updates the environment configuration to correctly resolve the .env files path.
Also updates the test grep in README to use Alert tag.
2025-05-08 16:31:43 -04:00

266 lines
8.8 KiB
Markdown

# QA Automation Framework
An automated testing framework for FMG using Playwright with TypeScript.
## Technology Stack
• Playwright - Core testing framework <br>
• TypeScript - Programming language <br>
• Node.js - Runtime environment <br>
• SauceLabs/Dockers - Cross-browser testing platform <br>
## Key Features
• Page Object Model implementation <br>
• Data-driven test approach <br>
• Cross-browser testing support <br>
• Parallel test execution <br>
• HTML report generation <br>
• Environment-specific configurations <br>
• SauceLabs integration <br>
## Test Scenarios
The framework includes various test scenarios covering essential flows like:
### Cash Payment - Repair Scenarios
1. **CashRepairMobileCreditCard**<br>
- Repair or Replace: Repair<br>
- Damage Type: Windshield Chip (1)<br>
- Vehicle Lookup Type: ZIP<br>
- CASH or Insurance: CASH<br>
- Service Type: Glass Service Only<br>
- Service Location Type: Mobile<br>
- Schedule Appointment Type: Range of Hours<br>
- Payment Type: PIA - Credit Card<br>
2. **CashRepairInShopAfterPay**<br>
- Repair or Replace: Repair<br>
- Damage Type: Windshield Chip (2)<br>
- Vehicle Lookup Type: ZIP<br>
- CASH or Insurance: CASH<br>
- Service Type: Standard<br>
- Service Location Type: In-Shop<br>
- Schedule Appointment Type: Hourly<br>
- Payment Type: PIA - AfterPay<br>
3. **CashRepairInShopPayPal**<br>
- Repair or Replace: Repair<br>
- Damage Type: Windshield Chip (3)<br>
- Vehicle Lookup Type: ZIP<br>
- CASH or Insurance: CASH<br>
- Service Type: Premium<br>
- Service Location Type: In-Shop<br>
- Schedule Appointment Type: Hourly<br>
- Payment Type: PIA - PayPal<br>
### Cash Payment - Single Glass Replacement Scenarios
4. **CashReplaceDynamicRecalMobile**<br>
- Repair or Replace: Replace<br>
- Damage Type: Windshield Crack<br>
- Vehicle Lookup Type: VIN Lookup<br>
- CASH or Insurance: CASH<br>
- Service Type: Glass Service Only<br>
- Service Location Type: Mobile<br>
- Schedule Appointment Type: Range of Hours<br>
- Payment Type: Pay At Service<br>
- Vehicle Info: Dynamic Recalibration Vehicle<br>
5. **CashReplaceGlassAddressLookupInshopAfterPay**<br>
- Repair or Replace: Replace<br>
- Damage Type: Windshield Crack<br>
- Vehicle Lookup Type: Address Lookup<br>
- CASH or Insurance: CASH<br>
- Service Type: Glass Service Only<br>
- Service Location Type: In-Shop<br>
- Schedule Appointment Type: Hourly<br>
- Payment Type: PIA - Afterpay<br>
6. **CashReplaceGlassLicensePlateLookupInshopPaypal**<br>
- Repair or Replace: Replace<br>
- Damage Type: Windshield Crack<br>
- Vehicle Lookup Type: License Plate Lookup<br>
- CASH or Insurance: CASH<br>
- Service Type: Glass Service Only<br>
- Service Location Type: In-Shop<br>
- Schedule Appointment Type: Hourly<br>
- Payment Type: PIA - PayPal<br>
7. **CashReplaceVinMobile**<br>
- Repair or Replace: Replace<br>
- Damage Type: Windshield Crack<br>
- Vehicle Lookup Type: VIN Lookup<br>
- CASH or Insurance: CASH<br>
- Service Type: Glass Service Only<br>
- Service Location Type: Mobile<br>
- Schedule Appointment Type: Range of Hours<br>
- Payment Type: Pay At Service<br>
8. **CashReplaceSafeliteCanNotRecalMobile**<br>
- Repair or Replace: Replace<br>
- Damage Type: Windshield Crack<br>
- Vehicle Lookup Type: ZIP Lookup<br>
- CASH or Insurance: CASH<br>
- Service Type: Glass Service Only<br>
- Service Location Type: Mobile<br>
- Schedule Appointment Type: Range of Hours<br>
- Payment Type: Pay At Service<br>
- Additional Info: Safelite Cannot Recalibrate Vehicle<br>
### Cash Payment - Multiple Glass Replacement Scenarios
9. **CashReplaceMultiGlassPromoInshop**<br>
- Repair or Replace: Replace<br>
- Damage Type: Windshield Crack, Driver Front Door, Driver Rear Door, Driver Vent Glass, Passenger Vent Glass, Rear Window<br>
- Vehicle Lookup Type: VIN Lookup<br>
- CASH or Insurance: CASH<br>
- Service Type: Glass Service Only<br>
- Service Location Type: In-Shop<br>
- Schedule Appointment Type: Hourly<br>
- Payment Type: Pay At Service<br>
- Additional Info: Glass Promo<br>
10. **CashReplaceMultiSlidingGlassDropoff**<br>
- Repair or Replace: Replace<br>
- Damage Type: Windshield Crack, Passenger Front Door, Passenger Rear Door, Rear Glass With Slider<br>
- Vehicle Lookup Type: ZIP Lookup<br>
- CASH or Insurance: CASH<br>
- Service Type: Standard<br>
- Service Location Type: Dropoff<br>
- Schedule Appointment Type: Dropoff<br>
- Payment Type: Pay At Service<br>
- Vehicle Info: Sliding glass vehicle, capability questions<br>
11. **CashReplaceMultiGlassMobile**<br>
- Repair or Replace: Replace<br>
- Damage Type: Windshield Crack, Driver Quarter Panel, Passenger Quarter Panel<br>
- Vehicle Lookup Type: ZIP Lookup<br>
- CASH or Insurance: CASH<br>
- Service Type: Premium<br>
- Service Location Type: Mobile<br>
- Schedule Appointment Type: Range Of Hours<br>
- Payment Type: Pay At Service<br>
### Cash Payment - Promo Scenarios
12. **CashReplaceGlassPromoInshop**<br>
- Repair or Replace: Replace<br>
- Damage Type: Windshield Crack<br>
- Vehicle Lookup Type: VIN Lookup<br>
- CASH or Insurance: CASH<br>
- Service Type: Glass Service Only<br>
- Service Location Type: In-Shop<br>
- Schedule Appointment Type: Hourly<br>
- Payment Type: Pay At Service<br>
- Additional Info: Glass Promo<br>
13. **CashReplaceRainDefensePromoInshop**<br>
- Repair or Replace: Replace<br>
- Damage Type: Windshield Crack<br>
- Vehicle Lookup Type: VIN Lookup<br>
- CASH or Insurance: CASH<br>
- Service Type: Premium<br>
- Service Location Type: In-Shop<br>
- Schedule Appointment Type: Hourly<br>
- Payment Type: Pay At Service<br>
- Additional Info: Rain Defense Promo<br>
14. **CashReplaceWiperPromoInshop**<br>
- Repair or Replace: Replace<br>
- Damage Type: Windshield Crack<br>
- Vehicle Lookup Type: VIN Lookup<br>
- CASH or Insurance: CASH<br>
- Service Type: Standard<br>
- Service Location Type: In-Shop<br>
- Schedule Appointment Type: Hourly<br>
- Payment Type: Pay At Service<br>
- Vehicle Info: Wiper Promo<br>
15. **CashReplaceWiperDropoff**<br>
- Repair or Replace: Replace<br>
- Damage Type: Windshield Crack<br>
- Vehicle Lookup Type: ZIP Lookup<br>
- CASH or Insurance: CASH<br>
- Service Type: Standard<br>
- Service Location Type: Drop Off<br>
- Schedule Appointment Type: Drop Off<br>
- Payment Type: Pay At Service<br>
## Installation
### Install dependencies
npm install
npx playwright install
or
RUN npx playwright install chromium --with-deps
### Run Tests with script
npm run test:playwright
### Install SauceLabs CLI
npm install saucectl
## Configuration
• Environment configurations in .env files <br>
• SauceLabs configuration in config.yml <br>
• Playwright configuration in playwright.config.ts <br>
## Project Structure
├── tests/ # Test scenarios and cases <br>
├── pages/ # Page Object Models <br>
├── business-logic/ # Business logic and data models <br>
├── impl/ # Implementation utilities <br>
└── artifacts/ # Test artifacts and results <br>
## Running Tests
### Run all tests
npx playwright test
### Run a specific test file
npx playwright test tests/0000__M.test.ts
### Run tests with specific tag (cognitive approach)
npx playwright test --grep "@Alert"
## Test Reports
Test results are available in:
• ortoni report (summarized HTML) <br>
• HTML format (playwright-report) <br>
• JUnit format <br>
• SauceLabs dashboard <br>
## Reccomended Visual Studio Code Extensions
• JavaScript and TypeScript Nightly <br>
• Playwright Test for VSCode <br>
## Key Features
Page Object Model implementation <br>
Data-driven test approach <br>
Cross-browser testing support <br>
Integration with SauceLabs<br>
Parallel test execution <br>
HTML report generation <br>
Environment-specific configurations <br>
## Common Test Flows
• Vehicle lookup validation <br>
• Shop selection <br>
• Damage assessment <br>
• Appointment scheduling <br>
• Coverage verification <br>
• Payment processing <br>
## Contributing
1. Follow the established page object pattern
2. Add proper test documentation
3. Include appropriate test tags
4. Ensure tests are isolated and repeatable
## Environment Variables
BASE_URL=https://www-dev2.safelite.com<br>
CCIS_API_URL= <br>
ADMIN_SERVICE_API_URL= <br>
SAUCE_USERNAME= <br>
SAUCE_ACCESS_KEY= <br>
## CI/CD Integration
The project uses Azure Pipelines for continuous integration with configurations defined in azure-pipelines.yml.