🤖 Merge PR #47761 Fix selenium-standalone driver options by @mgrybyk

This commit is contained in:
Mykola Grybyk 2020-09-21 10:25:22 +02:00 committed by GitHub
parent 877906d295
commit 7d8e9741ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 10 deletions

View File

@ -22,11 +22,7 @@ export interface InstallOpts {
basePath?: string;
version?: string;
drivers?: {
[browser: string]: {
version?: string;
arch: string | "ia32" | "x64";
baseURL: string;
}
[browser: string]: DriverOptions
};
progressCb?: (totalLength: number, progressLength: number, chunkLength: number) => void;
logger?: (message: string) => void;
@ -38,11 +34,7 @@ export interface StartOpts {
basePath?: string;
version?: string;
drivers?: {
[browser: string]: {
version?: string;
arch: string | "ia32" | "x64";
baseURL: string;
}
[browser: string]: DriverOptions
};
seleniumArgs?: string[];
javaArgs?: string[];
@ -53,6 +45,12 @@ export interface StartOpts {
cb?: (error: Error, child: ChildProcess) => void;
}
export interface DriverOptions {
version?: string;
arch?: string | "ia32" | "x64";
baseURL?: string;
}
export interface FsPaths {
[x: string]: any;
chrome?: {

View File

@ -24,6 +24,15 @@ let installOpts: InstallOpts = {
cb: (error: Error) => {},
};
const installOptsCompact: InstallOpts = {
version: "version",
drivers: {
chrome: {
version: "chrome_version",
},
},
};
installOpts = {};
installOpts = {
@ -60,6 +69,15 @@ let startOpts: StartOpts = {
};
startOpts = {};
const startOptsCompact: StartOpts = {
version: "version",
drivers: {
firefox: {
version: "version",
}
},
};
// FsPaths interface
let fsPaths: FsPaths = {
bla: "foo",
@ -88,8 +106,10 @@ fsPaths = {};
// start method
start(startOpts, (error: Error | null, selenium: ChildProcess) => {});
start(installOptsCompact, (error: Error | null, selenium: ChildProcess) => {});
start((error: Error | null, selenium: ChildProcess) => {});
// install method
install(installOpts, (error: Error | undefined, fsPaths: FsPaths) => {});
install(installOptsCompact, (error: Error | undefined, fsPaths: FsPaths) => {});
install((error: Error | undefined, fsPaths: FsPaths) => {});