Skip to content

Commit b96c61a

Browse files
committed
[WIP] E2E testing
1 parent e5a03f6 commit b96c61a

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.github/workflows/basic.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ env:
1515
BIGCOMMERCE_STORE_HASH: ${{ secrets.BIGCOMMERCE_STORE_HASH }}
1616
BIGCOMMERCE_STOREFRONT_TOKEN: ${{ secrets.BIGCOMMERCE_STOREFRONT_TOKEN }}
1717
BIGCOMMERCE_CHANNEL_ID: ${{ secrets.BIGCOMMERCE_CHANNEL_ID }}
18+
BIGCOMMERCE_ACCESS_TOKEN: ${{ secrets.BIGCOMMERCE_ACCESS_TOKEN }}
19+
TEST_CUSTOMER_ID: ${{ secrets.TEST_CUSTOMER_ID }}
20+
TEST_CUSTOMER_EMAIL: ${{ secrets.TEST_CUSTOMER_EMAIL }}
21+
TEST_CUSTOMER_PASSWORD: ${{ secrets.TEST_CUSTOMER_PASSWORD }}
22+
TESTS_LOCALE: ${{ secrets.TESTS_LOCALE }}
23+
TESTS_FALLBACK_LOCALE: ${{ secrets.TESTS_FALLBACK_LOCALE }}
24+
TESTS_READ_ONLY: ${{ secrets.TESTS_READ_ONLY }}
1825

1926
jobs:
2027
lint-typecheck:
@@ -75,3 +82,60 @@ jobs:
7582

7683
- name: Run Tests
7784
run: pnpm run test
85+
86+
e2e-tests:
87+
name: E2E Functional Tests
88+
89+
runs-on: ubuntu-latest
90+
91+
steps:
92+
- name: Checkout code
93+
uses: actions/checkout@v4
94+
with:
95+
fetch-depth: 2
96+
97+
- uses: pnpm/action-setup@v3
98+
99+
- name: Use Node.js
100+
uses: actions/setup-node@v4
101+
with:
102+
node-version-file: ".nvmrc"
103+
cache: "pnpm"
104+
105+
- name: Install dependencies
106+
run: pnpm install --frozen-lockfile
107+
108+
- name: Install Playwright browsers
109+
run: pnpm exec playwright install --with-deps chromium
110+
working-directory: ./core
111+
112+
- name: Build catalyst-client
113+
run: pnpm --filter @bigcommerce/catalyst-client build
114+
115+
- name: Build catalyst-core
116+
run: pnpm --filter @bigcommerce/catalyst-core build
117+
118+
- name: Start server
119+
run: |
120+
pnpm start &
121+
npx wait-on http://localhost:3000 --timeout 60000
122+
working-directory: ./core
123+
env:
124+
PORT: 3000
125+
AUTH_SECRET: ${{ secrets.TESTS_AUTH_SECRET }}
126+
AUTH_TRUST_HOST: ${{ secrets.TESTS_AUTH_TRUST_HOST }}
127+
BIGCOMMERCE_TRUSTED_PROXY_SECRET: ${{ secrets.BIGCOMMERCE_TRUSTED_PROXY_SECRET }}
128+
129+
- name: Run E2E tests
130+
run: pnpm exec playwright test tests/ui/e2e
131+
working-directory: ./core
132+
env:
133+
PLAYWRIGHT_TEST_BASE_URL: http://localhost:3000
134+
135+
- name: Upload test results
136+
if: failure()
137+
uses: actions/upload-artifact@v4
138+
with:
139+
name: playwright-report
140+
path: ./core/.tests
141+
retention-days: 7

0 commit comments

Comments
 (0)