testing - 黄瓜标签链接
问题描述
我在考虑链接标签
来自https://cucumber.io/docs/cucumber/api/的基本示例
@billing
Feature: Verify billing
@important
Scenario: Missing product description
Given hello
Scenario: Several products
Given hello
我想做的是
@billing
Feature: Verify billing
@important
Scenario: Missing product description
Given hello
Scenario: Several products
Given hello please run @important tag
@important 的所有步骤都会执行,这可能吗?我在谷歌没有找到任何例子:(如果是的话你能帮我找一些材料吗?
堆栈:带有cypress-cucumber-preprocessor 的JS https://github.com/TheBrainFamily/cypress-cucumber-preprocessor 我还查看了所有示例,没有看到类似的东西
谢谢您的帮助 :)
解决方案
听起来您是在说您希望能够在另一个场景中重用现有场景中的步骤,对吗?
我不会尝试在 Gherkin 级别组织重用(这不是一种编程语言,而是一种规范语言),而是在您的步骤定义中的代码中降低级别。
帮助您组织步骤定义代码的一个非常好的模式是剧本模式,它允许您创建可重用的自动化代码的可组合“块”。
这是我写的关于该模式的博客文章:https ://cucumber.io/blog/bdd/understanding-screenplay-(part-1)/
推荐阅读
- java - com.networknt json-schema-validator 不检查 json 中的未知关键字
- flask - HEROKU FLASK“没有 Web 进程正在运行”错误
- c++ - 如何通过指针传递 lambda 函数?
- java - 查询具有@ManyToMany 关系的表(休眠)
- powershell - Powershell 7 - 并行 While 循环
- python - Wine 数据集 LDA 和 PCA 比较 - Python
- kubernetes - Kubernetes pod 定义文件问题
- java - Spring-Boot:依赖注入取决于配置(和使用接口)
- javascript - 传递给 getElementByID() 的空字符串
- c# - 如何检查证书是否在 .NET 中自签名