赛普拉斯无法验证您的服务器是否正在运行

问题描述

我正在尝试在 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 (将#修改为@)