This repository contains end-to-end automated UI tests for the Pintarnya website, focusing on the "Cari Promo" section. Tests are written using Playwright with TypeScript and structured using the Page Object Model (POM) design pattern.
automation-pintarnya/
├── config/ # Global configuration and selectors
│ └── testConfig.ts
├── pages/ # Page Object Models
│ └── PromoPage.ts
├── tests/ # Test specifications
│ └── promo.spec.ts
├── utils/ # Utility functions
│ └── helpers.ts
├── playwright.config.ts # Playwright configuration
└── .github/workflows/ # GitHub Actions CI workflow
- Navigate to the Pintarnya homepage
- Click on the "Cari Promo" navigation button
- Validate that the Promo page is displayed
- Ensure at least one promo card is visible
- Click the first promo card
- Validate product detail is displayed correctly
-
Install dependencies
npm install
-
Run tests locally
npx playwright test -
Run tests for specific device (e.g., Mobile Chrome only)
npx playwright test --project="Mobile Chrome"
-
View test report
npx playwright show-report
The project includes a CI workflow in .github/workflows/playwright.yml that runs tests automatically on push and pull requests targeting main or master. Tests are executed against:
- Mobile Chrome (Pixel 5)
- Mobile Safari (iPhone 12)
Test reports are uploaded as artifacts.
- Default timeout is configured to 10 seconds per step (
defaultTimeout: 10000). waitForVisible()utility is used to ensure reliable visibility checks.- The test base URL is set to
https://pintarnya.com/.
This project is open source and available under the MIT License.