赛普拉斯有时会挂在詹金斯身上

acc*_*chu 6 jenkins cypress

赛普拉斯在 Jenkins 中成功使用。从几周 Cypress 规范文件开始,它将永远挂起。它将挂在不同的规范文件中,这使得调试和查找失败的原因变得困难。有时它会成功运行所有规范文件。请帮帮我。


包.json

{
  "name": "budgeting-web-automation-cypress",
  "version": "0.0.0",
  "scripts": {
    "e2e": "cypress open",
    "cy:run": "node scripts/cypress.js",
    "cy": "cypress run --headed"
  },
  "private": true,
  "devDependencies": {
    "cypress": "^3.1.4",
    "mocha": "5.2.0",
    "mochawesome": "^3.1.1",
    "mochawesome-merge": "^1.0.5",
    "mochawesome-report-generator": "^3.1.5"
  }
}

Run Code Online (Sandbox Code Playgroud)

cypress.json

{
  "baseUrl": "https://stg.Url.of.the.project",
  "viewportWidth": 1280,
  "viewportHeight": 720,
  "chromeWebSecurity": false,
  "pageLoadTimeout":300000,
  "numTestsKeptInMemory": 0,
  "video":false,
  "defaultCommandTimeout": 20000,
  "reporter": "mochawesome",
  "reporterOptions": {
    "reportDir": "mochawesome-report",
    "overwrite": false,
    "html": false,
    "json": true
  },
  "testFiles":  "**/*.spec.js"
}
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

pyt*_*hon 0

我在 Firefox 和 Chrome 上运行测试时遇到了类似的问题。这也是随机的。我发现以无头模式运行它们要好得多,并且您不会遇到此类问题。

例如,以下命令间歇性挂起

npx cypress run --browser chrome

npx cypress run --browser chrome --headless工作正常