Automated Playwright tests for verifying the basic functionality of gov.pl
-
Search Central search box for finding information and services.
-
User-targeted Tabs “Dla Obywatela”, “Dla Przedsiębiorcy”, “Dla Urzędnika”, “Dla Rolnika”. Each opens dedicated content.
-
Filtering search Filter searched information.
-
Responsiveness Mobile-first design and cross-browser testing
These tests are read-only. Do not run them due to the automation prevention on gov.pl (captcha etc.) ❗ Automating these in production may violate data protection laws (e.g., GDPR) and terms of service.
Normally, UI tests are run repeatedly (e.g., CI pipelines), but for gov.pl we intentionally limit testing on production to prevent:
- Overloading government infrastructure
- Legal or privacy breaches
- Unintended data submissions
Recommended Practices: Run full test suites in dev/staging where possible.
.
├── pages
│ └── govHomePage.ts
├── tests
│ └── govHome.spec.ts
├── utils
│ └── consts.ts
└── README.md
npm install
For headless mode:
npx playwright test
For headed mode:
npx playwright test --ui
Check the results:
npx playwright show-report
BASE_URL=https://gov.pl npx playwright test
- Use of test.step() for better traceability in test reports
- Tests are isolated and repeatable
- Using Playwright recommended locators (getByRole, getByPlaceholder)
- Environment configurable via
BASE_URL
- Descriptive test names and grouped with
test.describe
- Clear assertions verifying key page elements
- Parallel execution
- CI with test report storage in GitHub Pages (currently dummy disabled by adding a condition to run only on
never-activated-branch
) - Page Object Pattern: page definitions in pages/, test logic in tests/ - for readability and maintenance
- Lighthouse performance analysis
- WCAG tests, potentially with
@axe-core/playwright