Appium Service
Handling the Appium server is out of scope of the actual WebdriverIO project. This service helps you to run the Appium server seamlessly when running tests with the WDIO testrunner. It starts the Appium Server in in a child process.
Installation
The easiest way is to keep @wdio/appium-service
as a devDependency in your package.json
.
{
"devDependencies": {
"@wdio/appium-service": "^5.0.0"
}
}
You can simple do it by:
npm install @wdio/appium-service --save-dev
Instructions on how to install WebdriverIO
can be found here.
Configuration
In order to use the service you need to add appium
to your service array:
// wdio.conf.js
export.config = {
// ...
port: 4723, // default appium port
services: ['appium'],
// ...
};
Options
The following options can be added to the wdio.conf.js file.
logPath
Path where all logs from the Appium server should be stored.
Type: String
Default: {}
Example:
export.config = {
appium: {
logPath : "./",
}
}
command
To use your own installation of Appium, ex globally installed, specify the command which should be started.
Type: String
Default: {}
Example:
export.config = {
appium: {
// for globally installed Appium just pass appium
command: "appium",
}
}
args
Map of arguments for the Appium server, passed directly to appium
.
See the documentation for possible arguments.
The arguments should be supplied in lower camel case, so --pre-launch true
becomes preLaunch: true
or passed as an array.
Type: Object
or Array
Default: {}
Example:
export.config = {
appium: {
args: {
// ...
debugLogSpacing: true,
platformName: 'iOS',
// ...
}
// or
// args: ['-p', '4722', '--relaxed-security', '--log-level', 'info:info']
}
},
For more information on WebdriverIO see the homepage.