And*_*lec 4 testing undefined casperjs
我正在使用Windows.我正在尝试使用CasperJS测试框架.
我正在使用phantomjs版本1.9.0.我正在使用casperjs版本1.0.2.
我跑的时候
casperjs test cow-test.js
Run Code Online (Sandbox Code Playgroud)
返回以下内容.
Test file: cow-test.js
FAIL TypeError: 'undefined' is not a function (evaluating 'casper.test.begin')
# type: uncaughtError
# error: "TypeError: 'undefined' is not a function (evaluating 'casper.test.begin')"
TypeError: 'undefined' is not a function (evaluating 'casper.test.begin')
C:/cow-test.js:16
FAIL 1 tests executed in 0.116s, 0 passed, 1 failed.
Details for the 1 failed test:
In cow-test.js:0
uncaughtError: TypeError: 'undefined' is not a function
(evaluating 'casper.test.begin')
var cow = {};
test.assert(cow);
test.done();
})')
Run Code Online (Sandbox Code Playgroud)
如果我只做
console.log(casper.test);
Run Code Online (Sandbox Code Playgroud)
返回以下内容
[object Object]
Run Code Online (Sandbox Code Playgroud)
如果我只做
console.log(casper.test.begin);
Run Code Online (Sandbox Code Playgroud)
返回以下内容.
undefined
Run Code Online (Sandbox Code Playgroud)
我该怎么办?我是否应该从特定目录运行"casperjs test cow-test.js"?
或者是其他东西?
谢谢Andre Andre_Mikulec@Hotmail.com