chore(playwright): improve playwright speed

This commit is contained in:
taroj1205 2025-06-22 17:30:13 +12:00
parent b2b37a0f8b
commit 6656ac51e2
No known key found for this signature in database
GPG key ID: 0FCB6CFFE0981AB7
2 changed files with 25 additions and 38 deletions

View file

@ -154,7 +154,7 @@ jobs:
- name: Run Playwright Tests - name: Run Playwright Tests
run: bunx turbo run test:playwright run: bunx turbo run test:playwright
timeout-minutes: 10 timeout-minutes: 8
- name: Upload Playwright Report - name: Upload Playwright Report
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4

View file

@ -26,46 +26,33 @@ export default defineConfig({
}, },
/* Configure projects for major browsers */ /* Configure projects for major browsers */
projects: [ projects: process.env.CI
{ ? [
name: 'chromium', // Only run Firefox in CI for speed
use: { ...devices['Desktop Chrome'] }, {
}, name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
]
: [
// Run all browsers locally for thorough testing
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{ {
name: 'firefox', name: 'firefox',
use: { ...devices['Desktop Firefox'] }, use: { ...devices['Desktop Firefox'] },
}, },
{ {
name: 'webkit', name: 'webkit',
use: { ...devices['Desktop Safari'] }, use: { ...devices['Desktop Safari'] },
}, },
/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },
/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
], ],
/* Run your local dev server before starting the tests */ /* Run your local dev server before starting the tests */
webServer: { webServer: {
command: process.env.CI ? 'npm run start' : 'npm run dev', command: process.env.CI ? 'bun run start' : 'bun run dev',
url: 'http://localhost:3000', url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI, reuseExistingServer: !process.env.CI,
}, },