AppCenterTest@1 - App Center 測試 v1 工作

使用 Visual Studio App Center 測試應用程式套件。

語法

# App Center test v1
# Test app packages with Visual Studio App Center.
- task: AppCenterTest@1
  inputs:
    appFile: # string. Alias: app. Required. Binary application file path. 
    artifactsDirectory: '$(Build.ArtifactStagingDirectory)/AppCenterTest' # string. Alias: artifactsDir. Required. Artifacts directory. Default: $(Build.ArtifactStagingDirectory)/AppCenterTest.
  # Prepare Tests
    #prepareTests: true # boolean. Alias: enablePrepare. Prepare tests. Default: true.
    frameworkOption: 'appium' # 'appium' | 'espresso' | 'calabash' | 'uitest' | 'xcuitest'. Alias: framework. Required when prepareTests = true. Test framework. Default: appium.
    #appiumBuildDirectory: # string. Alias: appiumBuildDir. Required when prepareTests = true && frameworkOption = appium. Build directory. 
    #espressoBuildDirectory: # string. Alias: espressoBuildDir. Optional. Use when prepareTests = true && frameworkOption = espresso. Build directory. 
    #espressoTestApkFile: # string. Alias: espressoTestApkPath. Optional. Use when prepareTests = true && frameworkOption = espresso. Test APK path. 
    #calabashProjectDirectory: # string. Alias: calabashProjectDir. Required when prepareTests = true && frameworkOption = calabash. Project directory. 
    #calabashConfigFile: # string. Optional. Use when prepareTests = true && frameworkOption = calabash. Cucumber config file. 
    #calabashProfile: # string. Optional. Use when prepareTests = true && frameworkOption = calabash. Profile to run. 
    #calabashSkipConfigCheck: false # boolean. Optional. Use when prepareTests = true && frameworkOption = calabash. Skip Configuration Check. Default: false.
    #uiTestBuildDirectory: # string. Alias: uitestBuildDir. Required when prepareTests = true && frameworkOption = uitest. Build directory. 
    #uitestStorePath: # string. Optional. Use when prepareTests = true && frameworkOption = uitest. Store file. 
    #uiTestStorePassword: # string. Alias: uitestStorePass. Optional. Use when prepareTests = true && frameworkOption = uitest. Store password. 
    #uitestKeyAlias: # string. Optional. Use when prepareTests = true && frameworkOption = uitest. Key alias. 
    #uiTestKeyPassword: # string. Alias: uitestKeyPass. Optional. Use when prepareTests = true && frameworkOption = uitest. Key password. 
    #uiTestToolsDirectory: # string. Alias: uitestToolsDir. Optional. Use when prepareTests = true && frameworkOption = uitest. Test tools directory. 
    #signInfo: # string. Optional. Use when frameworkOption = calabash || frameworkOption = uitest. Signing information. 
    #xcUITestBuildDirectory: # string. Alias: xcuitestBuildDir. Optional. Use when prepareTests = true && frameworkOption = xcuitest. Build directory. 
    #xcUITestIpaFile: # string. Alias: xcuitestTestIpaPath. Optional. Use when prepareTests = true && frameworkOption = xcuitest. Test IPA path. 
    #prepareOptions: # string. Alias: prepareOpts. Optional. Use when prepareTests = true. Additional options. 
  # Run Tests
    #runTests: true # boolean. Alias: enableRun. Run tests. Default: true.
    credentialsOption: 'serviceEndpoint' # 'serviceEndpoint' | 'inputs'. Alias: credsType. Required when runTests = true. Authentication method. Default: serviceEndpoint.
    #serverEndpoint: # string. Required when runTests = true && credentialsOption = serviceEndpoint. App Center service connection. 
    #username: # string. Required when runTests = true && credentialsOption = inputs. App Center username. 
    #password: # string. Required when runTests = true && credentialsOption = inputs. App Center password. 
    appSlug: # string. Required when runTests = true. App slug. 
    devices: # string. Required when runTests = true. Devices. 
    #series: 'master' # string. Optional. Use when runTests = true. Test series. Default: master.
    #dsymDirectory: # string. Alias: dsymDir. Optional. Use when runTests = true. dSYM directory. 
    localeOption: 'en_US' # 'da_DK' | 'nl_NL' | 'en_GB' | 'en_US' | 'fr_FR' | 'de_DE' | 'ja_JP' | 'ru_RU' | 'es_MX' | 'es_ES' | 'user'. Alias: locale. Required when runTests = true. System language. Default: en_US.
    #userDefinedLocale: # string. Optional. Use when runTests = true && localeOption = user. Other locale. 
    #loginOptions: # string. Alias: loginOpts. Optional. Use when runTests = true && credentialsOption = inputs. Additional options for login. 
    #runOptions: # string. Alias: runOpts. Optional. Use when runTests = true. Additional options for run. 
    #skipWaitingForResults: false # boolean. Alias: async. Optional. Use when runTests = true. Do not wait for test result. Default: false.
  # Advanced
    #cliFile: # string. Alias: cliLocationOverride. App Center CLI location. 
    #showDebugOutput: false # boolean. Alias: debug. Enable debug output. Default: false.

