AppCenterTest@1 - App Center 測試 v1 工作

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

Syntax

# 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 enablePrepare = true. Test framework. Default: appium.
    #appiumBuildDirectory: # string. Alias: appiumBuildDir. Required when enablePrepare = true && framework = appium. Build directory. 
    #espressoBuildDirectory: # string. Alias: espressoBuildDir. Optional. Use when enablePrepare = true && framework = espresso. Build directory. 
    #espressoTestApkFile: # string. Alias: espressoTestApkPath. Optional. Use when enablePrepare = true && framework = espresso. Test APK path. 
    #calabashProjectDirectory: # string. Alias: calabashProjectDir. Required when enablePrepare = true && framework = calabash. Project directory. 
    #calabashConfigFile: # string. Optional. Use when enablePrepare = true && framework = calabash. Cucumber config file. 
    #calabashProfile: # string. Optional. Use when enablePrepare = true && framework = calabash. Profile to run. 
    #calabashSkipConfigCheck: false # boolean. Optional. Use when enablePrepare = true && framework = calabash. Skip Configuration Check. Default: false.
    #uiTestBuildDirectory: # string. Alias: uitestBuildDir. Required when enablePrepare = true && framework = uitest. Build directory. 
    #uitestStorePath: # string. Optional. Use when enablePrepare = true && framework = uitest. Store file. 
    #uiTestStorePassword: # string. Alias: uitestStorePass. Optional. Use when enablePrepare = true && framework = uitest. Store password. 
    #uitestKeyAlias: # string. Optional. Use when enablePrepare = true && framework = uitest. Key alias. 
    #uiTestKeyPassword: # string. Alias: uitestKeyPass. Optional. Use when enablePrepare = true && framework = uitest. Key password. 
    #uiTestToolsDirectory: # string. Alias: uitestToolsDir. Optional. Use when enablePrepare = true && framework = uitest. Test tools directory. 
    #signInfo: # string. Optional. Use when framework = calabash || framework = uitest. Signing information. 
    #xcUITestBuildDirectory: # string. Alias: xcuitestBuildDir. Optional. Use when enablePrepare = true && framework = xcuitest. Build directory. 
    #xcUITestIpaFile: # string. Alias: xcuitestTestIpaPath. Optional. Use when enablePrepare = true && framework = xcuitest. Test IPA path. 
    #prepareOptions: # string. Alias: prepareOpts. Optional. Use when enablePrepare = true. Additional options. 
  # Run Tests
    #runTests: true # boolean. Alias: enableRun. Run tests. Default: true.
    credentialsOption: 'serviceEndpoint' # 'serviceEndpoint' | 'inputs'. Alias: credsType. Required when enableRun = true. Authentication method. Default: serviceEndpoint.
    #serverEndpoint: # string. Required when enableRun = true && credsType = serviceEndpoint. App Center service connection. 
    #username: # string. Required when enableRun = true && credsType = inputs. App Center username. 
    #password: # string. Required when enableRun = true && credsType = inputs. App Center password. 
    appSlug: # string. Required when enableRun = true. App slug. 
    devices: # string. Required when enableRun = true. Devices. 
    #series: 'master' # string. Optional. Use when enableRun = true. Test series. Default: master.
    #dsymDirectory: # string. Alias: dsymDir. Optional. Use when enableRun = 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 enableRun = true. System language. Default: en_US.
    #userDefinedLocale: # string. Optional. Use when enableRun = true && locale = user. Other locale. 
    #loginOptions: # string. Alias: loginOpts. Optional. Use when enableRun = true && credsType = inputs. Additional options for login. 
    #runOptions: # string. Alias: runOpts. Optional. Use when enableRun = true. Additional options for run. 
    #skipWaitingForResults: false # boolean. Alias: async. Optional. Use when enableRun = 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.
