Cypress-Cucumber 缺少步骤实现

Cypress-Cucumber getting Step implementation missing for

我正在尝试将 Cucumber 实现到模块化 angular 项目中,但不知道如何实现。 我有几个模块和 e2e 文件夹来测试它们让我们称它们为工具

但我无法将 Cucumber 配置为使用他们 GitHub 中的简单 google 示例。 一些 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));
};

and Google.feature and google.ts 来自 github demo (Given, Then)

现在根据 "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 为假时

Step implementation missing for: I open Google page

没有黄瓜的柏树效果很好。感谢您的帮助。

看在上帝的份上,我需要将 src 文件夹重命名为 cypress