Karma-angular e2e cli测试脚本无法运行(测试确实从浏览器运行)

时间:2013-10-23 20:34:22

标签: angularjs karma-runner

浏览器中的

一切正常: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) 我很乐意帮助或指导..

1 个答案:

答案 0 :(得分:2)

发布的结果是需要在测试运行器上运行`./scripts/webserver。当我想到时,这很明显。我也有一些记忆,早期版本的角度不需要。没关系