实施实验性和甲糖素后,所有规格消失在柏树中

发布于 2025-02-10 10:49:44 字数 349 浏览 1 评论 0原文

我是柏树的新手。我有一个障碍,似乎无法继续进行。我有一些规格,但是我很难在每次测试之前保留饼干,而不会清除它们。我已经阅读了有关cy.session()的信息,这都是令人困惑的大声笑,但似乎为了让我使用cy.session(),我首先必须实现此脚本: 

 e2e: { experimentalSessionAndOrigin: true, },

但是,一旦我将其添加到cypress.config.js,一个新文件E2e.js是在支持文件夹中创建的,当我启动Cypress时,它将其视为一个新项目,现有的规格都不是出现。我在做什么错?

I'm very new to Cypress. I am having a roadblock and don't seem to be able to proceed. I have a few specs written but I'm having trouble having Cypress retain the cookies and not clear them before each test. I've read about cy.session(), it's all pretty confusing lol but it seems that, in order for me to use cy.session(), I first have to implement this script: 

 e2e: { experimentalSessionAndOrigin: true, },

But, as soon, as I add that to cypress.config.js, a new file, e2e.js, is created in support folder and, when I launch Cypress, it treats it as a new project, none of the existing specs are showing up. What am I doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一场信仰旅途 2025-02-17 10:49:44

如果您从柏树V9升级到V10,可能会发生这种情况。有一个向导可以为您提供一些简化迁移的东西。

无论如何,默认柏树10

  • 规格中的设置应在/cypress/e2e/文件夹
  • 规格中,应具有扩展名.cy.js

this effig config docs的使用V9设置的示例

const { defineConfig } = require('cypress')

module.exports = defineConfig({
  e2e: {
    // revert to v9 configuration pattern
    specPattern: 'cypress/integration/**/*.spec.{js,jsx,ts,tsx}' 
  }
})

It may happen if you upgrade from Cypress v9 to v10. There's a wizard that creates a few things for you to ease the migration.

In any case, with default settings in Cypress 10

  • specs should be in the /cypress/e2e/ folder
  • specs should have the extension .cy.js

This section of the config docs shows how you can modify the pattern, for example to use v9 settings

const { defineConfig } = require('cypress')

module.exports = defineConfig({
  e2e: {
    // revert to v9 configuration pattern
    specPattern: 'cypress/integration/**/*.spec.{js,jsx,ts,tsx}' 
  }
})
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文