winappdriver 服務
此服務可協助您在使用 WDIO 測試執行器執行測試時,順暢地執行 WinAppDriver 伺服器。它會在子程序中啟動 WinAppDriver。
安裝
npm install wdio-winappdriver-service --save-dev
有關如何安裝 WebdriverIO
的說明,請參閱此處。
設定
為了使用此服務,您需要將 winappdriver
加入您的服務陣列
// wdio.conf.js
export.config = {
// ...
services: ['winappdriver'],
// ...
};
選項
以下選項可以加入到 wdio.conf.js 檔案中。為了定義此服務的選項,您需要以以下方式將此服務加入到 services
清單中
// wdio.conf.js
export.config = {
// ...
services: [
['winappdriver', {
// WinAppDriver service options here
// ...
}]
],
// ...
};
logPath
應儲存來自 winappdriver 伺服器的所有記錄的路徑。
類型:String
範例
export.config = {
// ...
services: [
['winappdriver', {
logPath : './'
}]
],
// ...
}
command
若要使用您自己安裝的 WinAppDriver,例如全域安裝,請指定應啟動的命令。
類型:String
範例
export.config = {
// ...
services: [
['winappdriver', {
command : 'c:\\Program Files (x86)\\Windows Application Driver\\WinAppDriver.exe'
}]
],
// ...
}
args
直接傳遞給 WinAppDriver
的引數清單。
有關可能的引數,請參閱說明文件。
類型:Array
預設:[]
範例
export.config = {
// ...
services: [
['winappdriver', {
args: ['10.0.0.10', '4723/wd/hub']
}]
],
// ...
}