@alanlu-dev/playwright-config
v0.1.4
Published
<p> <a href="https://github.com/alanlu-dev/web-kit/blob/main/packages/tests/playwright-config/CHANGELOG.md"><img src="https://img.shields.io/github/v/release/alanlu-dev/web-kit?filter=@alanlu-dev/playwright-config%2A&style=flat" alt="Version"></a> <a hr
Readme
@alanlu-dev/playwright-config
A playwright configuration for monorepo.
Installation
pnpm add -wD @alanlu-dev/playwright-config
# install supported browsers
npx playwright installUsage
Create a playwright.config.ts file in the root of your project:
import config from '@alanlu-dev/playwright-config'
export default configAdd the following scripts to the package.json of the package:
{
"scripts": {
"test-e2e": "playwright test"
}
}Add the following scripts to the package.json in the root directory:
{
"scripts": {
"test-e2e": "turbo run test-e2e"
}
}CI/CD
You can use the following GitHub Actions workflow to automate the testing process:
name: Playwright Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm exec playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30