Skip to content

Commit 1734c76

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

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

.github/workflows/basic.yml

Lines changed: 60 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,56 @@ 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 application
113+
run: pnpm build
114+
115+
- name: Start application
116+
run: |
117+
pnpm start &
118+
npx wait-on http://localhost:3000 --timeout 60000
119+
working-directory: ./core
120+
env:
121+
PORT: 3000
122+
AUTH_SECRET: ${{ secrets.TESTS_AUTH_SECRET }}
123+
AUTH_TRUST_HOST: ${{ secrets.TESTS_AUTH_TRUST_HOST }}
124+
125+
- name: Run E2E tests
126+
run: pnpm exec playwright test tests/ui/e2e
127+
working-directory: ./core
128+
env:
129+
PLAYWRIGHT_TEST_BASE_URL: http://localhost:3000
130+
131+
- name: Upload test results
132+
if: failure()
133+
uses: actions/upload-artifact@v4
134+
with:
135+
name: playwright-report
136+
path: ./core/.tests/
137+
retention-days: 7

0 commit comments

Comments
 (0)