如何解决赛普拉斯无法验证您的服务器是否正在运行
我正在尝试在 azure 上设置 cypress,所以我创建了管道,当我使用 localhost:4200 时,管道运行成功,但是当我输入生产 url 时,我不断收到此错误: 赛普拉斯无法验证您的服务器是否正在运行。 服务器已经运行,所以这不是问题,test-server 只是示例名称。
azure.yml 文件
trigger:
- main
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: Nodetool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install
npm run cypress:verify
displayName: 'npm install and verify'
- task: Npm@1
continueOnError: true
inputs:
command: 'custom'
customCommand: 'run cy:env'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '*.xml'
searchFolder: '$(System.DefaultWorkingDirectory)/cypress/reports/junit'
mergeTestResults: true
testRunTitle: 'Publish Test Results'
- task: PublishBuildArtifacts@1
continueOnError: true
condition: succeededOrFailed()
inputs:
PathtoPublish: '$(System.DefaultWorkingDirectory)/cypress/screenshots'
ArtifactName: 'screenshots'
publishLocation: 'Container'
- task: PublishBuildArtifacts@1
continueOnError: true
condition: succeededOrFailed()
inputs:
PathtoPublish: '$(System.DefaultWorkingDirectory)/cypress/videos'
ArtifactName: 'videos'
publishLocation: 'Container'`
在我的package.json
"scripts": {
"ng": "ng","start": "ng serve","build": "ng build","test": "ng test","lint": "ng lint","e2e": "ng e2e","cypress:open": "start & cypress open","cypress:run": "cypress run","cypress:tags": "cypress run cypress-tags run","cypress:verify": "cypress verify","cy:env":"cypress run --env environment=http://test-server.com/aps/webapp-test/","test:smoke": "CYPRESS_baseUrl=http://test-server.com/aps/webapp-test cypress run","cy:e2e": "start-server-and-test start 'http-get://localhost:4200' cypress:record","cypress:record":"cypress run --record --key 480712ae-803b-4e64-a445-134139fb5b44 --parallel --ci-build-id $BUILD_BUILDNUMBER --group 'Azure CI'"
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。