量角器和App文件夹结构

时间:2015-10-12 12:05:09

标签: angularjs protractor gulp-connect

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

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>
&#13;
&#13;
&#13;

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

0 个答案:

没有答案