Running 'casperjs test' in phantom
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: So I have a file running in node which runs a local copy of PhantomJS as below shows: 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 }); Without the casper.test.begin() my tests function fine. I have the correct version 1.1.0 which can use this test suite but I get the following error in my console: CasperError: casper.test