我正在编写一些测试,casperjs
但遇到了一些对我来说非常奇怪的事情:
这是代码:
casper.test.begin('Test', nbTests, function(test) {
console.log(A_SERVER + A_IMPORT + A_IMPORT_TAB1);
casper.start(A_SERVER + A_IMPORT + A_IMPORT_TAB1);
casper.waitForUrl(A_SERVER + A_IMPORT + A_IMPORT_TAB1, function (){
console.log("ok");
}, function(){
console.log("nok");
});
console.log(casper.getCurrentUrl());
casper.run(function(){
test.done();
this.exit();
});
});
测试运行良好,但日志以这种方式显示:
http://127.0.0.1:8000/import/upload/
http://127.0.0.1:8000/import/upload/
ok
你能告诉我为什么最后两个日志是倒置的吗?我想这与如何处理函数有关javascript
,但我想要一个更明确的解释。