[在此处输入图片描述] [1] Cypress在Jenkins中成功使用。从几周开始,Cypress规格文件将永久挂起。它将挂在不同的规格文件中。这使得调试失败的原因变得困难。有时它将成功运行所有规格文件。请帮帮我。
package.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"
}
}
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"
}
```````````````````````````````````````````````````
[`enter image description here`][2]
[1]: https://i.stack.imgur.com/kzwcx.png
[2]: https://i.stack.imgur.com/bwHeb.png
答案 0 :(得分:0)
在firefox和chrome上运行测试时,我遇到了类似的问题。这也是随机的。我发现以无头模式运行它们会更好,并且您将不会遇到此类问题。
例如,以下命令间歇性挂起
npx cypress run --browser chrome
但是
npx cypress run --browser chrome --headless
工作正常