【发布时间】:2013-11-08 10:47:46
【问题描述】:
所以我有一个在节点中运行的文件,它运行 PhantomJS 的本地副本,如下所示:
phantom.casperPath = 'node_modules/casperjs';
phantom.injectJs('node_modules/casperjs/bin/bootstrap.js');
var casper = require('casper').create({
viewportSize: config.viewportSize
});
casper.test.begin('Runing tests here', 5, function suite(test) {
// Tests here
});
没有casper.test.begin() 我的测试功能正常。我有正确的版本 1.1.0 可以使用这个测试套件,但我在控制台中收到以下错误:
CasperError: casper.test property is only available using the `casperjs test` command
CasperJS 文档也提到了这一点:http://docs.casperjs.org/en/latest/testing.html。我的问题是如何在上面代码中的这个命令下运行这个 Casper 以便我可以使用这些测试?
谢谢!
【问题讨论】:
标签: node.js phantomjs casperjs