gpt4 book ai didi

testing - 在 TestCafe 中使用标签(Smoke、regression)

转载 作者:行者123 更新时间:2023-11-28 19:58:54 24 4
gpt4 key购买 nike

使用 testcafe grep 模式可以部分解决我们使用标签的问题,但它仍然会在规范报告中显示这些标签...!!!

有没有办法在测试/夹具名称中包含标签并使用 grep 模式但跳过这些标签以显示在执行报告中??

import { Selector } from 'testcafe';

fixture `Getting Started`
.page `http://devexpress.github.io/testcafe/example`;

test('My first test --tags {smoke, regression}', async t => {
// Test code
});

test('My Second test --tags {smoke}', async t => {
// Test code
});

test('My first test --tags {regression}', async t => {
// Test code
});

testcafe chrome test.js -F "smoke"

虽然上面的代码片段会为我触发仅冒烟的测试,但报告会显示测试名称以及这些标签

是否有其他方法来处理标签或不在测试执行报告中显示标签的解决方案?

最佳答案

它出现在最近发布的 testcafe (v0.23.1) 中,您现在可以通过命令行使用元数据进行过滤。

您现在可以只运行那些元数据包含一组特定值的测试或装置。使用 --test-meta 和 --fixture-meta 标志来指定这些值。

testcafe chrome my-tests --test-meta device=mobile,env=production

testcafe chrome my-tests --fixture-meta subsystem=payments,type=regression

阅读更多信息 https://devexpress.github.io/testcafe/blog/testcafe-v0-23-1-released.html

关于testing - 在 TestCafe 中使用标签(Smoke、regression),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52962133/

24 4 0