digdug/Tunnel
Inheritance
- digdug/Tunnel
- Object
new (require("digdug/Tunnel"))(kwArgs: Object)
All Properties
Property | Defined by |
---|---|
architecture: string
The architecture the tunnel will run against. |
digdug/Tunnel |
auth: string
An HTTP authorization string to use when initiating connections to the tunnel. |
digdug/Tunnel |
clientUrl: string
(readonly)
The URL that a WebDriver client should used to interact with this service. |
digdug/Tunnel |
directory: string
The directory where the tunnel software will be extracted. |
digdug/Tunnel |
executable: string
The executable to spawn in order to create a tunnel. |
digdug/Tunnel |
extraCapabilities: string
(readonly)
A map of additional capabilities that need to be sent to the provider when a new session is being created. |
digdug/Tunnel |
hostname: string
The host on which a WebDriver client can access the service provided by the tunnel. |
digdug/Tunnel |
isDownloaded: string
(readonly)
Whether or not the tunnel software has already been downloaded. |
digdug/Tunnel |
isRunning: boolean
(readonly)
Whether or not the tunnel is currently running. |
digdug/Tunnel |
isStarting: boolean
(readonly)
Whether or not the tunnel is currently starting up. |
digdug/Tunnel |
isStopping: boolean
(readonly)
Whether or not the tunnel is currently stopping. |
digdug/Tunnel |
pathname: string
The path that a WebDriver client should use to access the service provided by the tunnel. |
digdug/Tunnel |
platform: string
The operating system the tunnel will run on. |
digdug/Tunnel |
port: number
The local port where the WebDriver server should be exposed by the tunnel. |
digdug/Tunnel |
protocol: string
The protocol (e.g., 'http') that a WebDriver client should use to access the service provided by the tunnel. |
digdug/Tunnel |
proxy: string
The URL of a proxy server for the tunnel to go through. |
digdug/Tunnel |
tunnelId: string
A unique identifier for the newly created tunnel. |
digdug/Tunnel |
url: string
The URL where the tunnel software can be downloaded. |
digdug/Tunnel |
verbose: boolean
Whether or not to tell the tunnel to provide verbose logging output. |
digdug/Tunnel |
All Methods
Method | Defined by |
---|---|
(protected)
Creates the list of command-line arguments to be passed to the spawned tunnel. |
digdug/Tunnel |
(protected)
Creates a newly spawned child process for the tunnel software. |
digdug/Tunnel |
(protected)
Creates the set of options to use when spawning the tunnel process. |
digdug/Tunnel |
_normalizeEnvironment(environment)
(protected)
Normalizes a specific Tunnel environment descriptor to a general form. |
digdug/Tunnel |
Called with the response after a file download has completed |
digdug/Tunnel |
(protected)
This method provides the implementation that actually starts the tunnel and any other logic for emitting events on the Tunnel based on data passed by the tunnel software. |
digdug/Tunnel |
(protected)
This method provides the implementation that actually stops the tunnel. |
digdug/Tunnel |
Downloads and extracts the tunnel software if it is not already downloaded. |
digdug/Tunnel |
Get a list of environments available on the service. |
digdug/Tunnel |
Sends information about a job to the tunnel provider. |
digdug/Tunnel |
Starts the tunnel, automatically downloading dependencies if necessary. |
digdug/Tunnel |
Stops the tunnel. |
digdug/Tunnel |
All Events
Event | Defined by |
---|---|
Part of the tunnel has been downloaded from the server. |
digdug/Tunnel |
Information about the status of the tunnel setup process that is suitable for presentation to end-users. |
digdug/Tunnel |
A chunk of raw string data output by the tunnel software to stderr. |
digdug/Tunnel |
A chunk of raw string data output by the tunnel software to stdout. |
digdug/Tunnel |
Properties
architecture: string
auth: string
(readonly) clientUrl: string
directory: string
executable: string
(readonly) extraCapabilities: string
hostname: string
(readonly) isDownloaded: string
(readonly) isRunning: boolean
(readonly) isStarting: boolean
(readonly) isStopping: boolean
pathname: string
platform: string
port: number
protocol: string
proxy: string
Methods
(protected) _makeArgs(): Array.<string>
Creates the list of command-line arguments to be passed to the spawned tunnel. Implementations should override this method to provide the appropriate command-line arguments.
Arguments passed to digdug/Tunnel#_makeChild will be passed as-is to this method.
Returns
A list of command-line arguments.
(protected) _makeChild(): Object
Creates a newly spawned child process for the tunnel software. Implementations should call this method to create the tunnel process.
Arguments passed to this method will be passed as-is to digdug/Tunnel#_makeArgs and digdug/Tunnel#_makeOptions.
Returns
An object containing a newly spawned Process and a Deferred that will be resolved once the tunnel has started successfully.
(protected) _makeOptions(): Object
Creates the set of options to use when spawning the tunnel process. Implementations should override this method to provide the appropriate options for the tunnel software.
Arguments passed to digdug/Tunnel#_makeChild will be passed as-is to this method.
Returns
A set of options matching those provided to Node.js child_process.spawn.
(protected) _normalizeEnvironment(environment)
_postDownloadFile()
(protected) _start(): Object
This method provides the implementation that actually starts the tunnel and any other logic for emitting events on the Tunnel based on data passed by the tunnel software.
The default implementation that assumes the tunnel is ready for use once the child process has written to
stdout
or stderr
. This method should be reimplemented by other tunnel launchers to implement correct
launch detection logic.
Returns
An object containing a reference to the child process, and a Deferred that is resolved once the tunnel is ready for use. Normally this will be the object returned from a call to
Tunnel#_makeChild
.
(protected) _stop(): Promise.<void>
This method provides the implementation that actually stops the tunnel.
The default implementation that assumes the tunnel has been closed once the child process has exited. This method should be reimplemented by other tunnel launchers to implement correct shutdown logic, if necessary.
Returns
A promise that resolves once the tunnel has shut down.
download(forceDownload: boolean): Promise.<void>
Downloads and extracts the tunnel software if it is not already downloaded.
This method can be extended by implementations to perform any necessary post-processing, such as setting appropriate file permissions on the downloaded executable.
Parameters
Name | Type | Description |
---|---|---|
forceDownload |
boolean |
Force downloading the software even if it already has been downloaded. |
Returns
A promise that resolves once the download and extraction process has completed.
getEnvironments()
Get a list of environments available on the service.
This method should be overridden and use a specific implementation that returns normalized environments from the service. E.g.
{
browserName: 'firefox',
version: '12',
platform: 'windows',
descriptor: {
Returns
An object containing the response and helper functions
sendJobState(jobId: string, data: JobState): Promise.<void>
Sends information about a job to the tunnel provider.
Parameters
Name | Type | Description |
---|---|---|
jobId |
string |
The job to send data about. This is usually a session ID. |
data |
JobState |
Data to send to the tunnel provider about the job. |
Returns
A promise that resolves once the job state request is complete.