Skip to content

Commit

Permalink
remove customEdgeDriverPath param from start arg
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Sep 14, 2023
1 parent 9a117b1 commit 5273fb8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { DEFAULT_ALLOWED_ORIGINS, DEFAULT_ALLOWED_IPS, log } from './constants.j
import type { EdgedriverParameters } from './types.js'

export async function start (params: EdgedriverParameters) {
const { cacheDir, ...startArgs } = params
let binaryFilePath = params.customEdgeDriverPath
const { cacheDir, customEdgeDriverPath, ...startArgs } = params
let binaryFilePath = customEdgeDriverPath
if (!binaryFilePath) {
binaryFilePath = await downloadDriver(params.edgeDriverVersion, cacheDir)
}
Expand Down
29 changes: 28 additions & 1 deletion tests/test.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ import waitPort from 'wait-port'
import { remote } from 'webdriverio'

import findEdgePath from '../dist/finder.js'
import { start } from '../dist/index.js'
import { start, download } from '../dist/index.js'

const port = 4444
const cp = await start({ port })

// start edgedriver manually
console.log('= start edgedriver manually')

try {
await waitPort({ port: 4444 })
const browser = await remote({
Expand All @@ -26,3 +29,27 @@ try {
} finally {
cp.kill()
}

// start specific edgedriver
console.log('= start specific edgedriver =')
const binary = await download()

try {
const browser = await remote({
automationProtocol: 'webdriver',
capabilities: {
browserName: 'edge',
'moz:firefoxOptions': {
args: ['-headless']
},
'wdio:edgedriverOptions': {
binary
}
}
})
await browser.url('https://webdriver.io')
await browser.deleteSession()
} catch (err) {
console.error(err)
process.exit(1)
}

0 comments on commit 5273fb8

Please sign in to comment.