Skip to content

Commit 9903f0b

Browse files
Test/add e2e and unit testing (#1282)
* feat: add string utility tests and vitest browser configuration * feat: add Playwright for end-to-end testing and update snapshots - Introduced Playwright for E2E testing with a new configuration file. - Added test scripts to package.json for running E2E tests. - Updated package-lock.json and package.json with new dependencies for Playwright and types. - Created new SVG snapshot files for various layers (ruler, scaleBar, temperature, terrain, vignette, zones) to support visual testing. - Excluded e2e directory from TypeScript compilation. * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add SVG layer snapshots for various components - Added ruler layer snapshot with hidden display. - Added scale bar layer snapshot with detailed structure and styling. - Added temperature layer snapshot with opacity and stroke settings. - Added terrain layer snapshot with ocean and land heights groups. - Added vignette layer snapshot with mask and opacity settings. - Added zones layer snapshot with specified opacity and stroke settings. * fix: update Playwright browser installation command to use npx * Update snapshots * refactor: remove unused layer tests and their corresponding snapshots as fonts are unpredictable --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent c590c16 commit 9903f0b

38 files changed

+963
-6
lines changed

.github/workflows/playwright.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Playwright Tests
2+
on:
3+
pull_request:
4+
branches: [ master ]
5+
jobs:
6+
test:
7+
timeout-minutes: 60
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v5
11+
- uses: actions/setup-node@v5
12+
with:
13+
node-version: '24'
14+
- name: Install dependencies
15+
run: npm ci
16+
- name: Install Playwright Browsers
17+
run: npx playwright install --with-deps
18+
- name: Run Playwright tests
19+
run: npm run test:e2e
20+
- uses: actions/upload-artifact@v4
21+
if: ${{ !cancelled() }}
22+
with:
23+
name: playwright-report
24+
path: playwright-report/
25+
retention-days: 30

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.vscode
22
.idea
33
/node_modules
4+
*/node_modules
45
/dist
56
/coverage
7+
/playwright-report
8+
/test-results

0 commit comments

Comments
 (0)