<name>.mobile.spec.ts
files will run only on mobile browsers.
<name>.desktop.spec.ts
files will run only on desktop browsers.
<name>.mobile.spec.ts
files will run only on mobile browsers.
<name>.desktop.spec.ts
files will run only on desktop browsers.
import { defineConfig, devices } from '@playwright/test'; | |
export default defineConfig({ | |
// ... | |
projects: [ | |
/* Desktop */ | |
{ | |
name: 'Desktop Chrome', | |
testIgnore: '**/*/*.mobile.spec.ts', | |
use: { ...devices['Desktop Chrome'] }, | |
}, | |
{ | |
name: 'Desktop Firefox', | |
testIgnore: '**/*/*.mobile.spec.ts', | |
use: { ...devices['Desktop Firefox'] }, | |
}, | |
{ | |
name: 'Desktop Safari', | |
testIgnore: '**/*/*.mobile.spec.ts', | |
use: { ...devices['Desktop Safari'] }, | |
}, | |
/* Mobile */ | |
{ | |
name: 'Mobile Chrome', | |
testIgnore: '**/*/*.desktop.spec.ts', | |
use: { ...devices['Pixel 5'] }, | |
}, | |
{ | |
name: 'Mobile Safari', | |
testIgnore: '**/*/*.desktop.spec.ts', | |
use: { ...devices['iPhone 13 Pro Max'] }, | |
}, | |
], | |
}); |