1
0
mirror of https://github.com/morris/vanilla-todo.git synced 2025-01-16 20:28:22 +01:00

add playwright config for testing more browsers

This commit is contained in:
Morris Brodersen 2024-12-28 21:02:31 +01:00
parent c291981406
commit 044178a234
3 changed files with 50 additions and 1 deletions

View File

@ -887,6 +887,11 @@ Thanks!
## 9. Changelog
### 12/2024
- Add Playwright config for testing more browsers
- Update dependencies
### 08/2024
- Link to [Vanilla Prime](https://github.com/morris/vanilla-prime)

44
playwright.config.js Normal file
View File

@ -0,0 +1,44 @@
/* global process */
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
workers: process.env.CI ? 1 : undefined,
ignoreSnapshots: !!process.env.CI,
projects: [
{
name: 'Chromium',
use: { ...devices['Desktop Chrome'] },
// Includes unit tests
},
{
name: 'Firefox',
use: { ...devices['Desktop Firefox'] },
testMatch: /e2e/,
},
{
name: 'Safari',
use: { ...devices['Desktop Safari'] },
testMatch: /e2e/,
},
{
name: 'Mobile Chrome',
use: { ...devices['Pixel 5'] },
testMatch: /e2e/,
},
{
name: 'Mobile Safari',
use: { ...devices['iPhone 12'] },
testMatch: /e2e/,
},
{
name: 'Google Chrome',
use: { ...devices['Desktop Chrome'], channel: 'chrome' },
testMatch: /e2e/,
},
{
name: 'Microsoft Edge',
use: { ...devices['Desktop Edge'], channel: 'msedge' },
testMatch: /e2e/,
},
],
});

View File

@ -1,3 +1,3 @@
set -e
rm -rf coverage
c8 --src public --reporter text --reporter lcov playwright test $1
c8 --src public --reporter text --reporter lcov playwright test --project Chromium $1