Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b255cb7
tests: Added initial for homepage
NethmikaKekuu Jun 22, 2026
eb4f3cb
tests: Added tests for president profile page
NethmikaKekuu Jun 22, 2026
1a1739f
fix: Removed headless from the config
NethmikaKekuu Jun 22, 2026
3869f88
add playwright github actions workflow
NethmikaKekuu Jun 22, 2026
069a08e
fix: Corrected dependencies in workflow file
NethmikaKekuu Jun 22, 2026
24a3ca5
fix: Added debuging logs to the workflow
NethmikaKekuu Jun 22, 2026
1f95e17
tests: Added readme for the tests
NethmikaKekuu Jun 24, 2026
10dff5a
fix: Remove the number of workers running parallely
NethmikaKekuu Jun 24, 2026
c4541d9
fix: corrected the readme issues recommended and added a postinstall …
NethmikaKekuu Jul 6, 2026
32e2f04
refactor: changed the workflow name to UI and add to run CI in on eve…
NethmikaKekuu Jul 6, 2026
ddf4e7c
fix: removed the condition to run tests only on the chromium
NethmikaKekuu Jul 6, 2026
71d962e
fix: removed default playwright tests from the workflow and kept only…
NethmikaKekuu Jul 6, 2026
d72e5d3
fix: added a condition so that firefox mobile doesnt fail the test du…
NethmikaKekuu Jul 6, 2026
967996e
refactor: Added mock data instead of real db data
NethmikaKekuu Jul 6, 2026
2b28693
fix: removed the loop for vieport and added them in the config file
NethmikaKekuu Jul 6, 2026
9893745
refcator: rewrote the readme
NethmikaKekuu Jul 6, 2026
e90ffd5
refactor: changed the workflow file so it runs only when pushed to th…
NethmikaKekuu Jul 6, 2026
c873635
fix: resolved bot commits
NethmikaKekuu Jul 9, 2026
9b33ecd
Merge branch 'feathure/playwright-tests-workflows' of https://github.…
NethmikaKekuu Jul 9, 2026
d8d9c10
Revert "Merge branch 'feathure/playwright-tests-workflows' of https:/…
NethmikaKekuu Jul 9, 2026
035178a
Revert "fix: resolved bot commits"
NethmikaKekuu Jul 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/playwright.yml
Comment thread
NethmikaKekuu marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Playwright E2E Tests

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Install Playwright browsers
run: npx playwright install --with-deps

- name: Run Playwright tests
run: npx playwright test --project=chromium

- name: Upload test report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 30

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: test-results/
retention-days: 30
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ dist-ssr

# env files
.env

# Playwright
test-results/
playwright-report/
blob-report/
playwright/.cache/
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,58 @@ Update the `config.js` file in the `public` directory
| `version` | `No` | Application Version | `rc-1.0.0` |
| `dataSources` | `No` | Data Sources | `https://data.gov.lk/` |

## How to Run Tests

### Prerequisites
Make sure dependencies are installed:
```bash
npm install
npm install --save-dev monocart-reporter
```

Install Playwright browsers if not already done:
```bash
npx playwright install
```

### Start the Dev Server
The dev server must be running before executing tests:
```bash
npm run dev
```

### Run All Tests (all browsers + all viewports)
```bash
npx playwright test
```

### Run on a Single Browser
```bash
npx playwright test --project=chromium
npx playwright test --project=firefox
npx playwright test --project=webkit
```

### Run a Specific Test File
```bash
npx playwright test tests/view-profile.spec.ts
```

### View HTML Test Report
```bash
npx playwright show-report
```

### View Coverage Report
After running tests, open the coverage report:
```bash
# macOS
open coverage/index.html

# Linux
xdg-open coverage/index.html
```

## Contributing

Please see our [Contributing Guidelines](CONTRIBUTING.md).
Expand Down
Loading