Skip to content

Commit d46544a

Browse files
committed
add github action
1 parent 7dd14d1 commit d46544a

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.github/workflows/playwright.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Playwright Tests
2+
on: [deployment_status]
3+
jobs:
4+
test:
5+
if: github.event.deployment_status.state == 'success'
6+
timeout-minutes: 60
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-node@v4
11+
with:
12+
node-version: lts/*
13+
- name: Install dependencies
14+
run: npm ci
15+
- name: Install Playwright Browsers
16+
run: npx playwright install --with-deps
17+
- name: Run Playwright tests
18+
run: npx playwright test
19+
env:
20+
BASE_URL: ${{ github.event.deployment_status.target_url }}
21+
REPLAY_API_KEY: ${{ secrets.REPLAY_API_KEY }}

playwright.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dotenv.config();
55

66
const config: PlaywrightTestConfig = {
77
use: {
8-
baseURL: "http://localhost:3000"
8+
baseURL: process.env.CI ? process.env.BASE_URL : "http://localhost:3000"
99
},
1010
reporter: [
1111
[

0 commit comments

Comments
 (0)