@@ -87,127 +87,31 @@ jobs:
8787 run : pnpm run test
8888
8989 e2e-tests :
90- name : E2E Functional Tests
90+ name : E2E Functional Tests (${{ matrix.name }})
9191
9292 runs-on : ubuntu-latest
9393
94- steps :
95- - name : Checkout code
96- uses : actions/checkout@v4
97- with :
98- fetch-depth : 2
99-
100- - uses : pnpm/action-setup@v3
101-
102- - name : Use Node.js
103- uses : actions/setup-node@v4
104- with :
105- node-version-file : " .nvmrc"
106- cache : " pnpm"
107-
108- - name : Install dependencies
109- run : pnpm install --frozen-lockfile
110-
111- - name : Install Playwright browsers
112- run : pnpm exec playwright install --with-deps chromium webkit
113- working-directory : ./core
114-
115- - name : Build catalyst-client
116- run : pnpm --filter @bigcommerce/catalyst-client build
117-
118- - name : Build catalyst-core
119- run : pnpm --filter @bigcommerce/catalyst-core build
120-
121- - name : Start server
122- run : |
123- pnpm start &
124- npx wait-on http://localhost:3000 --timeout 60000
125- working-directory : ./core
126- env :
127- PORT : 3000
128- AUTH_SECRET : ${{ secrets.TESTS_AUTH_SECRET }}
129- AUTH_TRUST_HOST : ${{ vars.TESTS_AUTH_TRUST_HOST }}
130- BIGCOMMERCE_TRUSTED_PROXY_SECRET : ${{ secrets.BIGCOMMERCE_TRUSTED_PROXY_SECRET }}
131- TESTS_LOCALE : ${{ vars.TESTS_LOCALE }}
132- DEFAULT_REVALIDATE_TARGET : 1
133-
134- - name : Run E2E tests
135- run : pnpm exec playwright test tests/ui/e2e
136- working-directory : ./core
137- env :
138- PLAYWRIGHT_TEST_BASE_URL : http://localhost:3000
139-
140- - name : Upload test results
141- if : ${{ !cancelled() }}
142- uses : actions/upload-artifact@v4
143- with :
144- name : playwright-report
145- path : ./core/.tests/reports/
146- retention-days : 3
147-
148- e2e-tests-no-trailing :
149- name : E2E Functional Tests (TRAILING_SLASH=false)
150-
151- runs-on : ubuntu-latest
152-
153- steps :
154- - name : Checkout code
155- uses : actions/checkout@v4
156- with :
157- fetch-depth : 2
158-
159- - uses : pnpm/action-setup@v3
160-
161- - name : Use Node.js
162- uses : actions/setup-node@v4
163- with :
164- node-version-file : " .nvmrc"
165- cache : " pnpm"
166-
167- - name : Install dependencies
168- run : pnpm install --frozen-lockfile
169-
170- - name : Install Playwright browsers
171- run : pnpm exec playwright install --with-deps chromium
172- working-directory : ./core
173-
174- - name : Build catalyst-client
175- run : pnpm --filter @bigcommerce/catalyst-client build
176-
177- - name : Build catalyst-core
178- run : pnpm --filter @bigcommerce/catalyst-core build
179-
180- - name : Start server
181- run : |
182- pnpm start &
183- npx wait-on http://localhost:3000 --timeout 60000
184- working-directory : ./core
185- env :
186- PORT : 3000
187- AUTH_SECRET : ${{ secrets.TESTS_AUTH_SECRET }}
188- AUTH_TRUST_HOST : ${{ vars.TESTS_AUTH_TRUST_HOST }}
189- BIGCOMMERCE_TRUSTED_PROXY_SECRET : ${{ secrets.BIGCOMMERCE_TRUSTED_PROXY_SECRET }}
190- TESTS_LOCALE : ${{ vars.TESTS_LOCALE }}
191- TRAILING_SLASH : false
192-
193- - name : Run E2E tests
194- run : pnpm exec playwright test tests/ui/e2e --grep @no-trailing-slash
195- working-directory : ./core
196- env :
197- PLAYWRIGHT_TEST_BASE_URL : http://localhost:3000
198-
199- - name : Upload test results
200- if : ${{ !cancelled() }}
201- uses : actions/upload-artifact@v4
202- with :
203- name : playwright-report-no-trailing
204- path : ./core/.tests/reports/
205- retention-days : 3
206-
207- e2e-tests-alternate-locale :
208- name : E2E Functional Tests (alternate locale)
209-
210- runs-on : ubuntu-latest
94+ strategy :
95+ matrix :
96+ include :
97+ - name : default
98+ browsers : chromium webkit
99+ test-filter : tests/ui/e2e
100+ trailing-slash : true
101+ locale-var : TESTS_LOCALE
102+ artifact-name : playwright-report
103+ - name : TRAILING_SLASH=false
104+ browsers : chromium
105+ test-filter : tests/ui/e2e --grep @no-trailing-slash
106+ trailing-slash : false
107+ locale-var : TESTS_LOCALE
108+ artifact-name : playwright-report-no-trailing
109+ - name : alternate locale
110+ browsers : chromium
111+ test-filter : tests/ui/e2e --grep @alternate-locale
112+ trailing-slash : true
113+ locale-var : TESTS_ALTERNATE_LOCALE
114+ artifact-name : playwright-report-alternate-locale
211115
212116 steps :
213117 - name : Checkout code
@@ -227,7 +131,7 @@ jobs:
227131 run : pnpm install --frozen-lockfile
228132
229133 - name : Install Playwright browsers
230- run : pnpm exec playwright install --with-deps chromium
134+ run : pnpm exec playwright install --with-deps ${{ matrix.browsers }}
231135 working-directory : ./core
232136
233137 - name : Build catalyst-client
@@ -246,10 +150,12 @@ jobs:
246150 AUTH_SECRET : ${{ secrets.TESTS_AUTH_SECRET }}
247151 AUTH_TRUST_HOST : ${{ vars.TESTS_AUTH_TRUST_HOST }}
248152 BIGCOMMERCE_TRUSTED_PROXY_SECRET : ${{ secrets.BIGCOMMERCE_TRUSTED_PROXY_SECRET }}
249- TESTS_LOCALE : ${{ vars.TESTS_ALTERNATE_LOCALE }}
153+ TESTS_LOCALE : ${{ vars[matrix.locale-var] }}
154+ TRAILING_SLASH : ${{ matrix.trailing-slash }}
155+ DEFAULT_REVALIDATE_TARGET : ${{ matrix.name == 'default' && '1' || '' }}
250156
251157 - name : Run E2E tests
252- run : pnpm exec playwright test tests/ui/e2e --grep @alternate-locale
158+ run : pnpm exec playwright test ${{ matrix.test-filter }}
253159 working-directory : ./core
254160 env :
255161 PLAYWRIGHT_TEST_BASE_URL : http://localhost:3000
@@ -258,6 +164,6 @@ jobs:
258164 if : ${{ !cancelled() }}
259165 uses : actions/upload-artifact@v4
260166 with :
261- name : playwright-report-alternate-locale
167+ name : ${{ matrix.artifact-name }}
262168 path : ./core/.tests/reports/
263169 retention-days : 3
0 commit comments