OpenText™ Functional Testing for Developers JavaScript SDK

SrfLab

new SrfLab()

Enables you to 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:
Name Type Description
browserCapabilities string | object the type of browser to launch: Possible values: Web.BrowserType, or a property bag defining the browser capabilities.
Properties
Name Type Description
type string if 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, appsToInstallopt, deviceSourceopt) → {Promise.<Mobile.DeviceTO>}

Obtains a device from the SRF Mobile lab and locks it, so that only OpenText Functional Testing for Developers can perform actions on it.
Parameters:
Name Type Attributes Description
description Mobile.Device | object The description of the device or a device capabilities property bag.
appsToInstall Array.<Mobile.Application> <optional>
An Application array of applications to install on the device.
deviceSource Mobile.DeviceSource <optional>
The source location of the device. You can use the DeviceSource object or just pass 'mobile_center', 'on_premises', '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 OpenText Functional Testing for Developers can perform actions on it.
Parameters:
Name Type Description
deviceID string The device ID used by SRF Mobile lab.
Returns:
a promise that is fulfilled with the locked device.
Type
Promise.<Mobile.DeviceTO>

lockDeviceWithOptions(description, sessionOptions) → {Promise.<Mobile.DeviceTO>}

Obtains a device from the SRF Mobile lab and locks it, so that only the current test can perform actions on it.
Parameters:
Name Type Description
description Mobile.Device | object The description of the device or a device capabilities property bag.
sessionOptions Object the session options to use.
Properties
Name Type Attributes Default Description
appsToInstall Array.<Mobile.Application> <optional>
An Application array of applications to install on the device.
deviceSource Mobile.DeviceSource <optional>
The source location of the device. You can use the DeviceSource object or just pass 'mobile_center', 'on_premises', 'amazon_device_farm' or 'any' as a string.
collectLogs bool <optional>
true indicates whether logs should be collected in this session.
collectVitals Object <optional>
Defines which device vitals should be collected in this session.
Properties
Name Type Attributes Default Description
cpu bool <optional>
false indicates whether to collect the device CPU usage.
memory bool <optional>
false indicates whether to collect the device memory usage.
freeMemory bool <optional>
false indicates whether to collect the device free memory.
Returns:
a promise that is fulfilled with the locked device.
Type
Promise.<Mobile.DeviceTO>

releaseEnvironment(envToRelease)

Release the allocated device environment.
Parameters:
Name Type Description
envToRelease Web.BrowserTO | Mobile.DeviceTO the browser or device environment to release.