Skip to content

Commit

Permalink
add playwright config for testing more browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
morris committed Dec 28, 2024
1 parent c291981 commit 044178a
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
44 changes: 44 additions & 0 deletions playwright.config.js
Original file line number Diff line number Diff line change
@@ -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/,
},
],
});
2 changes: 1 addition & 1 deletion scripts/test-coverage.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 044178a

Please sign in to comment.