Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
ryota-murakami committed Jan 22, 2024
1 parent c604d9f commit 9acc912
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Playwright Tests
name: Playwright Admin Tests
on:
push:
branches: [main, master]
Expand All @@ -24,7 +24,7 @@ jobs:
- name: docker compose run
run: docker-compose up -d
- name: Run Playwright tests
run: pnpm exec playwright test
run: pnpm exec playwright test admin.spec.ts
- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/playwright_visitor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Playwright Visitor Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Create .env file
run: cp .env.e2e .env
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Generate Prisma Client
run: pnpm prisma generate
- name: Build Frontend App
run: pnpm build:e2e
- name: docker compose run
run: docker-compose up -d
- name: Run Playwright tests
run: pnpm exec playwright test visitor.spec.ts
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
File renamed without changes.
20 changes: 20 additions & 0 deletions e2e/visitor.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import util from 'node:util'

const exec = util.promisify(require('node:child_process').exec)
import { test, expect } from '@playwright/test'

test.beforeAll(async () => {
await exec('pnpm db:reset')
})

test.describe('visitor basic', () => {
test('show blog title', async ({ page }) => {
await page.goto('http://localhost:3000/')
await expect(page).toHaveURL('http://localhost:3000/')
await expect(page.getByRole('heading')).toHaveText('ReadList')
})
})

test.afterAll(async () => {
await exec('pnpm db:reset')
})

0 comments on commit 9acc912

Please sign in to comment.