我在这个网站上看到过其他类似的问题,但没有一个对我来说有令人满意的解决方案。我没有任何 webpack.config.js 文件,因为我们从 Angular 获取默认配置。请参阅下面相应的图片,以便更好地了解我的问题。
我的项目中的其他配置:
包.json
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true,
"json": {
"enabled": true
},
"stepDefinitions": "**/cypress/e2e/**/*.js",
"step_definitions": "**/cypress/e2e/**/*.js"
},
Run Code Online (Sandbox Code Playgroud)
赛普拉斯.config.ts
import { defineConfig } from 'cypress'
export default defineConfig({
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
},
specPattern: '**/e2e/**/*.feature',
"supportFile": false,
chromeWebSecurity: false
},
})
Run Code Online (Sandbox Code Playgroud)
更新 1: 您好@Wirtuald,感谢您回复我。我开始在一个相当复杂的角度项目中遇到这个问题。因此,我从头开始创建了一个基本项目,但仍然遇到同样的问题。接下来,我向大家介绍一下这个新项目的全部信息:
我没有“插件”文件夹
package.json 上的版本:
"devDependencies": {
"@badeball/cypress-cucumber-preprocessor": "^11.2.0", …Run Code Online (Sandbox Code Playgroud)cucumber webpack angular cypress cypress-cucumber-preprocessor