我尝试在我的Node.js上安装TestCafe的最新版本。我试过了:
let testcafe = null;
createTestCafe('localhost', 1337, 1338, void 0, true)
.then(tc => {
testcafe = tc;
.......
})
.then(() => {
return runner
.src([__basedir + '/tests/temp.js'])
.browsers(myBrowser)
.screenshots(screnshotpath, true)
.reporter('allure')
.run()
.then(failedCount => {
console.log( "Testcafe Version" + testcafe.version);
testcafe.close();
.......但这是未定义的。有没有其他可能的方法?
发布于 2020-02-14 17:39:39
在以编程方式使用时,Testcafe似乎没有像使用cli时那样通过-v选项获取版本的选项。
我能想到的最简单的方法是导入package.json
const { version } = require('testcafe/package.json');
console.log("Testcafe Version " + version);https://stackoverflow.com/questions/60211630
复制相似问题