在浏览器中一切正常:localhost:8002/test/e2e/runner.html
而在 cli./scripts/e2e-test.sh
它失败了:
配置:
module.exports = function(config){
config.set({
basePath : '../',
files : [
'test/e2e/**/*.js'
],
autoWatch : false,
browsers : ['Chrome'],
frameworks: ['ng-scenario'],
singleRun : true,
proxies : {
'/': 'http://localhost:8002/#' //added the hash as a test.. didn't help
},
plugins : [
'karma-junit-reporter',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-jasmine',
'karma-ng-scenario'
],
junitReporter : {
outputFile: 'test_out/e2e.xml',
suite: 'e2e'
}
})}
测试运行脚本:
#!/bin/bash
BASE_DIR=`dirname $0`
echo ""
echo "Starting Karma Server (http://karma-runner.github.io)"
echo "-------------------------------------------------------------------"
karma start $BASE_DIR/../config/karma-e2e.conf.js $*
失败消息:
WARN [config]: "/" is proxied, you should probably change urlRoot to avoid conflicts
WARN [proxy]: proxy "http://localhost:8002/#" normalized to "http://localhost:8002/#/"
INFO [karma]: Karma v0.10.2 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 30.0.1599 (Linux)]: Connected on socket qt_XZkiY6ZC2o-f86Ln-
WARN [proxy]: failed to proxy /app/index.html ([object Object])
使用 ubuntu 13(是的,我将 web-server.js 脚本默认端口更改为 8002)我会很高兴获得帮助或指导..