Appiumサービス
Appiumサーバーの処理は、実際のWebdriverIOプロジェクトの範囲外です。このサービスは、WDIOテストランナーでテストを実行する際に、Appiumサーバーをシームレスに実行するのに役立ちます。Appiumサーバーを子プロセスで起動します。
インストール
最も簡単な方法は、@wdio/appium-service
をpackage.json
のdevDependencyとして保持することです。以下を使用します。
npm install @wdio/appium-service --save-dev
WebdriverIO
のインストール方法については、こちらをご覧ください。
設定
サービスを使用するには、サービス配列にappium
を追加する必要があります。
// wdio.conf.js
export const config = {
// ...
port: 4723, // default appium port
services: ['appium'],
// ...
};
オプション
以下のオプションは、wdio.conf.jsファイルに追加できます。サービスにオプションを定義するには、次の方法でservices
リストにサービスを追加する必要があります。
// wdio.conf.js
export const config = {
// ...
port: 4723, // default appium port
services: [
['appium', {
// Appium service options here
// ...
}]
],
// ...
};
logPath
Appiumサーバーからのすべてのログが保存されるパス。
タイプ: String
例
export const config = {
// ...
services: [
['appium', {
logPath : './'
}]
],
// ...
}
command
Appiumのインストール(例:グローバルにインストール)を使用するには、開始するコマンドを指定します。
タイプ: String
例
export const config = {
// ...
services: [
['appium', {
command : 'appium'
}]
],
// ...
}
args
Appiumサーバーの引数のマップ。直接appium
に渡されます。
可能な引数については、ドキュメントをご覧ください。引数は、ローワーキャメルケースで提供されます。たとえば、debugLogSpacing: true
は--debug-log-spacing
に変換されるか、Appiumドキュメントで概説されているように提供できます。
タイプ: Object
デフォルト: {}
例
export const config = {
// ...
services: [
['appium', {
args: {
// ...
debugLogSpacing: true,
platformName: 'iOS'
// ...
}
}]
],
// ...
}
注意: エイリアスの使用は推奨されず、サポートされていません。代わりに、ローワーキャメルケースで完全なプロパティ名を使用してください。
WebdriverIOの詳細については、ホームページをご覧ください。