Skip to content

Commit 1f3e231

Browse files
committed
making ide flexible with node_modules
1 parent 5edeb82 commit 1f3e231

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

packages/selenium-ide/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "selenium-ide",
3-
"version": "4.0.1-alpha.64",
3+
"version": "4.0.1-alpha.65",
44
"private": false,
55
"description": "Selenium IDE electron app",
66
"author": "Todd <[email protected]>",
@@ -115,7 +115,6 @@
115115
"@seleniumhq/side-model": "^4.0.0-alpha.5",
116116
"@seleniumhq/side-runtime": "^4.0.0-alpha.32",
117117
"dnd-core": "^16.0.1",
118-
"electron": "^28.0.0",
119118
"electron-chromedriver": "^28.0.0",
120119
"electron-log": "^5.0.1",
121120
"electron-store": "^8.1.0",
@@ -144,6 +143,7 @@
144143
"@types/webpack-env": "^1.16.0",
145144
"copy-webpack-plugin": "^10.2.4",
146145
"css-loader": "^6.8.1",
146+
"electron": "^28.0.0",
147147
"electron-builder": "^24.9.1",
148148
"electron-devtools-installer": "^3.2.0",
149149
"fork-ts-checker-webpack-plugin": "^8.0.0",

packages/selenium-ide/src/main/session/controllers/Driver/start.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,16 @@ export const port = app.isPackaged ? 9516 : 9515
3030
* 4. When Electron is quitting, close the child driver process
3131
*/
3232

33-
const ourElectronPath = path
34-
.resolve(
35-
path.join(
36-
__dirname,
37-
'..',
38-
'node_modules',
39-
'electron-chromedriver',
40-
'bin',
41-
'chromedriver' + (os.platform() === 'win32' ? '.exe' : '')
42-
)
33+
const ourElectronPath = __non_webpack_require__.resolve(
34+
path.join(
35+
'electron-chromedriver',
36+
'bin',
37+
'chromedriver' + (os.platform() === 'win32' ? '.exe' : '')
4338
)
39+
)
4440

45-
const getDriver = ({ browser, version }: BrowserInfo) => (
46-
browser === 'electron'
41+
const getDriver = ({ browser, version }: BrowserInfo) =>
42+
(browser === 'electron'
4743
? ourElectronPath
4844
: path.resolve(
4945
path.join(
@@ -70,9 +66,15 @@ const startDriver: StartDriver = () => (info) =>
7066
const driverPath = getDriver(info)
7167
switch (info.browser) {
7268
case 'electron':
73-
7469
}
75-
console.log('Starting driver', info.browser, 'at', driverPath, 'with args', args.join(' '))
70+
console.log(
71+
'Starting driver',
72+
info.browser,
73+
'at',
74+
driverPath,
75+
'with args',
76+
args.join(' ')
77+
)
7678
if (fs.existsSync(driverPath)) {
7779
const driver = spawn(driverPath.replace(/\s/g, ' '), args, {
7880
env: {},

0 commit comments

Comments
 (0)