-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c604d9f
commit 9acc912
Showing
4 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') | ||
}) |