Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Automated tests 是否可以使用TestCafe.meta对象跳过从cli运行的测试_Automated Tests_Metadata_E2e Testing_Web Testing_Testcafe - Fatal编程技术网

Automated tests 是否可以使用TestCafe.meta对象跳过从cli运行的测试

Automated tests 是否可以使用TestCafe.meta对象跳过从cli运行的测试,automated-tests,metadata,e2e-testing,web-testing,testcafe,Automated Tests,Metadata,E2e Testing,Web Testing,Testcafe,我正在使用TestCafe运行集成测试。我知道它有test.skip功能,当我在本地进行测试并且想跳过一组我不需要/不想运行的测试时,它非常有用。。。但是我想知道是否有一种方法可以运行所有的测试,除了--test meta-environment-specific=true等等 我们有许多不同的环境,我正在寻找一种通过CLI跳过测试的简单方法,具体取决于我们针对构建的环境。是的,您可以使用编程方式运行TestCafe。 请参见一个示例: const createTestCafe=require(

我正在使用TestCafe运行集成测试。我知道它有
test.skip
功能,当我在本地进行测试并且想跳过一组我不需要/不想运行的测试时,它非常有用。。。但是我想知道是否有一种方法可以运行所有的测试,除了
--test meta-environment-specific=true
等等


我们有许多不同的环境,我正在寻找一种通过CLI跳过测试的简单方法,具体取决于我们针对构建的环境。

是的,您可以使用编程方式运行TestCafe。 请参见一个示例:

const createTestCafe=require('testcafe');
设testcafe=null;
createTestCafe('localhost',13371338)
。然后(tc=>{
testcafe=tc;
const runner=testcafe.createRunner();
回程转轮
.src(“/tests”)
.filter((testName、fixtureName、fixturePath、testMeta、fixtureMeta)=>{
return!testMeta.environmentSpecific;
})
.browsers(['chrome','safari']))
.run();
})
。然后(failedCount=>{
log('测试失败:'+失败计数);
testcafe.close();
});
另见: