0

我是量角器的新手。我已经为我的应用程序配置了 Gulp 和量角器。我的应用程序结构如下所示:-

my_app
  |
  ---WebContent
         |
         ----css folder
         ----3rd party folder
         ----e2e tests folder
         ----css folder
         ----js folder
         ----css folder
         ----WEB-INF folder
         ----META-INF folder
         ----**index.html**

我的 gulp 任务看起来像这样

gulp.task('connect', function() {
   connect.server({
       root: '../',
       port: 8000
   });
});

index.html看起来像这样

<!DOCTYPE html>
<html ng-app="app"ng-controller="appController">
<link rel="stylesheet" type="text/css" href="/my_app/3rd-party-js/bootstrap/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="/my_app/theme/css/uigrid/ui-bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="/my_app/3rd-party-js/angularjs/ui-grid.min.css"/>
<link rel="stylesheet" type="text/css" href="/my_app/theme/css/uigrid/loading-bar.css"/>
<link rel="stylesheet" type="text/css" href="/my_app/3rd-party-js/angularjs/slider/slider.css"/>

<link rel="stylesheet" type="text/css" href="/my_app/css/app.css"/>


<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>My App</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">

<body>
<header>
	<div class ="header-panel"><span class="glyphicon glyphicon-info-sign"></span> Environment:{{constants.environment}} </div>
    <div id="logo"><a href="/my_app/"> <img src="/my_app/images/logo.gif" alt="Logo"/></a></div>
    <div class="menu">
        // some stuff here
    </div>

</header>
<div class="full-fit" ng-view></div>

<script src="/my_app/3rd-party-js/jquery/jquery-1.9.1.js"></script>
<script src="/my_app/3rd-party-js/angularjs/angular.min.js"></script>
<script src="/my_app/3rd-party-js/angularjs/angular-idle.min.js"></script>
<script src="/my_app/3rd-party-js/angularjs/lodash.min.js"></script>
<script src="/my_app/3rd-party-js/angularjs/angular-animate.min.js"></script>
<script src="/my_app/3rd-party-js/angularjs/angular-animate.min.js.map"></script>
<script src="/my_app/3rd-party-js/angularjs/ui-bootstrap.js"></script>
<script src="/my_app/3rd-party-js/angularjs/angular.min.js.map"></script>
<script src="/my_app/3rd-party-js/angularjs/angular-route.min.js"></script>
<script src="/my_app/3rd-party-js/angularjs/angular-resource.min.js"></script>
<script src="/my_app/3rd-party-js/angularjs/loading-bar.js"></script>
<script src="/my_app/3rd-party-js/angularjs/ui-grid.min.js"></script>
<script src="/my_app/3rd-party-js/angularjs/momentjs.min.js"></script>
<script src="/my_app/3rd-party-js/angularjs/slider/slider.js"></script>
<script src="/my_app/3rd-party-js/angularjs/multiselect/multiselect.js"></script>
<script src="/my_app/3rd-party-js/angularjs/multiselect/multiselectsingle.js"></script>
<script src="/my_app/3rd-party-js/bootstrap/bootstrap.min.js"></script>
<script src="/my_app/dist/app.min.js"></script>

</body>
</html>

问题: 当我运行 gulp webserver 时,它会显示目录列表。好的,但是当我想访问 index.html ( http://localhost:8000/my_app/WebContent/index.html ) 时,它拒绝将其识别为 AngularJs 应用程序并加载没有 css 或其他嵌入 html 的粗略 html 页面. 我的 index.html 引用了根相对 URL,在 tomcat 或任何其他服务器上工作正常,但使用 gulp 无法正常工作。终极目标是编写一些量角器 e2e 测试,但已建立连接。任何指针?

4

0 回答 0