File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -30,12 +30,17 @@ for (const key of BROWSERSTACK_LOCAL_OPTION_KEYS) {
3030 }
3131}
3232
33+ /**
34+ * USE_OWN_LOCAL_BINARY_PROCESS:
35+ * If true, the system will not start a new local binary process, but will use the user's own process.
36+ */
3337export class Config {
3438 constructor (
3539 public readonly browserstackUsername : string ,
3640 public readonly browserstackAccessKey : string ,
3741 public readonly DEV_MODE : boolean ,
3842 public readonly browserstackLocalOptions : Record < string , any > ,
43+ public readonly USE_OWN_LOCAL_BINARY_PROCESS : boolean ,
3944 ) { }
4045}
4146
@@ -44,6 +49,7 @@ const config = new Config(
4449 process . env . BROWSERSTACK_ACCESS_KEY ! ,
4550 process . env . DEV_MODE === "true" ,
4651 browserstackLocalOptions ,
52+ process . env . USE_OWN_LOCAL_BINARY_PROCESS === "true" ,
4753) ;
4854
4955export default config ;
Original file line number Diff line number Diff line change @@ -80,6 +80,13 @@ export async function ensureLocalBinarySetup(
8080 "Ensuring local binary setup as it is required for private URLs..." ,
8181 ) ;
8282
83+ if ( config . USE_OWN_LOCAL_BINARY_PROCESS ) {
84+ logger . info (
85+ "Using user's own BrowserStack Local binary process, skipping setup..." ,
86+ ) ;
87+ return ;
88+ }
89+
8390 const localBinary = new Local ( ) ;
8491 await killExistingBrowserStackLocalProcesses ( ) ;
8592
Original file line number Diff line number Diff line change @@ -41,6 +41,12 @@ export class AccessibilityScanner {
4141 await killExistingBrowserStackLocalProcesses ( ) ;
4242 }
4343
44+ if ( config . USE_OWN_LOCAL_BINARY_PROCESS ) {
45+ throw new Error (
46+ "Cannot start scan with local URLs when using own BrowserStack Local binary process. Please set USE_OWN_LOCAL_BINARY_PROCESS to false." ,
47+ ) ;
48+ }
49+
4450 const transformedUrlList = urlList . map ( ( url ) => {
4551 try {
4652 const parsed = new URL ( url ) ;
You can’t perform that action at this time.
0 commit comments