Casperjs"casper.test属性只能使用`casperjs test`命令"但不能调用casper测试

max*_*o87 5 phantomjs casperjs

错误:

casper.test property is only available using the `casperjs test` command
Run Code Online (Sandbox Code Playgroud)

搜索了我的整个代码库"casper.test","this.test","@ test"等,但没有一个存在.查看casper代码,需要触发其中一个以引发此错误.

该错误是间歇性的,仅在某些casper运行时发生.有没有其他人得到这个错误?我跑1.1.0-beta3.

Arv*_*ind 10

你可以加

phantom.casperTest = true;
Run Code Online (Sandbox Code Playgroud)

在测试文件的顶部.


Epo*_*okK 4

你有这样启动你的脚本吗?

casperjs test yourScript.js