我已经在各自的microsoft Github存储库中posted issues,但是鉴于他们将我重定向到Stackoverflow,我将在此处重新发布问题。
我的问题是:如何从Azure DevOps在microsoft AppCenter中运行自动化XCUITests?
我研究了documentation,了解如何从控制台手动构建应用程序,然后将其上传到AppCenter(有效)。现在,我想使用官方的Azure App Center Test task,它应该做类似的事情。不幸的是,这两个文档有很大的不同,我不知道要使该步骤起作用我必须提供什么信息。
我注意到的最大区别是,AppCenter文档使用“测试构建”和DerivedData目录,在其中构建要上传的内容,而AppCenterTest任务则请求IPA,构建目录和Test IPA路径。如何获得这些工件?
我尝试过这样的事情:
- task: Xcode@5
inputs:
actions: 'clean build test'
configuration: 'Debug'
sdk: 'iphoneos'
xcWorkspacePath: 'MyProject/MyProject.xcworkspace'
scheme: 'MyProject'
packageApp: true
exportPath: '$(build.artifactStagingDirectory)/debug'
signingOption: 'manual'
signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'
destinationPlatformOption: 'iOS'
destinationSimulators: 'iPhone 11'
publishJUnitResults: true
- task: Xcode@5
inputs:
actions: 'build-for-testing'
configuration: 'Debug'
sdk: 'iphoneos'
xcWorkspacePath: 'MyProject/MyProject.xcworkspace'
scheme: 'MyProject'
packageApp: false
args: '-derivedDataPath $(build.artifactStagingDirectory)/DerivedData'
- task: AppCenterTest@1
inputs:
appFile: '$(build.artifactStagingDirectory)/DerivedData/Build/Products/Debug-iphoneos/MyProject.app'
artifactsDirectory: '$(build.artifactStagingDirectory)/AppCenterTest'
frameworkOption: 'xcuitest'
xcUITestBuildDirectory: '$(ProjectDir)/Build/Products/Debug-iphoneos'
xcUITestIpaFile: '$(build.artifactStagingDirectory)/DerivedData/Build/Products/Debug-iphoneos/MyProjectUITests-Runner.app'
credentialsOption: 'serviceEndpoint'
serverEndpoint: 'MyCustomer AppCenter Deployment'
appSlug: 'MyCustomer/MyProject-iOS'
devices: 'iphoneDevices'
localeOption: 'en_US'
skipWaitingForResults: true
但是我收到类似于##[error]Error: Cannot find any file based on /Users/runner/runners/2.163.1/work/1/a/DerivedData/Build/Products/Debug-iphoneos/MyProject.app
任何人都有完整的可用示例,并可以提供示例YAML文件:
- 使用XCode构建具有至少一项UI测试的本地iOS应用
- 将应用程序上载到AppCenter并在真实设备上运行该UI测试