-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gecko): Add geckodriver, related config, and flags
Users will still need 'marionette': true in their capabilities in order to use gecko driver.
- Loading branch information
Showing
11 changed files
with
88 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ built/ | |
node_modules/ | ||
selenium/ | ||
typings/ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import * as path from 'path'; | ||
|
||
import {Config} from '../config'; | ||
|
||
import {Binary, OS} from './binary'; | ||
|
||
/** | ||
* The gecko driver binary. | ||
*/ | ||
export class GeckoDriver extends Binary { | ||
static os = [OS.Windows_NT, OS.Linux, OS.Darwin]; | ||
static id = 'gecko'; | ||
static versionDefault = Config.binaryVersions().gecko; | ||
static isDefault = true; | ||
static shortName = ['gecko']; | ||
|
||
static suffixes: {[key: string]: string} = { | ||
'Darwin': '-mac.tar.gz', | ||
'Linux': '-linux64.tar.gz', | ||
'Windows_NT': '-win64.zip' | ||
}; | ||
|
||
constructor() { | ||
super(); | ||
this.name = 'geckodriver'; | ||
this.versionCustom = GeckoDriver.versionDefault; | ||
this.prefixDefault = 'geckodriver-'; | ||
this.cdn = Config.cdnUrls().gecko; | ||
} | ||
|
||
id(): string { return GeckoDriver.id; } | ||
|
||
versionDefault(): string { return GeckoDriver.versionDefault; } | ||
|
||
suffix(ostype: string, arch: string): string { | ||
if (!GeckoDriver.supports(ostype, arch)) { | ||
throw new Error('GeckoDriver doesn\'t support ${ostype} ${arch}!'); | ||
} | ||
|
||
return GeckoDriver.suffixes[ostype]; | ||
} | ||
|
||
static supports(ostype: string, arch: string): boolean { | ||
return arch == 'x64' && (ostype in GeckoDriver.suffixes); | ||
} | ||
|
||
url(ostype: string, arch: string): string { | ||
let urlBase = this.cdn + this.version() + '/'; | ||
let filename = this.prefix() + this.version() + this.suffix(ostype, arch); | ||
return urlBase + filename; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters