Skip to content

Commit

Permalink
making ide flexible with node_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
toddtarsi committed Dec 25, 2023
1 parent 5edeb82 commit 1f3e231
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions packages/selenium-ide/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "selenium-ide",
"version": "4.0.1-alpha.64",
"version": "4.0.1-alpha.65",
"private": false,
"description": "Selenium IDE electron app",
"author": "Todd <[email protected]>",
Expand Down Expand Up @@ -115,7 +115,6 @@
"@seleniumhq/side-model": "^4.0.0-alpha.5",
"@seleniumhq/side-runtime": "^4.0.0-alpha.32",
"dnd-core": "^16.0.1",
"electron": "^28.0.0",
"electron-chromedriver": "^28.0.0",
"electron-log": "^5.0.1",
"electron-store": "^8.1.0",
Expand Down Expand Up @@ -144,6 +143,7 @@
"@types/webpack-env": "^1.16.0",
"copy-webpack-plugin": "^10.2.4",
"css-loader": "^6.8.1",
"electron": "^28.0.0",
"electron-builder": "^24.9.1",
"electron-devtools-installer": "^3.2.0",
"fork-ts-checker-webpack-plugin": "^8.0.0",
Expand Down
30 changes: 16 additions & 14 deletions packages/selenium-ide/src/main/session/controllers/Driver/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,16 @@ export const port = app.isPackaged ? 9516 : 9515
* 4. When Electron is quitting, close the child driver process
*/

const ourElectronPath = path
.resolve(
path.join(
__dirname,
'..',
'node_modules',
'electron-chromedriver',
'bin',
'chromedriver' + (os.platform() === 'win32' ? '.exe' : '')
)
const ourElectronPath = __non_webpack_require__.resolve(
path.join(
'electron-chromedriver',
'bin',
'chromedriver' + (os.platform() === 'win32' ? '.exe' : '')
)
)

const getDriver = ({ browser, version }: BrowserInfo) => (
browser === 'electron'
const getDriver = ({ browser, version }: BrowserInfo) =>
(browser === 'electron'
? ourElectronPath
: path.resolve(
path.join(
Expand All @@ -70,9 +66,15 @@ const startDriver: StartDriver = () => (info) =>
const driverPath = getDriver(info)
switch (info.browser) {
case 'electron':

}
console.log('Starting driver', info.browser, 'at', driverPath, 'with args', args.join(' '))
console.log(
'Starting driver',
info.browser,
'at',
driverPath,
'with args',
args.join(' ')
)
if (fs.existsSync(driverPath)) {
const driver = spawn(driverPath.replace(/\s/g, ' '), args, {
env: {},
Expand Down

0 comments on commit 1f3e231

Please sign in to comment.