Skip to content

Commit ac4b021

Browse files
committed
parallelise tests
1 parent f63bcaa commit ac4b021

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.github/workflows/test-preview.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
- name: Configure Git safe.directory
5656
run: |
5757
git config --global --add safe.directory /workspace
58+
5859
# Step 3: Run Playwright tests in Docker
5960
- name: Run Playwright tests
6061
run: |
@@ -65,6 +66,7 @@ jobs:
6566
-e BASE_URL=${{ github.event.deployment_status.environment_url }} \
6667
-e ARGOS_BRANCH="${{ github.event.deployment_status.environment == 'Production' && 'main' || github.ref_name }}" \
6768
-e CI=true \
69+
-e NUM_WORKERS=4 \
6870
-e ARGOS_TOKEN=${{ secrets.ARGOS_TOKEN }} \
6971
mcr.microsoft.com/playwright:v1.49.1-noble \
70-
npm exec -- playwright test
72+
npm exec -- playwright test --workers 4

playwright.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const config: PlaywrightTestConfig = {
3434
},
3535
],
3636
],
37-
timeout: 1200000,
37+
timeout: 1800000,
3838
use: {
3939
// On CI, we will set `BASE_URL` from Vercel preview URL
4040
baseURL: baseURL,

tests/screenshot.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ for (let workerIndex = 0; workerIndex < NUM_WORKERS; workerIndex++) {
5656
}
5757

5858
await page.goto(url, { timeout });
59-
console.log(`Successfully loaded ${url}`);
59+
console.debug(`Successfully loaded ${url}`);
6060

6161
// Check for meta redirect
6262
const metaRedirect = await page.$('meta[http-equiv="refresh"]');
@@ -68,7 +68,7 @@ for (let workerIndex = 0; workerIndex < NUM_WORKERS; workerIndex++) {
6868
// Wait for hydration with a timeout
6969
try {
7070
await page.waitForFunction(waitForDocusaurusHydration, { timeout });
71-
console.log(`Hydration completed for ${url}`);
71+
console.debug(`Hydration completed for ${url}`);
7272
} catch (error) {
7373
console.warn(`Skipping ${pathname} due to missing hydration.`);
7474
continue;

0 commit comments

Comments
 (0)