# 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 enablePrepare = true. Test framework. Default: appium.
    #appiumBuildDirectory: # string. Alias: appiumBuildDir. Required when enablePrepare = true && framework = appium. Build directory. 
    #espressoBuildDirectory: # string. Alias: espressoBuildDir. Optional. Use when enablePrepare = true && framework = espresso. Build directory. 
    #espressoTestApkFile: # string. Alias: espressoTestApkPath. Optional. Use when enablePrepare = true && framework = espresso. Test APK path. 
    #calabashProjectDirectory: # string. Alias: calabashProjectDir. Required when enablePrepare = true && framework = calabash. Project directory. 
    #calabashConfigFile: # string. Optional. Use when enablePrepare = true && framework = calabash. Cucumber config file. 
    #calabashProfile: # string. Optional. Use when enablePrepare = true && framework = calabash. Profile to run. 
    #calabashSkipConfigCheck: false # boolean. Optional. Use when enablePrepare = true && framework = calabash. Skip Configuration Check. Default: false.
    #uiTestBuildDirectory: # string. Alias: uitestBuildDir. Required when enablePrepare = true && framework = uitest. Build directory. 
    #uitestStoreFile: # string. Optional. Use when enablePrepare = true && framework = uitest. Store file. 
    #uiTestStorePassword: # string. Alias: uitestStorePass. Optional. Use when enablePrepare = true && framework = uitest. Store password. 
    #uitestKeyAlias: # string. Optional. Use when enablePrepare = true && framework = uitest. Key alias. 
    #uiTestKeyPassword: # string. Alias: uitestKeyPass. Optional. Use when enablePrepare = true && framework = uitest. Key password. 
    #uiTestToolsDirectory: # string. Alias: uitestToolsDir. Optional. Use when enablePrepare = true && framework = uitest. Test tools directory. 
    #signInfo: # string. Optional. Use when framework = calabash || framework = uitest. Signing information. 
    #xcUITestBuildDirectory: # string. Alias: xcuitestBuildDir. Optional. Use when enablePrepare = true && framework = xcuitest. Build directory. 
    #xcUITestIpaFile: # string. Alias: xcuitestTestIpaPath. Optional. Use when enablePrepare = true && framework = xcuitest. Test IPA path. 
    #prepareOptions: # string. Alias: prepareOpts. Optional. Use when enablePrepare = true. Additional options. 
  # Run Tests
    #runTests: true # boolean. Alias: enableRun. Run tests. Default: true.
    credentialsOption: 'serviceEndpoint' # 'serviceEndpoint' | 'inputs'. Alias: credsType. Required when enableRun = true. Authentication method. Default: serviceEndpoint.
    #serverEndpoint: # string. Required when enableRun = true && credsType = serviceEndpoint. App Center service connection. 
    #username: # string. Required when enableRun = true && credsType = inputs. App Center username. 
    #password: # string. Required when enableRun = true && credsType = inputs. App Center password. 
    appSlug: # string. Required when enableRun = true. App slug. 
    devices: # string. Required when enableRun = true. Devices. 
    #series: 'master' # string. Optional. Use when enableRun = true. Test series. Default: master.
    #dsymDirectory: # string. Alias: dsymDir. Optional. Use when enableRun = 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 enableRun = true. System language. Default: en_US.
    #userDefinedLocale: # string. Optional. Use when enableRun = true && locale = user. Other locale. 
    #loginOptions: # string. Alias: loginOpts. Optional. Use when enableRun = true && credsType = inputs. Additional options for login. 
    #runOptions: # string. Alias: runOpts. Optional. Use when enableRun = true. Additional options for run. 
    #skipWaitingForResults: false # boolean. Alias: async. Optional. Use when enableRun = 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 - 二進位應用程式文件路徑
輸入別名: appstring. 必要。

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


artifactsDirectory - Artifacts 目錄
輸入別名: artifactsDirstring. 必要。 預設值:$(Build.ArtifactStagingDirectory)/AppCenterTest

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


prepareTests - 準備測試
輸入別名: enablePrepareboolean. 預設值:true

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


frameworkOption - 測試架構
輸入別名: frameworkstring. 當 enablePrepare = true 時為必要。 允許的值:appium、、、calabashespresso (uitest Xamarin UI 測試) 、 xcuitest。 預設值:appium


appiumBuildDirectory - 組建目錄
輸入別名: appiumBuildDirstring. 當 enablePrepare = true && framework = appium 時為必要。

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


espressoBuildDirectory - 組建目錄
輸入別名: espressoBuildDirstring. 選擇性。 使用 時 enablePrepare = true && framework = espresso

要輸出目錄的路徑。


espressoTestApkFile - 測試 APK 路徑
輸入別名: espressoTestApkPathstring. 選擇性。 使用 時 enablePrepare = true && framework = espresso

APK 檔案的路徑與一般測試。 如果未設定, build-dir 則會用來探索它。 允許通配符。


calabashProjectDirectory - 項目目錄
輸入別名: calabashProjectDirstring. 當 enablePrepare = true && framework = calabash 時為必要。

此路徑為一個「檔案」工作區目錄。