輸入

appFile - 二進位應用程式檔路徑
輸入別名: app。 string。 必須的。

從存放庫根目錄到您要測試之 APK 或 IPA 檔案的相對路徑。


artifactsDirectory - Artifacts 目錄
輸入別名: artifactsDir。 string。 必須的。 預設值:$(Build.ArtifactStagingDirectory)/AppCenterTest。

指定放置準備步驟所產生的成品,以及執行步驟所使用的位置。 如果目錄不存在,將會建立此目錄。


prepareTests - 準備測試
輸入別名: enablePrepare。 boolean。 預設值:true。

當設定為 true時,此輸入會準備測試。


frameworkOption - 測試架構
輸入別名: framework。 string。 prepareTests = true時為必要項。 允許的值:appium、espresso、calabash、uitest(Xamarin UI 測試),xcuitest。 預設值:appium。


appiumBuildDirectory - 組建目錄
輸入別名: appiumBuildDir。 string。 prepareTests = true && frameworkOption = appium時為必要項。

具有 Appium 測試之目錄的路徑。


espressoBuildDirectory - 組建目錄
輸入別名: espressoBuildDir。 string。 選擇性。 prepareTests = true && frameworkOption = espresso時使用 。

Espresso 輸出目錄的路徑。


espressoTestApkFile - 測試 APK 路徑
輸入別名: espressoTestApkPath。 string。 選擇性。 prepareTests = true && frameworkOption = espresso時使用 。

具有 Espresso 測試之 APK 檔案的路徑。 如果未設定,則會使用 build-dir 來探索它。 允許通配符。


calabashProjectDirectory - Project 目錄
輸入別名: calabashProjectDir。 string。 prepareTests = true && frameworkOption = calabash時為必要項。

Calabash 工作區目錄的路徑。


calabashConfigFile - Cucumber 組態檔
string。 選擇性。 prepareTests = true && frameworkOption = calabash時使用 。

Cucumber 組態檔的路徑,通常cucumber.yml。


要執行calabashProfile - 配置檔
string。 選擇性。 prepareTests = true && frameworkOption = calabash時使用 。

要執行的配置檔。 此值必須存在於 Cucumber 組態檔中。


calabashSkipConfigCheck - 略過組態檢查
boolean。 選擇性。 prepareTests = true && frameworkOption = calabash時使用 。 預設值:false。

當設定為 true時,此輸入會略過 Cucumber 配置檔指定的組態檢查。


uiTestBuildDirectory - 組建目錄
輸入別名: uitestBuildDir。 string。 prepareTests = true && frameworkOption = uitest時為必要項。

