Browser.IosDriver Class
This module is a browser plugin for DalekJS. It provides all a WebDriverServer & browser launcher for Safari on iOS.
At the moment this only works with the IPhone
The browser plugin can be installed with the following command:
$ npm install dalek-browser-ios --save-dev
You can use the browser plugin by adding a config option to the your Dalekfile
"browsers": ["ios"]
Or you can tell Dalek that it should test in this browser via the command line:
$ dalek mytest.js -b ios
The Webdriver Server tries to open Port 9003 by default, if this port is blocked, it tries to use a port between 9004 & 9093 You can specifiy a different port from within your Dalekfile like so:
"browsers": {
"ios": {
"port": 5555
}
}
It is also possible to specify a range of ports:
"browsers": {
"ios": {
"portRange": [6100, 6120]
}
}
If you would like to test on the IPad (IPhone) emulator, you can simply apply a snd. argument, which defines the browser type:
$ dalek mytest.js -b ios:ipad
Item Index
Methods
- _afterAppiumStarted
- _checkAppiumPorts
- _checkUserDefinedPorts
- _checkWebhookPorts
- _filterProcessItem
- _kill
- _killProcess
- _listProcesses
- _listProcesses
- _listProcesses
- _loadAppiumArgs
- _processes
- _reinstantiateLog
- _scanProcess
- _suppressAppiumLogs
- _transformProcesses
- getHost
- getMaxPort
- getPort
- getWebhookPort
- getWebhookPort
- kill
- launch
Methods
_afterAppiumStarted
-
deferred
-
appiumServer
Stores the appium server reference, restores the stdout logs
Parameters:
-
deferred
ObjectPromise
-
appiumServer
ObjectAppium server instance
_checkAppiumPorts
-
browser
Process user defined appium ports
Parameters:
-
browser
ObjectBrowser configuration
_checkUserDefinedPorts
-
browser
Process user defined ports
Parameters:
-
browser
ObjectBrowser configuration
_checkWebhookPorts
-
browser
Process user defined webhook ports
Parameters:
-
browser
ObjectBrowser configuration
_filterProcessItem
-
item
Filters process list items
Parameters:
-
item
StringProcess list entry
Returns:
Process item or false
_kill
-
err
-
result
Kills the non blacklisted simulator processes & restores the stderr handler
Parameters:
-
err
Object | NullError or null
-
result
ArrayList of currently running simulator processes
_killProcess
-
processID
Checks a blacklist & kills the process when not found
Parameters:
-
processID
IntegerProcess ID
_listProcesses
-
deferred
-
err
-
port
Checks & switches the appium server port, scans the range for the webhook port
Parameters:
-
deferred
ObjectPromise
-
err
Object | NullError or null
-
port
IntegerAppium server port to use
_listProcesses
-
deferred
-
err
-
port
Checks & switches the webhook port, loads a list of running simulator processes
Parameters:
-
deferred
ObjectPromise
-
err
Object | NullError or null
-
port
IntegerWebhook port to use
_listProcesses
-
deferred
-
err
-
result
Stores open processes, suppresses stdout logs, starts appium
Parameters:
-
deferred
ObjectPromise
-
err
Object | NullError or null
-
result
ArrayList of currently running simulator processes
_loadAppiumArgs
-
appiumArgs
Configures appium
Parameters:
-
appiumArgs
ObjectAppium specific configuration
Returns:
Modified appium configuration
_processes
-
fn
Tracks running simulator processes
Parameters:
-
fn
FunctionCallback
_reinstantiateLog
()
private
chainable
Reinstantiate stdout handler after appium has been started
_scanProcess
-
result
-
line
Scans and transforms the process list
Parameters:
-
result
ArrayTransformed result
-
line
StringProcess list entry
_suppressAppiumLogs
()
private
chainable
Overwrite default stdout & stderr handler to suppress some appium logs
_transformProcesses
-
fn
-
err
-
stdout
Transforms the process list output into a json structure
Parameters:
-
fn
FunctionCallback
-
err
Null | ObjectError if error, null if not
-
stdout
StringTerminal output
getHost
()
String
Returns the driver host
Returns:
host WebDriver server hostname
getMaxPort
()
Integer
Resolves the maximum range for the driver port
Returns:
port Max WebDriver server port range
getPort
()
Integer
Resolves the driver port
Returns:
port WebDriver server port
getWebhookPort
()
Integer
Resolves the maximum range for the webhook port
Returns:
WebHook Max WebHook port
getWebhookPort
()
Integer
Resolves the webhook port
Returns:
WebHook server port
kill
()
chainable
Kills the Appium Server process, kills simulator processses with a slight timeout to prevent appium from throwing errors
launch
-
configuration
-
events
-
config
Launches appium & corresponding emulator or device, kicks off the portscanner
Parameters:
-
configuration
ObjectBrowser configuration
-
events
EventEmitter2EventEmitter (Reporter Emitter instance)
-
config
Dalek.Internal.ConfigDalek configuration class
Returns:
promise Browser promise
Properties
appiumArgs
Object
Special arguments that are needed to invoke appium. These are the defaults, they need to be modified later on
browserTypes
Object
Different browser types (iPhone / iPad)
desiredCapabilities
Object
Default desired capabilities that should be transferred when the browser session gets requested
driverDefaults
Object
Driver defaults, what should the driver be able to access.
host
String
Default host of the Appium WebDriverServer The host may be overridden with a user configured value
Default: localhost
ipad
Object
IPad emulator
longName
String
Verbose version of the browser name
Default: Mobile Safari iOS
path
String
Root path of the appium webdriver server
Default: /wd/hub
port
Integer
Default port of the Appium WebDriverServer The port may change, cause the port conflict resolution tool might pick another one, if the default one is blocked
Default: 4723
webhookPort
Integer
WebHook port
Default: 9003