calabashConfigFile - Cucumber 組態檔
string. 選擇性。 使用 時 enablePrepare = true && framework = calabash

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


calabashProfile - 要執行的配置檔
string. 選擇性。 使用 時 enablePrepare = true && framework = calabash

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


calabashSkipConfigCheck - 略過設定檢查
boolean. 選擇性。 使用 時 enablePrepare = true && framework = calabash。 預設值:false

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


uiTestBuildDirectory - 組建目錄
輸入別名: uitestBuildDirstring. 當 enablePrepare = true && framework = uitest 時為必要。

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


uitestStorePath - 存放區檔案
string. 選擇性。 使用 時 enablePrepare = true && framework = uitest

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


uiTestStorePassword - 儲存密碼
輸入別名: uitestStorePassstring. 選擇性。 使用 時 enablePrepare = true && framework = uitest

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


uitestKeyAlias - 索引鍵別名
string. 選擇性。 使用 時 enablePrepare = true && framework = uitest

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


uiTestKeyPassword - 金鑰密碼
輸入別名: uitestKeyPassstring. 選擇性。 使用 時 enablePrepare = true && framework = uitest

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


uiTestToolsDirectory - 測試工具目錄
輸入別名: uitestToolsDirstring. 選擇性。 使用 時 enablePrepare = true && framework = uitest

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


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

簽署測試伺服器。


xcUITestBuildDirectory - 組建目錄
輸入別名: xcuitestBuildDirstring. 選擇性。 使用 時 enablePrepare = true && framework = xcuitest

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


xcUITestIpaFile - 測試 IPA 路徑
輸入別名: xcuitestTestIpaPathstring. 選擇性。 使用時機 enablePrepare = true && framework = xcuitest

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


prepareOptions - 其他選項
輸入別名: prepareOptsstring. 選擇性。 使用時機 enablePrepare = true

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


runTests - 執行測試
輸入別名: enableRunboolean. 預設值:true

執行測試。


credentialsOption - 驗證方法
輸入別名: credsTypestring. 當 enableRun = true 時為必要。 允許的值: serviceEndpoint (App Center 服務連線) , inputs (認證) 。 預設值:serviceEndpoint

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


serverEndpoint - App Center 服務連線
string. 當 enableRun = true && credsType = serviceEndpoint 時為必要。

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


username - App Center 用戶名稱
string. 當 enableRun = true && credsType = inputs 時為必要。

造訪 App Center 登入頁面來建立您的用戶名稱,並提供這裡的值。


password - App Center 密碼
string. 當 enableRun = true && credsType = inputs 時為必要。

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


appSlug - 應用程式 slug
string. 當 enableRun = true 時為必要。

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


devices - 設備
string. 當 enableRun = true 時為必要。

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


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

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


dsymDirectory - dSYM 目錄
輸入別名: dsymDirstring. 選擇性。 使用時機 enableRun = true

iOS 符號檔的路徑。


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

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


userDefinedLocale - 其他地區設定
string. 選擇性。 使用時機 enableRun = true && locale = user

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


loginOptions - 登入的其他選項
輸入別名: loginOptsstring. 選擇性。 使用時機 enableRun = true && credsType = inputs

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


runOptions - 執行的其他選項
輸入別名: runOptsstring. 選擇性。 使用時機 enableRun = true

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


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

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


cliFile - App Center CLI 位置
輸入別名: cliLocationOverridestring.

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


showDebugOutput - 啟用偵錯輸出
輸入別名: debugboolean. 預設值:false

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


uitestStoreFile - 儲存盤案
string. 選擇性。 使用時機 enablePrepare = true && framework = uitest


工作控制選項

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

輸出變數

無。

備註

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

範例

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

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
要求
Capabilities 此工作不符合作業中後續工作的任何需求。
命令限制 任何
Settable 變數 任何
代理程式版本 2.206.1 或更新版本
工作類別 測試
需求 描述
管線類型 YAML,傳統組建
執行於 Agent、DeploymentGroup
要求
Capabilities 此工作不符合作業中後續工作的任何需求。
命令限制 任何
Settable 變數 任何
代理程式版本 2.144.0 或更新版本
工作類別 測試
需求 描述
管線類型 YAML,傳統組建
執行於 Agent、DeploymentGroup
要求
Capabilities 此工作不符合作業中後續工作的任何需求。
命令限制 任何
Settable 變數 任何
代理程式版本 所有支援的代理程式版本。
工作類別 測試