cypress - 如何在柏树中登录文件?

标签 cypress

我想记录流程的每一步,例如:完成注册、打开用户仪表板、编辑用户配置文件。这怎么能通过 Cypress 来实现。我尝试使用 node.js 进行此操作,但是当 cypress 在浏览器中运行时,我无法使用 node.js 创建文件,而且我尝试使用 cy.writefile 替换我在文件中写入的先前文件。有没有办法做到这一点 ??? 在此之后,我确实想将此日志发送到电子邮件。

最佳答案

欢迎来到 Stack Overflow。如果你在像 CircleCI 这样的 CI 服务器上运行 Cypress,它可以记录你的输出。

还有一个--record 选项,它可以为您保存 session 的详细信息。

Cypress can record your tests running and make them available in our Dashboard.

Recorded tests allow you to: See the number of failed, pending and passing tests. Get the entire stack trace of failed tests. View screenshots taken when tests fail and when using cy.screenshot(). Watch a video of your entire test run or a clip at the point of test failure.

您可以在此处阅读有关录制 session 的更多信息 https://docs.cypress.io/guides/guides/continuous-integration.html#Recording-tests-in-CI

关于cypress - 如何在柏树中登录文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52809797/

相关文章:

javascript - 如何在 Cypress 中测试 Slate JS 行为

javascript - cypress.json 文件未被识别

javascript - 在 Cypress 如何根据名称选择输入元素?

javascript - 如何使用 Cypress 在编辑器中选择文本

javascript - 用于在 cypress 中选择复选框的自定义命令

javascript - 尝试让 Cypress、TypeScript 和 IstanbulJS 协同工作

javascript - Cypress jS 设置隐藏输入值

javascript - Cypress - 将其安装在空项目上

testing - Cypress XHR stub 忽略使用 fetch 执行的 ajax 请求

azure - 在 CI 中 headless 运行时输出 cypress 浏览器日志消息