Running 'casperjs test' in phantom

后端 未结 2 646
北荒
北荒 2020-12-19 19:25

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         


        
相关标签:
2条回答
  • 2020-12-19 20:04

    you can also call casperjs test xyz.js

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

    0 讨论(0)
  • 2020-12-19 20:06

    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
    
    0 讨论(0)
提交回复
热议问题