* add methods to set status.  status hidden if not set.
* e2e tests run locally
* updated some angular libraries from seed.
This commit is contained in:
Cameron Dawson 2013-09-03 14:30:39 -07:00
Родитель 3c18602771
Коммит e9277250e6
9 изменённых файлов: 42 добавлений и 53 удалений

Просмотреть файл

@ -5,15 +5,6 @@ module.exports = function (config) {
basePath: '../',
files: [
'app/vendor/angular/angular.js',
'app/vendor/angular/angular-*.js',
'app/vendor/*.js',
'app/js/**/*.js',
'app/js/controllers/**/*.js',
'test/vendor/angular/angular-mocks.js',
'test/vendor/angular/angular-scenario.js',
'test/vendor/jquery-2.0.3.js',
'test/vendor/jasmine-jquery.js',
'test/e2e/**/*.js',
// fixtures
@ -28,14 +19,14 @@ module.exports = function (config) {
proxies: {
'/': 'http://localhost:8000/'
},
urlRoot: '/__e2e/',
urlRoot: '/',
plugins : [
// 'karma-junit-reporter',
'karma-junit-reporter',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-jasmine',
// 'karma-ng-scenario'
],
'karma-ng-scenario'
],
junitReporter: {
outputFile: 'test_out/e2e.xml',
suite: 'e2e'

Просмотреть файл

@ -5,18 +5,18 @@ module.exports = function (config) {
basePath: '../',
files: [
'app/vendor/angular/angular.js',
'app/vendor/angular/angular-*.js',
'app/vendor/*.js',
'app/js/**/*.js',
'app/js/controllers/**/*.js',
'test/vendor/angular/angular-mocks.js',
'test/vendor/jquery-2.0.3.js',
'test/vendor/jasmine-jquery.js',
'test/unit/**/*.js',
'app/vendor/angular/angular.js',
'app/vendor/angular/angular-*.js',
'app/vendor/*.js',
'app/js/**/*.js',
'app/js/controllers/**/*.js',
'test/vendor/angular/angular-mocks.js',
'test/vendor/jquery-2.0.3.js',
'test/vendor/jasmine-jquery.js',
'test/unit/**/*.js'
// fixtures
{pattern: 'test/mock/*.json', watched: true, served: true, included: false}
// fixtures
// {pattern: 'test/mock/*.json', watched: true, served: true, included: false}
],
autoWatch: false,

Просмотреть файл

@ -5,41 +5,26 @@
describe('treeherder', function() {
beforeEach(function() {
browser().navigateTo('../../app/index.html');
browser().navigateTo('app/index.html');
});
// it('should automatically redirect to /jobs when location hash/fragment is empty', function() {
// expect(browser().location().url()).toBe("/jobs");
// });
it('should automatically redirect to /jobs when location hash/fragment is empty', function() {
expect(browser().location().url()).toBe("/jobs");
});
describe('view1', function() {
beforeEach(function() {
browser().navigateTo('#/view1');
browser().navigateTo('#/jobs');
});
// it('should render jobs when user navigates to /jobs', function() {
// expect(element('[ng-view] p:first').text()).
// toMatch(/partial for view 1/);
// });
});
describe('view2', function() {
beforeEach(function() {
browser().navigateTo('#/view2');
it('should render jobs when user navigates to /jobs', function() {
expect(repeater('.result-set').count()).toBe(10);
});
// it('should render view2 when user navigates to /view2', function() {
// expect(element('[ng-view] p:first').text()).
// toMatch(/partial for view 2/);
// });
});
});

0
tests/ui/vendor/angular/angular-mocks.js поставляемый Normal file → Executable file
Просмотреть файл

0
tests/ui/vendor/angular/angular-scenario.js поставляемый Normal file → Executable file
Просмотреть файл

Просмотреть файл

@ -18,8 +18,8 @@
Logged in as <a href="#" class="navbar-link">Username</a>
</p>
<form class="navbar-search pull-right">
<span class="label label-success">{{ repo }}</span>
<span class="label label-success">0 unstarred</span>
<span class="label label-info">{{ repo }}</span>
<span class="label label-info">0 unstarred</span>
<input type="text" ng-model="query" class="search-query" placeholder="Search">
</form>
<!-- nav begin -->
@ -57,7 +57,10 @@
</div>
<div class="jobs_list span11" ng-cloak>
<div class="alert alert-success">{{ status }}</div>
<div class="alert"
ng-bind="statusMsg"
ng-show="statusMsg"
ng-class="{'alert-success': (statusColor=='green'), 'alert-error': (statusColor=='red')}"></div>
<ng-view ></ng-view>
</div>

Просмотреть файл

@ -32,6 +32,9 @@ treeherder.controller('JobsCtrl',
thResultSets.getResultSets().
success(function(data) {
$scope.result_sets = data;
}).
error(function(data, status, header, config) {
$scope.statusError("Error getting result sets and jobs from service");
});
}

Просмотреть файл

@ -1,9 +1,16 @@
"use strict";
treeherder.controller('MainCtrl',
function MainController($scope) {
function MainController($scope, $rootScope) {
$scope.query="";
$scope.status = "condition green";
$scope.statusError = function(msg) {
$rootScope.statusMsg = msg;
$rootScope.statusColor = "red";
};
$scope.statusSuccess = function(msg) {
$rootScope.statusMsg = msg;
$rootScope.statusColor = "green";
};
}
);

Просмотреть файл

@ -3,7 +3,7 @@
<div
ng-repeat="push in result_sets"
ng-controller="PushCtrl"
class="row-fluid">
class="result-set row-fluid">
<a class="btn {{ pushResultBtn }}"
ng-click="isCollapsedResults = !isCollapsedResults">