具有建置測試元件的目錄路徑。


uitestStorePath - Store 檔案
string。 選擇性。 prepareTests = true && frameworkOption = uitest時使用 。

用來簽署應用程式的市集檔案路徑。


uiTestStorePassword - 市集密碼
輸入別名: uitestStorePass。 string。 選擇性。 prepareTests = true && frameworkOption = uitest時使用 。

用來簽署應用程式的市集檔案密碼。 若要加密此值,請使用新的變數,並在 [變數] 索引卷標上啟用其鎖定。


uitestKeyAlias - 金鑰別名
string。 選擇性。 prepareTests = true && frameworkOption = uitest時使用 。

指定別名,識別存放區檔案中使用的公開/私鑰組。


uiTestKeyPassword - 金鑰密碼
輸入別名: uitestKeyPass。 string。 選擇性。 prepareTests = true && frameworkOption = uitest時使用 。

指定別名和儲存盤案的金鑰密碼。 若要加密此值,請使用新的變數,並在 [變數] 索引卷標上啟用其鎖定。


uiTestToolsDirectory - 測試工具目錄
輸入別名: uitestToolsDir。 string。 選擇性。 prepareTests = true && frameworkOption = uitest時使用 。

具有包含 test-cloud.exe之 Xamarin UI 測試工具之目錄的路徑。


signInfo - 簽署資訊
string。 選擇性。 frameworkOption = calabash || frameworkOption = uitest時使用 。

簽署測試伺服器。


xcUITestBuildDirectory - 組建目錄
輸入別名: xcuitestBuildDir。 string。 選擇性。 prepareTests = true && frameworkOption = xcuitest時使用 。

組建輸出目錄的路徑(通常 $(ProjectDir)/Build/Products/Debug-iphoneos)。


xcUITestIpaFile - 測試 IPA 路徑
輸入別名: xcuitestTestIpaPath。 string。 選擇性。 prepareTests = true && frameworkOption = xcuitest時使用 。

具有 XCUITest 測試之 .ipa 檔案的路徑。


prepareOptions - 其他選項
輸入別名: prepareOpts。 string。 選擇性。 prepareTests = true時使用 。

傳遞至 App Center 測試準備步驟的其他自變數。


runTests - 執行測試
輸入別名: enableRun。 boolean。 預設值:true。

執行測試。


credentialsOption - 驗證方法
輸入別名: credsType。 string。 runTests = true時為必要項。 允許的值:serviceEndpoint(App Center 服務連線)、inputs(認證)。 預設值:serviceEndpoint。

使用 App Center 服務連線,或輸入認證以連線到 Visual Studio App Center。


serverEndpoint - App Center 服務連線
string。 runTests = true && credentialsOption = serviceEndpoint時為必要項。

選取 Visual Studio App Center 的服務連線。 如有需要,請按兩下 [管理] 連結以建立新的服務連線。


username - App Center 使用者名稱
string。 runTests = true && credentialsOption = inputs時為必要項。

造訪 App Center 登入頁面來建立您的使用者名稱,並提供此處的值。


password - App Center 密碼
string。 runTests = true && credentialsOption = inputs時為必要項。

請造訪 App Center 登入頁面來設定密碼,並提供此處的值。 接受建置或發行管線中定義的變數,$(passwordVariable)。 您可以將變數類型標示為 secret 來保護它。


appSlug - App slug(應用別名)
string。 runTests = true時為必要項。

應用程式 slug 格式為 <username>/<app_identifier>。 若要尋找應用程式的 <username> 和 <app_identifier>,請從 Visual Studio App Center 按兩下其名稱。 產生的網址格式為 https://appcenter.ms/users/<username>/apps/<app_identifier>。


devices - 裝置
string。 runTests = true時為必要項。

識別此測試將針對的裝置。 當您從 Visual Studio App Center 測試指標定義新的測試回合時,請複製並貼上此字串。


