Skip to content

Commit ba4b9ec

Browse files
committed
feat: add Playwright testing framework and initial tests
- Updated package.json to include Playwright as a dependency and added test scripts. - Created playwright.config.ts for configuring Playwright tests. - Added homepage.spec.ts with tests to verify the homepage title and structure.
1 parent 93bf1aa commit ba4b9ec

File tree

6 files changed

+26111
-25
lines changed

6 files changed

+26111
-25
lines changed

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build-and-test:
11+
timeout-minutes: 60
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: lts/*
19+
20+
- name: Cache npm dependencies
21+
uses: actions/cache@v4
22+
with:
23+
path: ~/.npm
24+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
25+
restore-keys: |
26+
${{ runner.os }}-node-
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Run build
32+
run: npm run build
33+
34+
- name: Install Playwright Browsers
35+
run: npx playwright install --with-deps
36+
37+
- name: Cache Playwright browsers
38+
uses: actions/cache@v4
39+
with:
40+
path: ~/.cache/ms-playwright
41+
key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }}
42+
restore-keys: |
43+
${{ runner.os }}-playwright-
44+
45+
- name: Run Playwright tests
46+
run: npm run test
47+
48+
- uses: actions/upload-artifact@v4
49+
if: ${{ !cancelled() }}
50+
with:
51+
name: playwright-report
52+
path: playwright-report/
53+
retention-days: 30

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ out/
1111
build/
1212

1313
/node_modules
14-
package-lock.json
1514
dist
1615
dist-ssr
1716
*.local
@@ -26,3 +25,10 @@ dist-ssr
2625
*.njsproj
2726
*.sln
2827
*.sw?
28+
29+
# Playwright
30+
/test-results/
31+
/playwright-report/
32+
/blob-report/
33+
/playwright/.cache/
34+
test-results/.last-run.json

0 commit comments

Comments
 (0)