Skip to content

Commit 28f08d9

Browse files
holgerd77acolytec3
andauthored
Fix Browser Tests / Switch to Playwright + Chromium Combo (#3957)
* Switch to playwright/chromium combo * Install playwright browsers on workflow * Rebuild package-lock.json * Remove playwright from dev dependencies (separate install script), remove webdriverio * Rebuild package-lock.json * Remove extra install script * Add install setup back * update readme with browser testing deps guidance --------- Co-authored-by: acolytec3 <[email protected]>
1 parent 1481a27 commit 28f08d9

File tree

5 files changed

+577
-43
lines changed

5 files changed

+577
-43
lines changed

.github/workflows/browser.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ jobs:
6464
key: ${{ inputs.submodule-cache-key }}
6565

6666
- run: npm run install-browser-deps
67+
- run: npx playwright install --with-deps
6768

6869
- run: npm run test:browser --workspaces --if-present
6970

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ All packages include a `typescript` entry in the exports map that allows direct
112112
- Run TypeScript scripts: `tsx --conditions=typescript myScript.ts`
113113
- Set environment variable for bash scripts: `NODE_OPTIONS='--conditions=typescript'`
114114

115+
### Browser Testing
116+
117+
We use `vitest` with `playwright` to run browser tests. When running browser tests with `npm run test:browser`, ensure you have a version of the Chromium browser installed. If not, you can run `npx playwright install --with-deps` to install a supported version.
118+
115119
### Testing Packages with an external project
116120

117121
To test changes locally before publishing, use npm link:

config/vitest.config.browser.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ const config = defineConfig({
66
enabled: true,
77
headless: true,
88
fileParallelism: false,
9-
provider: 'webdriverio',
9+
provider: 'playwright',
1010
instances: [
1111
{
12-
browser: 'chrome',
12+
browser: 'chromium',
1313
headless: true,
1414
isolate: true,
1515
},

0 commit comments

Comments
 (0)