我们使用 TestNG 对测试用例进行分组。
@Test( groups = {"xyz", "test" })
@Test( groups = {"Testing" })
如果我们在 xml 配置中调用它,它将仅运行该组测试用例,铰孔将不会执行。通过在 XML 中调用它,如下所示。
<groups>
<run>
<include name="Testing"/>
</run>
.
像这样,Jasmine 框架中是否有任何可用的行为来对测试用例进行分组,而无需在单独的位置编写测试用例。
最佳答案
首先,JavaScript 中没有注释。
听起来你在问 suites
的概念在 Protractor 中:
suites: {
homepage: 'tests/e2e/homepage/**/*Spec.js',
search: [
'tests/e2e/contact_search/**/*Spec.js',
'tests/e2e/venue_search/**/*Spec.js'
]
},
它允许用户定义的测试集按逻辑分组,您可以单独运行:
protractor protractor.conf.js --suite homepage
还有一个 grep
选项,请参阅:
关于javascript - 我们使用 TestNG 在 Protractor 和 jasmine 中进行基于组的测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31702810/