简体   繁体   English

如果我使用 cypress-cucumber,是否必须为每个特征文件创建 Step definition 文件夹?

[英]Do I have to create Step definition folder for each feature file if I am using cypress-cucumber?

If I have two scenarios like test.feature, test1.feature, Do I have to create folder for both feature files and include the step definition file in those folders?如果我有两个场景,如 test.feature、test1.feature,我是否必须为这两个功能文件创建文件夹并在这些文件夹中包含步骤定义文件?

Can't I include all the step definitions in one folder for all the feature files?我不能在一个文件夹中包含所有功能文件的所有步骤定义吗?

Yes you can.是的你可以。

  • cypress-cucumber-preprocessor library uses the concept of common and local steps. cypress-cucumber-preprocessor 库使用公共步骤和本地步骤的概念。 If you want to write duplicate steps for different feature files where their functionality can be different then you should use local steps.如果您想为不同的功能文件编写重复的步骤,其中它们的功能可能不同,那么您应该使用本地步骤。 To create local steps you need to create a folder with the name feature file.要创建本地步骤,您需要创建一个名为特征文件的文件夹。 However, this may lead to refactoring and moving the steps to global space(common) when the project will grow.但是,当项目增长时,这可能会导致重构并将步骤移动到全局空间(通用)。
  • Cytorus : This is another cypress+cucumber framework where steps are only global scope Cytorus :这是另一个 cypress+cucumber 框架,其中步骤只是全局范围

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何创建一个通用步骤定义文件夹以供 cypress/cucumber 中的 all.feature 文件使用? - How can I create a common steps definition folder to be used by all .feature files in cypress/cucumber? 如何为cucumber-js中的每个特征文件指定步骤定义文件? - How can I specify step definition file for each feature file in cucumber-js? cypress cucumber - 如何识别调用步骤定义的功能文件? - cypress cucumber - How to identify the which feature file calling step definition? 我使用 Cypress/Cucumber 不断收到 Step definiton 错误 - I keep getting a Step definiton error using Cypress/Cucumber 如何使用 WebStorm 在 TypeScript 而不是 JavaScript 中创建 Cucumber 步骤定义文件? - How can I use WebStorm to create a Cucumber step definition file in TypeScript instead of JavaScript? 如何在 Cypress 中编写场景大纲特征的步骤定义文件 - How to write step definition file of scenario outline feature in Cypress 错误:步骤实现缺少:[step_definition] with cypress & Cucumber 使用示例场景大纲时 - Error: Step implementation missing for: [step_definition] with cypress & Cucumber when using Scenario outline with example 当我使用的TypeScript定义文件缺少单个定义时,我该怎么办? - What do I do when a TypeScript definition file I am using is missing a single definition? 如何将功能文件与cucumber.js中的步骤定义相关联(黄瓜为javascript) - How to link feature file with step definition in cucumber.js (cucumber for javascript) 如何使用 WDIO 在 visual studio 中从 BDD 特征文件创建步骤定义 - How to create Step definition from BDD feature file in visual studio using WDIO
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM