Skip to content

mainブランチにPRを提出した際にPlaywrightのテストが走るように設定 #2

mainブランチにPRを提出した際にPlaywrightのテストが走るように設定

mainブランチにPRを提出した際にPlaywrightのテストが走るように設定 #2

Workflow file for this run

name : Playwright E2E Test
on:
pull_request:
branches: ['main']
jobs:
wait_for_vercel:
runs-on: ubuntu-latest
outputs:
preview_url: ${{ steps.waitForVercelPreviewDeployment.outputs.url }}
steps:
- name : Waiting for Vercel Preview Deployment to be ready
uses : patrickedqvist/[email protected]
with :
token: ${{ secrets.SECRET_GITHUB_TOKEN }}
max_timeout: 600
playwright_test:
runs-on: ubuntu-latest
needs: wait_for_vercel
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18' # 本番環境と同じバージョンを指定
- name: Install dependencies
run: npm install
- name: Run Playwright tests
run: npx playwright test
env:
TEST_URL: ${{ needs.wait_for_vercel.outputs.preview_url }}