我试图实现黄瓜到模块化的角度项目,但不知道如何实现。我有几个模块和e2e文件夹来测试它们--让我们称之为工具

但是我不能配置黄瓜来使用他们的GitHub中的简单谷歌示例。一些cypress.json
{
"reporter": "junit",
"baseUrl": "https://localhost/",
"reporterOptions": {
"mochaFile": "../../test-results/tool3/reports/[hash].xml",
"testsuitesTitle": "tool3",
"useFullSuiteTitle": false
},
"fileServerFolder": "./",
"testFiles": "**/*.{feature,features}",
"fixturesFolder": "./src/fixtures",
"integrationFolder": "./src/integration",
"pluginsFile": "./src/plugins/index.js",
"supportFile": "./src/support/index.ts",
"chromeWebSecurity": false,
"viewportHeight": 799,
"viewportWidth": 1199,
"retries": {
"runMode": 1,
"openMode": 0
},
"responseTimeout": 90000,
"env": {
"ServerAddress": "localhost"
}
}添加到package.json中的e2e文件夹
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true
}plugins/index.js
const browserify = require('@cypress/browserify-preprocessor');
const cucumber = require('cypress-cucumber-preprocessor').default;
const resolve = require('resolve');
module.exports = (on, config) => {
const options = {
...browserify.defaultOptions,
typescript: resolve.sync('typescript', { baseDir: config.projectRoot }),
};
on('file:preprocessor', cucumber(options));
};Google.feature和google.ts来自github演示(然后给出)
现在,取决于"nonGlobalStepDefinitions"配置,我得到了错误。
当真- Error: We've tried to resolve your step definitions at cypress\integration, but that doesn't seem to exist. As of version 2.0.0 it's required to set step_definitions in your cypress-cucumber-preprocessor configuration. Look for nonGlobalStepDefinitions and add stepDefinitions right next to it. It should match your cypress configuration has set for integrationFolder. We no longer rely on getting information from that file as it was unreliable and problematic across Linux/MacOS/Windows especially since the config file could have been passed as an argument to cypress.
当stepDefinition为false时
Step implementation missing for: I open Google page没有黄瓜的柏树效果很好。谢谢你的帮助。
发布于 2021-12-13 13:17:09
我需要把src文件夹重命名为柏树,看在上帝的份上
https://stackoverflow.com/questions/70335085
复制相似问题