SrfLab

SrfLab

new SrfLab()

The SRF lab, where you can launch browsers or lock devices in SRF.

Methods

launchBrowser(browserCapabilities) → {Promise.<Web.BrowserTO>}

Launches a new browser tab, according to supplied Web.BrowserType or a browser capabilities property bag. Returning an instance of Web.Browser for the launched browser. The returned browser instance is valid until the tab is closed.
Parameters:
NameTypeDescription
browserCapabilitiesstring | objectthe type of browser to launch: Possible values: Web.BrowserType, or a property bag defining the browser capabilities.
Properties
NameTypeDescription
typestringif a property bag is supplied, it must have the type key, Possible values: Web.BrowserType.
Returns:
a promise that is fulfilled with the browser instance.
Type
Promise.<Web.BrowserTO>

lockDevice(description, appsToInstall[opt], deviceSource[opt]) → {Promise.<Mobile.DeviceTO>}

Obtains a device from the SRF Mobile lab and locks it, so that only LeanFT can perform actions on it.
Parameters:
NameTypeAttributesDescription
descriptionMobile.Device | objectThe description of the device or a device capabilities property bag.
appsToInstallArray.<Mobile.Application> <optional>
An Application array of applications to install on the device.
deviceSourceMobile.Device.DeviceSource <optional>
The source location of the device. You can use the DeviceSource object or just pass 'mobile_center', 'amazon_device_farm' or 'any' as a string.
Returns:
a promise that is fulfilled with the locked device.
Type
Promise.<Mobile.DeviceTO>

lockDeviceById(deviceID) → {Promise.<Mobile.DeviceTO>}

Obtains a device from the SRF Mobile lab by deviceID and locks it, so that only LeanFT can perform actions on it.
Parameters:
NameTypeDescription
deviceIDstringThe device ID used by SRF Mobile lab.
Returns:
a promise that is fulfilled with the locked device.
Type
Promise.<Mobile.DeviceTO>

releaseEnvironment(envToRelease)

Release the allocated device environment.
Parameters:
NameTypeDescription
envToReleaseWeb.BrowserTO | Mobile.DeviceTOthe browser or device environment to release.