diff --git a/package-lock.json b/package-lock.json index 0ed4f9ee..25034eeb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,6 @@ "geckodriver": "bin/geckodriver.js" }, "devDependencies": { - "@puppeteer/browsers": "^2.2.3", "@types/node": "^20.12.7", "@types/tar-fs": "^2.0.4", "@types/unzipper": "^0.10.9", @@ -1494,42 +1493,6 @@ "spacetrim": "0.11.20" } }, - "node_modules/@puppeteer/browsers": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.2.3.tgz", - "integrity": "sha512-bJ0UBsk0ESOs6RFcLXOt99a3yTDcOKlzfjad+rhFwdaG1Lu/Wzq58GHYCDTlZ9z6mldf4g+NTb+TXEfe0PpnsQ==", - "dev": true, - "dependencies": { - "debug": "4.3.4", - "extract-zip": "2.0.1", - "progress": "2.0.3", - "proxy-agent": "6.4.0", - "semver": "7.6.0", - "tar-fs": "3.0.5", - "unbzip2-stream": "1.4.3", - "yargs": "17.7.2" - }, - "bin": { - "browsers": "lib/cjs/main-cli.js" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@puppeteer/browsers/node_modules/tar-fs": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.5.tgz", - "integrity": "sha512-JOgGAmZyMgbqpLwct7ZV8VzkEB6pxXFBVErLtb+XCOqzc6w1xiWKI9GVd6bwk68EX7eJ4DWmfXVmq8K2ziZTGg==", - "dev": true, - "dependencies": { - "pump": "^3.0.0", - "tar-stream": "^3.1.5" - }, - "optionalDependencies": { - "bare-fs": "^2.1.1", - "bare-path": "^2.1.0" - } - }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.16.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.16.4.tgz", diff --git a/package.json b/package.json index 24fb9be6..6cb90ddf 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,6 @@ "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", diff --git a/tests/test.e2e.ts b/tests/test.e2e.ts index d307a204..52a6fe32 100644 --- a/tests/test.e2e.ts +++ b/tests/test.e2e.ts @@ -1,7 +1,5 @@ -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' @@ -28,6 +26,7 @@ try { console.log('= start specific geckodriver =') const binary = await download() +let firefoxBinary: string | undefined try { const browser = await remote({ @@ -42,7 +41,11 @@ try { } } }) - console.log(browser.capabilities); + + /** + * reuse downloaded Firefox for next test + */ + firefoxBinary = browser.requestedCapabilities['moz:firefoxOptions'].binary, await browser.url('https://webdriver.io') await browser.deleteSession() @@ -59,18 +62,13 @@ const cp = await start({ port }) try { await waitPort({ port }) - const firefox = await install({ - browser: Browser.FIREFOX, - buildId: 'stable', - 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, + binary: firefoxBinary, args: ['-headless'] } }