automated-tests - 黄瓜场景和testng测试用例XML 1-1映射
问题描述
我需要你的帮助,我想设计与 testng 进行 1-1 映射的 Cucumber 场景。
例如,如果有两个功能文件,一个在 Cucumber 中有 10 个测试场景,另一个有 2 个测试场景,那么我应该能够在 testng XML 中编写 12 个测试用例名称并能够执行它们并能够报告它们。
通过在 pom.xml 中传递参数,上述方法将使我能够在每次运行时仅执行少数场景。
目前我在 testng xml 文件中编写了下面的内容,该文件进一步启动了 cucumber-testng-runner,然后进一步调用了可能有 10 个场景的 StepDefinition 和功能文件。
<test thread-count="5" name="TC001">
<classes>
<class name="testRunner.TestRunnernew" />
</classes>
</test> <!-- TC001 -->
我不仅想在 testng xml 中编写 1 个测试用例,还想在我的 testng xml 中编写如上所示的 12 个测试用例,这样我就可以从 POM.xml 参数来仅执行少数场景
当我浏览互联网时,我发现有人已经为 Cucumber JVM 项目锁定了一个类似的问题
https://github.com/cucumber/cucumber-jvm/issues/1113
尽管问题现已关闭,但我无法找到问题的解决方案/实施。可能是因为我是 github 新手?
解决方案
推荐阅读
- javascript - Javascript: map an array of items and call function for data
- python - Python - 计算图像平均颜色的最快方法
- python - 如何在 Python 中设置整数的最大值
- javascript - 每次页面加载时动态创建的文本框数量都会增加
- python - 在 Windows 上使用 Python 将 SVG 转换为 PNG
- javascript - how to resolve this Error: Could not find matching close tag for "<%"
- python - 'break' is creating not properly in loop pylint(not-in-loop) error
- flutter - Flutter draw Opens without transition with list view builder
- javascript - 在动态添加到 DOM 之前和之后计算表单字段
- node.js - 如何使用条带代码(检索和删除)使用 Nodejs 从 Stripe 检索和取消订阅?