Skip to content

Commit

Permalink
fix: use @puppeteer/browser to install Firefox on the CI machine
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Apr 27, 2024
1 parent 72f34fc commit 9902b76
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 38 deletions.
113 changes: 75 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"url": "https://github.com/webdriverio-community/node-geckodriver/issues"
},
"devDependencies": {
"@puppeteer/browsers": "^2.2.3",
"@types/node": "^20.12.7",
"@types/tar-fs": "^2.0.4",
"@types/unzipper": "^0.10.9",
Expand Down
8 changes: 8 additions & 0 deletions tests/test.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import os from 'node:os'
import waitPort from 'wait-port'
import { remote } from 'webdriverio'
import { install, Browser } from '@puppeteer/browsers'

import { download, start } from '../src/index.js'

Expand Down Expand Up @@ -55,12 +57,18 @@ const cp = await start({ port })

try {
await waitPort({ port })
const firefox = await install({
browser: Browser.FIREFOX,
buildId: 'latest',
cacheDir: os.tmpdir()
})
const browser = await remote({
automationProtocol: 'webdriver',
port, // must set port or wdio will automatically start geckodriver
capabilities: {
browserName: 'firefox',
'moz:firefoxOptions': {
binary: firefox.executablePath,
args: ['-headless']
}
}
Expand Down

0 comments on commit 9902b76

Please sign in to comment.