series - 測試系列
string。 選擇性。 runTests = true時使用 。 預設值:master。

組織測試回合的系列名稱(例如:master、production、beta)。


dsymDirectory - dSYM 目錄
輸入別名: dsymDir。 string。 選擇性。 runTests = true時使用 。

iOS 符號檔的路徑。


localeOption - 系統語言
輸入別名: locale。 string。 runTests = true時為必要項。 允許的值:da_DK(丹麥))、nl_NL(荷蘭))、en_GB(英國)、en_US(英文(美國))、fr_FR(法國))、fr_FRfr_FRen_GBes_MX(德國)、es_ES(日本)、user(俄羅斯))、(西班牙(墨西哥))、(西班牙))、(其他)。 預設值:en_US。

如果未顯示您的語言,請使用 。 選擇 Other 並輸入其地區設定,例如 en_US。


userDefinedLocale - 其他地區設定
string。 選擇性。 runTests = true && localeOption = user時使用 。

輸入任何雙字母 ISO-639 語言代碼,以及格式為 <language>_<country>的任何雙字母 ISO 3166 國家/地區代碼,例如 en_US。


loginOptions - 登入 的其他選項
輸入別名: loginOpts。 string。 選擇性。 runTests = true && credentialsOption = inputs時使用 。

傳遞至 Visual Studio App Center 登入步驟的其他自變數。


runOptions - 執行 的其他選項
輸入別名: runOpts。 string。 選擇性。 runTests = true時使用 。

傳遞至 Visual Studio App Center 測試回合的其他自變數。


skipWaitingForResults - 不要等候測試結果
輸入別名: async。 boolean。 選擇性。 runTests = true時使用 。 預設值:false。

以異步方式執行命令,並在上傳測試時結束,而不會等待測試結果。


cliFile - App Center CLI 位置
輸入別名: cliLocationOverride。 string。

組建或發行代理程式上 Visual Studio App Center CLI 的路徑。


showDebugOutput - 啟用偵錯輸出
輸入別名: debug。 boolean。 預設值:false。

將 --debug 新增至 Visual Studio App Center CLI。


工作控制選項

除了工作輸入之外,所有工作都有控制選項。 如需詳細資訊,請參閱 控制項選項和一般工作屬性。

輸出變數

沒有。

備註

此工作可讓您使用App Center Test,針對應用程式二進位檔執行測試套件(.apk 或 .ipa 檔案)。

範例

此範例會使用App Center測試工作,在Android應用程式上執行Espresso測試。

steps:
- task: AppCenterTest@1
  displayName: 'Espresso Test - Synchronous'
  inputs:
    appFile: 'Espresso/espresso-app.apk'
    artifactsDirectory: '$(Build.ArtifactStagingDirectory)/AppCenterTest'
    frameworkOption: espresso
    espressoBuildDirectory: Espresso
    serverEndpoint: 'myAppCenterServiceConnection'
    appSlug: 'xplatbg1/EspressoTests'
    devices: a84c93af

需求

要求 說明
管線類型 YAML,傳統組建
執行於 Agent、DeploymentGroup
需求 沒有
功能 此工作不符合作業中後續工作的任何需求。
命令限制 任意
Settable 變數 任意
代理程式版本 2.206.1 或更新
工作類別 測試
要求 說明
管線類型 YAML,傳統組建
執行於 Agent、DeploymentGroup
需求 沒有
功能 此工作不符合作業中後續工作的任何需求。
命令限制 任意
Settable 變數 任意
代理程式版本 2.144.0 或更新
工作類別 測試
要求 說明
管線類型 YAML,傳統組建
執行於 Agent、DeploymentGroup
需求 沒有
功能 此工作不符合作業中後續工作的任何需求。
命令限制 任意
Settable 變數 任意
代理程式版本 所有支援的代理程式版本。
工作類別 測試