@@ -72,10 +72,14 @@ jobs:
7272 path : ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
7373 key : playwright-browsers-${{ matrix.browser }}-${{ hashFiles('package-lock.json') }}
7474
75+ - name : Build application for local testing
76+ if : github.event.inputs.environment == 'local' || env.PLAYWRIGHT_BASE_URL == 'http://localhost:3000'
77+ run : yarn build
78+
7579 - name : Start local server (if testing locally)
76- if : github.event.inputs.environment == 'local'
80+ if : github.event.inputs.environment == 'local' || env.PLAYWRIGHT_BASE_URL == 'http://localhost:3000'
7781 run : |
78- npm run start &
82+ yarn build && npx serve -s build -l 3000 &
7983 npx wait-on http://localhost:3000 --timeout 120000
8084
8185 - name : Run comprehensive E2E tests
@@ -119,10 +123,14 @@ jobs:
119123 - name : Install Playwright
120124 run : npx playwright install chromium --with-deps
121125
126+ - name : Build application for local testing
127+ if : github.event.inputs.environment == 'local' || env.PLAYWRIGHT_BASE_URL == 'http://localhost:3000'
128+ run : yarn build
129+
122130 - name : Start local server (if testing locally)
123- if : github.event.inputs.environment == 'local'
131+ if : github.event.inputs.environment == 'local' || env.PLAYWRIGHT_BASE_URL == 'http://localhost:3000'
124132 run : |
125- npm run start &
133+ yarn build && npx serve -s build -l 3000 &
126134 npx wait-on http://localhost:3000 --timeout 120000
127135
128136 - name : Run visual regression tests
@@ -164,10 +172,14 @@ jobs:
164172 - name : Install Playwright
165173 run : npx playwright install chromium --with-deps
166174
175+ - name : Build application for local testing
176+ if : github.event.inputs.environment == 'local' || env.PLAYWRIGHT_BASE_URL == 'http://localhost:3000'
177+ run : yarn build
178+
167179 - name : Start local server (if testing locally)
168- if : github.event.inputs.environment == 'local'
180+ if : github.event.inputs.environment == 'local' || env.PLAYWRIGHT_BASE_URL == 'http://localhost:3000'
169181 run : |
170- npm run start &
182+ yarn build && npx serve -s build -l 3000 &
171183 npx wait-on http://localhost:3000 --timeout 120000
172184
173185 - name : Run performance tests
@@ -218,10 +230,14 @@ jobs:
218230 - name : Install Playwright
219231 run : npx playwright install chromium --with-deps
220232
233+ - name : Build application for local testing
234+ if : github.event.inputs.environment == 'local' || env.PLAYWRIGHT_BASE_URL == 'http://localhost:3000'
235+ run : yarn build
236+
221237 - name : Start local server (if testing locally)
222- if : github.event.inputs.environment == 'local'
238+ if : github.event.inputs.environment == 'local' || env.PLAYWRIGHT_BASE_URL == 'http://localhost:3000'
223239 run : |
224- npm run start &
240+ yarn build && npx serve -s build -l 3000 &
225241 npx wait-on http://localhost:3000 --timeout 120000
226242
227243 - name : Run mobile UX tests
@@ -264,10 +280,14 @@ jobs:
264280 npx playwright install chromium --with-deps
265281 npm install -g axe-core @axe-core/playwright
266282
283+ - name : Build application for local testing
284+ if : github.event.inputs.environment == 'local' || env.PLAYWRIGHT_BASE_URL == 'http://localhost:3000'
285+ run : yarn build
286+
267287 - name : Start local server (if testing locally)
268- if : github.event.inputs.environment == 'local'
288+ if : github.event.inputs.environment == 'local' || env.PLAYWRIGHT_BASE_URL == 'http://localhost:3000'
269289 run : |
270- npm run start &
290+ yarn build && npx serve -s build -l 3000 &
271291 npx wait-on http://localhost:3000 --timeout 120000
272292
273293 - name : Run accessibility tests
@@ -312,10 +332,14 @@ jobs:
312332 - name : Install Playwright browsers
313333 run : npx playwright install ${{ matrix.browser }} --with-deps
314334
335+ - name : Build application for local testing
336+ if : github.event.inputs.environment == 'local' || env.PLAYWRIGHT_BASE_URL == 'http://localhost:3000'
337+ run : yarn build
338+
315339 - name : Start local server (if testing locally)
316- if : github.event.inputs.environment == 'local'
340+ if : github.event.inputs.environment == 'local' || env.PLAYWRIGHT_BASE_URL == 'http://localhost:3000'
317341 run : |
318- npm run start &
342+ yarn build && npx serve -s build -l 3000 &
319343 npx wait-on http://localhost:3000 --timeout 120000
320344
321345 - name : Run cross-browser tests
0 commit comments