【问题标题】:Unable to run test suite(multiple test scripts) in Casperjs无法在 Casperjs 中运行测试套件(多个测试脚本)
【发布时间】:2014-03-14 09:22:13
【问题描述】:

您好,我在 CasperJS 中运行多个测试 .js 时遇到问题。

我想运行多个文件 test .js

我在控制台执行这个命令:

casperjs /var/www/run.js /var/www/casper/tests

看到这个错误:

CasperError: casper.test 属性仅在使用casperjs test 命令时可用

并且在任何测试中都不要使用属性“test”。

【问题讨论】:

    标签: casperjs


    【解决方案1】:

    如果执行 test 套件,则必须使用 casperjs test 命令。

    casperjs test /var/www/casper/tests
    

    或者进入包含测试文件夹的目录,然后执行以下命令之一:

    casperjs test tests
    casperjs test tests/
    casperjs test ./tests
    

    http://casperjs.readthedocs.org/en/latest/testing.html

    如果你想包含一些文件:使用 --includes

    https://gist.github.com/n1k0/2948039

    或 phantom.injectJs(path/to/your/jsFile.js)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-21
      • 2022-01-22
      • 1970-01-01
      • 1970-01-01
      • 2019-04-13
      • 2022-01-05
      • 1970-01-01
      • 2022-12-22
      相关资源
      最近更新 更多