Skip to content

Commit 0c5a861

Browse files
committed
refactor: e2e test action script add (#187)
1 parent d861169 commit 0c5a861

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.github/workflows/ci-preview.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ jobs:
5252
- name: Run unit test
5353
run: yarn test
5454

55+
# - name: Run e2e test install
56+
# run: yarn playwright install --with-deps
57+
58+
# - name: Run e2e test
59+
# run: yarn playwright test
60+
5561
deploy-to-vercel:
5662
runs-on: ubuntu-latest
5763
outputs:
@@ -104,6 +110,62 @@ jobs:
104110
format: "YYYY년 MM월 DD일 HH시 mm분"
105111
utcOffset: "+09:00"
106112

113+
e2e-test:
114+
runs-on: ubuntu-latest
115+
needs: [deploy-to-vercel]
116+
steps:
117+
- name: Checkout
118+
uses: actions/checkout@v4
119+
120+
- name: Setup node
121+
uses: actions/setup-node@v4
122+
with:
123+
node-version: 18
124+
cache: "yarn"
125+
126+
- name: Set yarn version
127+
id: set-version
128+
run: |
129+
yarn set version 4.1.1
130+
echo "YARN_VERSION=$(yarn -v)" >> $GITHUB_OUTPUT
131+
132+
- name: Yarn cache - PnP
133+
uses: actions/cache@v4
134+
with:
135+
path: |
136+
.yarn/cache
137+
.pnp.*
138+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ steps.set-version.outputs.YARN_VERSION }}
139+
restore-keys: |
140+
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-
141+
142+
- name: Install dependencies
143+
run: yarn
144+
145+
# - name: Waiting for 200 from the Vercel Preview
146+
# uses: patrickedqvist/[email protected]
147+
# id: waitFor200
148+
# with:
149+
# token: ${{ secrets.GITHUB_TOKEN }}
150+
# max_timeout: 300
151+
# check_interval: 10
152+
# - name: Make environment file
153+
# run: |
154+
# echo "Deployed to: ${{ steps.waitFor200.outputs.url }}"
155+
# touch .env
156+
# echo "${{ secrets.ENV_FILE }}" > .env
157+
# echo TEST_BASE_URL=${{ steps.waitFor200.outputs.url }} >> .env
158+
# - name: Install dependencies
159+
# run: npm ci
160+
161+
- name: Install Playwright Browsers
162+
run: yarn playwright install --with-deps
163+
164+
- name: Run Playwright tests
165+
run: yarn playwright test
166+
env:
167+
PLAYWRIGHT_TEST_BASE_URL: ${{ steps.deploy-to-vercel.outputs.preview_url }}
168+
107169
github-privew-comment:
108170
runs-on: ubuntu-latest
109171
needs: [deploy-to-vercel]

0 commit comments

Comments
 (0)