Running 'casperjs test' in phantom

扶醉桌前 提交于 2019-11-29 12:09:09
PhilippeThomas

CasperError: casper.test property is only available using the casperjs test command

problem solved.

You have to include this line at the top of your script in your xyz.js, so that the .test property becomes true;

phantom.casperTest = true;

Then you should have no problem Launching from the terminal:

casperjs xyz.js

you can also call casperjs test xyz.js

For more info, check the doco here : http://docs.casperjs.org/en/latest/testing.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!