我正在尝试将我的 Cypress configFile 转换为与 Cypress 10.0+ 一起使用
我已遵循新文档,但赛普拉斯声明我的文件无效。
“错误:找不到模块‘cypress’”
这是我尝试使用的配置...
const { defineConfig } = require('cypress')
module.exports = defineConfig({
e2e: {
specPattern: "tests/e2e/**/*.cy.js",
supportFile: "tests/support/e2e.js"
},
projectId: "zpk6q6",
reporter: "junit",
reporterOptions: {
mochaFile: "tests/test-output-[hash].xml",
toConsole: true,
attachments: true
}
})
希望 Cypress 社区的其他人可以帮助我。预先感谢!
我设法解决了这个问题。
在运行
npx cypress run...
之前,我需要实际安装 Cypress。所以我的命令看起来像
npm install cypress --save-dev
npx cypress run --browser chrome
试试这个:npm install cypress --save-dev --force