简体   繁体   English

为什么即使我使用 chrome 浏览器,赛普拉斯在 GUI(柏树打开)中的测试通过但在命令行(柏树运行)中失败?

[英]Why does Cypress test in GUI(cypress open) pass but fails in command line(cypress run) even though I using chrome browser?

I'm writing a test for 4 endpoints and I can see it's successfully completed when trying with cypress open command.我正在为 4 个端点编写测试,并且在尝试使用 cypress open 命令时可以看到它已成功完成。 However, If I try to run cypress run command, I see a timeout issue.但是,如果我尝试运行 cypress run 命令,我会看到超时问题。 Is there any difference between these 2 commands?这两个命令有什么区别吗?

Try running below commands:尝试运行以下命令:

cypress run -C <path to your config  file>

and

cypress open -C <path to your config  file>

In the config mention the browser else it will run in electron browser在配置中提及浏览器,否则它将在 electron 浏览器中运行

See in your report if the test are run in same browser else pass --browser explicitly for both the commands如果测试在同一个浏览器中运行,请在报告中查看,否则为这两个命令显式传递 --browser

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从命令行运行赛普拉斯测试得到=&gt; CypressError:赛普拉斯测试在运行此命令时停止 - run cypress tests from command line getting => CypressError: Cypress test was stopped while running this command 赛普拉斯模糊事件(当输入失去焦点时)不会由无头“cypress run --browser firefox”触发,而是与“cypress open”一起使用 - Cypress blur events (when input loses focus) are not triggered with headless "cypress run --browser firefox" but work with "cypress open" 通过赛普拉斯在命令行中传递自定义API密钥 - Pass custom API key in command line with Cypress cypress:将数组作为命令行参数传递 - cypress: pass array as command line argument 赛普拉斯在条件下运行测试 - Cypress run test on condition 我可以使用新的镀铬来运行柏树吗? - Can I run cypress with new chrome? Cypress hoverover GUI效果测试 - Cypress hoverover GUI effect test 如何在 cypress 中自定义 chrome 浏览器? - How to customize chrome browser in cypress? 赛普拉斯断言失败但测试通过 - Cypress assertion fails but test passes 从命令行运行时,赛普拉斯测试失败,但如果从赛普拉斯测试运行器运行,则通过 - Cypress test get failed while running from command line, but passing if running from cypress test runner
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM