-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from sora32127/add_playwright_test
mainブランチにPRを提出した際にPlaywrightのテストが走るように設定
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name : Playwright E2E Test | ||
on: | ||
pull_request: | ||
branches: ['main'] | ||
|
||
jobs: | ||
playwright-e2e-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name : Waiting for Vercel Preview Deployment to be ready | ||
uses : patrickedqvist/[email protected] | ||
id : waitFor200 | ||
with : | ||
token : ${{ secrets.SECRET_GITHUB_TOKEN }} | ||
max_timeout: 600 | ||
|
||
- name : Check if the url is valid | ||
run : echo "::set-output name=url::${{ steps.waitFor200.outputs.url }}" | ||
|
||
- 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 : Install Playwright with dependencies | ||
run : npx playwright install --with-deps | ||
|
||
- name : Run Playwright tests | ||
run : npx playwright test | ||
env : | ||
TEST_URL : ${{ steps.waitFor200.outputs.url }} | ||
|
||
- name : Upload Playwright report | ||
uses : actions/upload-artifact@v3 | ||
if : always() | ||
with : | ||
name : playwright-report | ||
path : playwright-report/ | ||
retention-days : 30 |
8c55371
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
healthy-person-emulator-dotorg-kmxg – ./
healthy-person-emulator-dotorg-kmxg-sora32127s-projects.vercel.app
healthy-person-emulator-dotorg.vercel.app
healthy-person-emulator-dotorg-k-git-12b613-sora32127s-projects.vercel.app
healthy-person-emulator.org