Skip to content

Commit 81bee3c

Browse files
authored
Merge pull request #6903 from Shopify/02-26-add-e2e-to-ci
Add e2e tests to PR CI workflow
2 parents 5300218 + 07ba445 commit 81bee3c

2 files changed

Lines changed: 51 additions & 2 deletions

File tree

.github/workflows/tests-pr.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,53 @@ jobs:
220220
with:
221221
base-branch-name: '${{ github.base_ref }}'
222222

223+
e2e-tests:
224+
name: 'E2E tests'
225+
if: github.event.pull_request.head.repo.full_name == github.repository
226+
runs-on: ubuntu-latest
227+
timeout-minutes: 15
228+
continue-on-error: true
229+
steps:
230+
- uses: actions/checkout@v3
231+
with:
232+
repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
233+
ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
234+
fetch-depth: 1
235+
- name: Setup deps
236+
uses: ./.github/actions/setup-cli-deps
237+
with:
238+
node-version: ${{ env.DEFAULT_NODE_VERSION }}
239+
- name: Build
240+
run: pnpm nx run-many --all --skip-nx-cache --target=build --output-style=stream
241+
- name: Install Playwright Chromium
242+
run: npx playwright install chromium
243+
working-directory: packages/e2e
244+
- name: Rebuild node-pty
245+
run: pnpm rebuild node-pty
246+
- name: Run E2E tests
247+
working-directory: packages/e2e
248+
env:
249+
SHOPIFY_FLAG_CLIENT_ID: ${{ secrets.E2E_CLIENT_ID }}
250+
E2E_ACCOUNT_EMAIL: ${{ secrets.E2E_ACCOUNT_EMAIL }}
251+
E2E_ACCOUNT_PASSWORD: ${{ secrets.E2E_ACCOUNT_PASSWORD }}
252+
E2E_STORE_FQDN: ${{ secrets.E2E_STORE_FQDN }}
253+
E2E_SECONDARY_CLIENT_ID: ${{ secrets.E2E_SECONDARY_CLIENT_ID }}
254+
run: npx playwright test
255+
- name: Upload Playwright report
256+
uses: actions/upload-artifact@v4
257+
if: ${{ !cancelled() }}
258+
with:
259+
name: playwright-report
260+
path: packages/e2e/playwright-report/
261+
retention-days: 14
262+
- name: Upload test results
263+
uses: actions/upload-artifact@v4
264+
if: ${{ !cancelled() }}
265+
with:
266+
name: playwright-results
267+
path: packages/e2e/test-results/
268+
retention-days: 14
269+
223270
type-diff:
224271
if: github.event.pull_request.head.repo.full_name == github.repository
225272
name: 'Type-diff'

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,12 @@
125125
"unlisted": "error",
126126
"unresolved": "error"
127127
},
128+
"ignoreBinaries": [
129+
"playwright"
130+
],
128131
"ignoreDependencies": [
129132
"@shopify/theme-check-node",
130-
"@shopify/theme-check-docs-updater",
131-
"@graphql-typed-document-node/core"
133+
"@shopify/theme-check-docs-updater"
132134
],
133135
"ignoreWorkspaces": [
134136
"packages/eslint-plugin-cli",

0 commit comments

Comments
 (0)