EnvBrowserLauncher

class EnvBrowserLauncher(env: String, envLookup: (String) -> String?) : BrowserLauncher

Launcher of browsers whose path is stored in environment variables (BROWSER_<env>) passing the URL as the first argument to the browser executable.

Parameters

env

the environment variable suffix (e.g., chrome for BROWSER_CHROME).

envLookup

function to look up environment variable values. If different from System::getenv, it can be used for testing purposes

Constructors

Link copied to clipboard
constructor(env: String, envLookup: (String) -> String?)

Properties

Link copied to clipboard

The name of the environment variable for the browser.

Link copied to clipboard
open override val isValid: Boolean

Indicates whether the browser is valid and can be launched.

Functions

Link copied to clipboard
open override fun launch(url: String)

Launches a URL in the specified browser.

Link copied to clipboard
open fun launchLocal(port: Int, endpoint: String = "/")

Launches a localhost:<port> in the specified browser.