File tree 2 files changed +10
-7
lines changed
2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -42,26 +42,28 @@ export const WDIO_DEFAULTS: Options.Definition<Capabilities.WebdriverIOConfig> =
42
42
return
43
43
}
44
44
45
+ const packageName = param === SupportedAutomationProtocols . stub ? param : `@testplane/${ param } `
46
+
45
47
try {
46
- import . meta. resolve ( param )
48
+ import . meta. resolve ( packageName )
47
49
} catch ( err ) {
48
50
const error = err instanceof Error ? err : new Error ( 'unknown error' )
49
- throw new Error ( `Couldn't find automation protocol "${ param } ": ${ error . message } ` )
51
+ throw new Error ( `Couldn't find automation protocol "${ packageName } ": ${ error . message } ` )
50
52
}
51
53
52
54
try {
53
55
const __dirname = dirname ( fileURLToPath ( import . meta. url ) )
54
56
const require = createRequire ( import . meta. url )
55
- const id = param === SupportedAutomationProtocols . stub
56
- ? resolve ( __dirname , '..' , 'build' , param )
57
- : param
57
+ const id = packageName === SupportedAutomationProtocols . stub
58
+ ? resolve ( __dirname , '..' , 'build' , packageName )
59
+ : packageName
58
60
require . resolve ( id )
59
61
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
60
62
} catch ( err : any ) {
61
63
/* istanbul ignore next */
62
64
throw new Error (
63
65
'Automation protocol package is not installed!\n' +
64
- `Please install it via \`npm install ${ param } \``
66
+ `Please install it via \`npm install ${ packageName } \``
65
67
)
66
68
}
67
69
}
Original file line number Diff line number Diff line change @@ -46,7 +46,8 @@ export async function getProtocolDriver (options: Capabilities.WebdriverIOConfig
46
46
*/
47
47
if ( automationProtocol === SupportedAutomationProtocols . devtools || automationProtocol ?. startsWith ( '/@fs/' ) ) {
48
48
try {
49
- const DevTools = await import ( `@testplane/${ automationProtocol } ` )
49
+ const packageName = automationProtocol === 'devtools' ? `@testplane/${ automationProtocol } ` : automationProtocol
50
+ const DevTools = await import ( packageName )
50
51
log . info ( 'Starting session using Chrome DevTools as automation protocol and Puppeteer as driver' )
51
52
return { Driver : DevTools . default , options }
52
53
} catch ( err : unknown ) {
You can’t perform that action at this time.
0 commit comments