0
我正在使用PhantomJS为茉莉花测试设置CI。我正在面对将SystemJS包含在我的html页面中的问题。我从它删除的一切,刚刚离开的JavaScript,仍然面临着同样的错误:在html中加载SystemJS最终在PhantomJS中出错
ReferenceError: Can't find variable: System
下面是HTML的例子:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script src="lib/systemjs/dist/system.src.js"> </script>
<script>
System.config({
baseURL: './lib'
});
</script>
</body>
</html>
我跑了它在这样的控制台:phantomjs test.js http://localhost:8080 。
test.js包含下面的代码:
var page = require('webpage').create();
page.open(system.args[1], function(status)
{
phantom.exit(0);
});
看起来它没有看到system.src.js。我试图把绝对路径 - 但仍然是相同的错误。也尝试与page.injectJs - 也不好。
您使用哪个PhantomJS版本?请注册onConsoleMessage,onError,onResourceError,onResourceTimeout事件([Example](https://gist.github.com/artjomb/4cf43d16ce50d8674fdf#file-1_phantomerrors-js))。也许有错误。 –
我使用PhantomJS 2,我没有收到其他错误,只有我上面写的那个。 – Katia