我在 YAML 管道中使用任务“Newman the cli Companion for Postman”(链接)来运行 Postman 集合以进行测试和预热。
我使用如下任务:
- task: carlowahlstedt.NewmanPostman.NewmanPostman.NewmanPostman@4
displayName: 'Newman - Postman'
inputs:
collectionFileSource: '$(Pipeline.Workspace)/drop/Postman'
Contents: '**\*_collection.json'
folder: Release
environment: '$(Pipeline.Workspace)/drop/Postman/$(Environment).postman_environment.json'
ignoreRedirect: false
bail: false
sslInsecure: false
reporters: 'html,junit'
reporterHtmlExport: '$(Pipeline.Workspace)/drop/Postman'
htmlExtraDarkTheme: false
htmlExtraLogs: false
htmlExtraTestPaging: false
reporterJUnitExport: '$(Pipeline.Workspace)/drop/Postman'
在托管代理上这样做可以正常工作,但是在使用自托管代理时,我得到:
##[error]Unable to locate executable file: 'newman'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.
我在代理上安装了 newman 和 newman-reporter-html,并且能够在登录代理时运行它。
我该如何解决这个问题?