Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Apr 27, 2024
1 parent e2fb53a commit ce2589e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 47 deletions.
37 changes: 0 additions & 37 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 7 additions & 9 deletions tests/test.e2e.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -28,6 +26,7 @@ try {
console.log('= start specific geckodriver =')

const binary = await download()
let firefoxBinary: string | undefined

try {
const browser = await remote({
Expand All @@ -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()
Expand All @@ -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']
}
}
Expand Down

0 comments on commit ce2589e

Please sign in to comment.