Commit f11b2770 authored by Bonita CI's avatar Bonita CI

Merge branch 'master' into 'dev'

parents ed9d80b2 10a66af4
......@@ -2,33 +2,33 @@
<div class="panel-heading title">{{ 'Filters' | translate }}</div>
<div class="panel-body">
<div class="col-md-3 button-filter"> {{ 'Process name' | translate }}
<div class="btn-group" dropdown id="case-app-name-filter">
<button type="button" dropdown-toggle class="btn btn-primary dropdown-toggle ">{{selectedFilters.selectedApp | translate}} <span class="caret"></span></button>
<ul class="dropdown-menu" role="menu">
<li ng-click="filterCtrl.selectApp(defaultFilters.appName)"><a>{{defaultFilters.appName | translate}}</a></li>
<li ng-if="appNames &amp;&amp; appNames.length>0" class="divider"></li>
<li ng-repeat="appName in appNames" ng-click="filterCtrl.selectApp(appName)"><a>{{appName}}</a></li>
</ul>
</div>
</div>
<div class="col-md-9">
<span class="button-filter"> {{ 'Process' | translate }} <span id="infoPopover" class="glyphicon glyphicon-info-sign" popover="{{'This filters the case list only by process name. The display name is shown for information purposes. ' | translate}}" popover-trigger="mouseenter"></span>
<div class="btn-group" dropdown id="case-app-name-filter">
<button type="button" dropdown-toggle class="btn btn-primary dropdown-toggle ">{{selectedFilters.selectedApp[1] | translate}} <span class="caret"></span></button>
<ul class="dropdown-menu" role="menu">
<li ng-click="filterCtrl.selectApp(defaultFilters.appName, defaultFilters.appName)"><a>{{defaultFilters.appName | translate}}</a></li>
<li ng-if="appNames &amp;&amp; appNames.length>0" class="divider"></li>
<li ng-repeat="appName in appNames" ng-click="filterCtrl.selectApp(appName[0], appName[1])"><a>{{appName[0]}} ({{appName[1]}})</a></li>
</ul>
</div>
</span>
<div class="col-md-3 button-filter">{{'Process version' | translate }}
<div class="btn-group" dropdown id="case-app-version-filter">
<button type="button" dropdown-toggle class="btn btn-primary dropdown-toggle " ng-disabled="selectedFilters.selectedApp === defaultFilters.appName">{{selectedFilters.selectedVersion | translate}} <span class="caret"></span></button>
<ul class="dropdown-menu" role="menu">
<li ng-click="filterCtrl.selectVersion(defaultFilters.appVersion)"><a>{{defaultFilters.appVersion | translate}}</a></li>
<li class="divider"></li>
<li ng-repeat="version in versions" ng-click="filterCtrl.selectVersion(version)"><a>{{version}}</a></li>
</ul>
</div>
</div>
<div class="col-md-3 button-filter">
<span class="col-md-offset-1 button-filter">{{'Version' | translate }}
<div class="btn-group" dropdown id="case-app-version-filter">
<button type="button" dropdown-toggle class="btn btn-primary dropdown-toggle " ng-disabled="selectedFilters.selectedApp[1] === defaultFilters.appName || versions.length < 2">{{selectedFilters.selectedVersion | translate}} <span class="caret"></span></button>
<ul class="dropdown-menu" role="menu">
<li ng-click="filterCtrl.selectVersion(defaultFilters.appVersion)"><a>{{defaultFilters.appVersion | translate}}</a></li>
<li class="divider"></li>
<li ng-repeat="version in versions" ng-click="filterCtrl.selectVersion(version)"><a>{{version}}</a></li>
</ul>
</div>
</span>
</div>
<div class="col-md-3 button-filter">
<form role="form" name="searchForm" novalidate ng-submit="filterCtrl.submitSearch()">
<div class="input-group">
<input type="text" class="form-control" ng-model="selectedFilters.currentSearch" name="searchField" id="case-list-search" placeholder="{{ 'Search...' | translate }}">
<input type="text" class="form-control" ng-model="selectedFilters.currentSearch" name="searchField" id="case-list-search" placeholder="{{ 'Search by process name or search keys' | translate }}">
<span ng-click="filterCtrl.submitSearch()" class="input-group-addon pointer"><span class="glyphicon glyphicon-search"></span></span>
</div>
</form>
......
<div id="case-filters" class="panel panel-default">
<div class="panel-heading title">{{'Filters' | translate}}</div>
<div class="panel-body">
<div class="col-md-3 button-filter">{{'Process name' | translate}}
<div class="btn-group" dropdown id="case-app-name-filter">
<button type="button" dropdown-toggle class="btn btn-primary dropdown-toggle">{{selectedFilters.selectedApp | translate}} <span class="caret"></span></button>
<ul class="dropdown-menu" role="menu">
<li ng-click="filterCtrl.selectApp(defaultFilters.appName)"><a>{{defaultFilters.appName | translate}}</a></li>
<li ng-if="appNames &amp;&amp; appNames.length>0" class="divider"></li>
<li ng-repeat="appName in appNames" ng-click="filterCtrl.selectApp(appName)"><a>{{appName}}</a></li>
</ul>
</div>
</div>
<div class="col-md-3 button-filter">{{'Process version' | translate}}
<div class="btn-group" dropdown id="case-app-version-filter">
<button type="button" dropdown-toggle class="btn btn-primary dropdown-toggle" ng-disabled="selectedFilters.selectedApp === defaultFilters.appName">{{selectedFilters.selectedVersion | translate}} <span class="caret"></span></button>
<ul class="dropdown-menu" role="menu">
<li ng-click="filterCtrl.selectVersion(defaultFilters.appVersion)"><a>{{defaultFilters.appVersion | translate}}</a></li>
<li class="divider"></li>
<li ng-repeat="version in versions" ng-click="filterCtrl.selectVersion(version)"><a>{{version}}</a></li>
</ul>
</div>
</div>
<div class="col-md-3 button-filter">{{'Case state' | translate}}
<div class="btn-group" dropdown id="case-app-status-filter">
<button type="button" dropdown-toggle class="btn btn-primary dropdown-toggle">{{caseStatesValues[selectedFilters.selectedStatus] | translate}} <span class="caret"></span></button>
<ul class="dropdown-menu" role="menu">
<li ng-click="filterCtrl.selectCaseStatus(defaultFilters.caseStatus)"><a>{{defaultFilters.caseStatus | translate}}</a></li>
<li class="divider"></li>
<li ng-click="filterCtrl.selectCaseStatus('error')"><a>{{'With failures' | translate}}</a></li>
</ul>
</div>
<div class="col-md-9">
<span class="button-filter">{{'Process' | translate}} <span id="infoPopover" class="glyphicon glyphicon-info-sign" popover="{{'This filters the case list only by process name. The display name is shown for information purposes. ' | translate}}" popover-trigger="mouseenter"></span>
<div class="btn-group" dropdown id="case-app-name-filter">
<button type="button" dropdown-toggle class="btn btn-primary dropdown-toggle">{{selectedFilters.selectedApp[0] | translate}} <span ng-if="selectedFilters.selectedApp[0] !== defaultFilters.appName">({{selectedFilters.selectedApp[1] | translate}})</span> <span class="caret"></span></button>
<ul class="dropdown-menu" role="menu">
<li ng-click="filterCtrl.selectApp(defaultFilters.appName, defaultFilters.appName)"><a>{{defaultFilters.appName | translate}}</a></li>
<li ng-if="appNames &amp;&amp; appNames.length>0" class="divider"></li>
<li ng-repeat="appName in appNames" ng-click="filterCtrl.selectApp(appName[0], appName[1])"><a>{{appName[1]}}</a></li>
</ul>
</div>
</span>
<span class="col-md-offset-1 button-filter">{{'Version' | translate}}
<div class="btn-group" dropdown id="case-app-version-filter">
<button type="button" dropdown-toggle class="btn btn-primary dropdown-toggle" ng-disabled="selectedFilters.selectedApp === defaultFilters.appName || versions.length < 2">{{selectedFilters.selectedVersion | translate}} <span class="caret"></span></button>
<ul class="dropdown-menu" role="menu">
<li ng-click="filterCtrl.selectVersion(defaultFilters.appVersion)"><a>{{defaultFilters.appVersion | translate}}</a></li>
<li class="divider"></li>
<li ng-repeat="version in versions" ng-click="filterCtrl.selectVersion(version)"><a>{{version}}</a></li>
</ul>
</div>
</span>
<span class="col-md-offset-1 button-filter">{{'Case state' | translate}}
<div class="btn-group" dropdown id="case-app-status-filter">
<button type="button" dropdown-toggle class="btn btn-primary dropdown-toggle">{{caseStatesValues[selectedFilters.selectedStatus] | translate}} <span class="caret"></span></button>
<ul class="dropdown-menu" role="menu">
<li ng-click="filterCtrl.selectCaseStatus(defaultFilters.caseStatus)"><a>{{defaultFilters.caseStatus | translate}}</a></li>
<li class="divider"></li>
<li ng-click="filterCtrl.selectCaseStatus('error')"><a>{{'With failures' | translate}}</a></li>
</ul>
</div>
</span>
</div>
<div class="col-md-3">
<form role="form" name="searchForm" novalidate ng-submit="filterCtrl.submitSearch()">
<div class="input-group">
<input type="text" class="form-control" ng-model="selectedFilters.currentSearch" name="searchField" id="case-list-search" placeholder="{{ 'Search...' | translate }}">
<input type="text" class="form-control" ng-model="selectedFilters.currentSearch" name="searchField" id="case-list-search" placeholder="{{ 'Search by process name or search keys' | translate }}">
<span ng-click="filterCtrl.submitSearch()" class="input-group-addon pointer"><span class="glyphicon glyphicon-search"></span></span>
</div>
</form>
......
......@@ -58,7 +58,7 @@
*/
/* jshint -W003 */
function CaseFilterController($scope, store, processAPI, defaultFilters, caseStatesValues, $stateParams) {
$scope.selectedFilters.selectedApp = defaultFilters.appName;
$scope.selectedFilters.selectedApp = [defaultFilters.appName, defaultFilters.appName];
$scope.selectedFilters.selectedVersion = defaultFilters.appVersion;
$scope.selectedFilters.selectedStatus = defaultFilters.caseStatus;
$scope.defaultFilters = defaultFilters;
......@@ -83,31 +83,40 @@
$scope.apps = processes;
var appNamesArray = processes.map(function(process) {
if ($scope.selectedFilters.processId && $scope.selectedFilters.processId === process.id) {
$scope.selectedFilters.selectedApp = process.displayName;
vm.filterVersion($scope.selectedFilters.selectedApp);
$scope.selectedFilters.selectedApp = [process.name, process.displayName];
vm.filterVersion($scope.selectedFilters.selectedApp[0], $scope.selectedFilters.selectedApp[1]);
$scope.selectedFilters.selectedVersion = process.version;
}
return process.displayName;
return [process.name, process.displayName];
});
appNamesArray.forEach(function(processName) {
if (processName && $.inArray(processName, $scope.appNames) < 0) {
$scope.appNames.push(processName);
appNamesArray.forEach(function(process) {
if (process && process[0] && process[1] && !isAppInArray(process, $scope.appNames)) {
$scope.appNames.push(process);
}
});
};
function isAppInArray(app, array) {
for (var i = 0; i < array.length; i++) {
if(array[i][0] === app[0] && array[i][1] === app[1]) {
return true;
}
}
return false;
}
store.load(processAPI, {
f: processFilter
}).then(vm.initFilters);
vm.selectApp = function(selectedAppName) {
if (selectedAppName) {
if (selectedAppName !== $scope.selectedFilters.selectedApp) {
$scope.selectedFilters.selectedApp = selectedAppName;
vm.selectApp = function(selectedAppName, selectedAppDisplayName) {
if (selectedAppName && selectedAppDisplayName) {
if (selectedAppName !== $scope.selectedFilters.selectedApp[0] || selectedAppDisplayName !== $scope.selectedFilters.selectedApp[1]) {
$scope.selectedFilters.selectedApp = [selectedAppName, selectedAppDisplayName];
}
//selected App is the same than before, do nothing
} else {
$scope.selectedFilters.selectedApp = defaultFilters.appName;
$scope.selectedFilters.selectedApp = [defaultFilters.appName, defaultFilters.appName];
}
};
......@@ -127,12 +136,12 @@
}
};
vm.filterVersion = function(appName) {
vm.filterVersion = function(appName, appDisplayName) {
$scope.versions = [];
$scope.selectedFilters.selectedVersion = defaultFilters.appVersion;
if ($scope.apps && $scope.apps.filter) {
$scope.versions = $scope.apps.filter(function(app) {
return app && app.displayName === appName && app.version;
return app && app.name === appName && app.displayName === appDisplayName && app.version;
}).map(function(app) {
return app.version;
});
......@@ -145,7 +154,7 @@
vm.filterProcessDefinition = function(selectedAppVersion) {
if (selectedAppVersion && $scope.selectedFilters.selectedApp && $scope.apps) {
var matchingProcessDefs = $scope.apps.filter(function(app) {
return app && app.displayName === $scope.selectedFilters.selectedApp && selectedAppVersion === app.version;
return app && app.name === $scope.selectedFilters.selectedApp[0] && app.displayName === $scope.selectedFilters.selectedApp[1] && selectedAppVersion === app.version;
});
if (matchingProcessDefs && matchingProcessDefs.length) {
$scope.selectedFilters.selectedProcessDefinition = matchingProcessDefs[0] && matchingProcessDefs[0].id;
......@@ -165,9 +174,9 @@
//it will not be mockable
$scope.$watch('selectedFilters.selectedApp', function() {
if (!$scope.selectedFilters.processId) {
vm.filterVersion($scope.selectedFilters.selectedApp);
vm.filterVersion($scope.selectedFilters.selectedApp[0], $scope.selectedFilters.selectedApp[1]);
delete $scope.selectedFilters.selectedProcessDefinition;
} else if ($scope.selectedFilters.selectedApp !== defaultFilters.appName) {
} else if ($scope.selectedFilters.selectedApp[0] !== defaultFilters.appName) {
delete $scope.selectedFilters.processId;
}
});
......
......@@ -29,6 +29,7 @@
<th class="text-right case-column" bo-sorter="id" bo-sorter-title-asc="{{'sort by ID ascending' | translate}}" bo-sorter-title-desc="{{'sort by ID descending' | translate}}">{{'ID' | translate}}</th>
<th class="case-column" bo-sorter="name" bo-sorter-title-asc="{{'sort by Process name ascending' | translate}}" bo-sorter-title-desc="{{'sort by Process name descending' | translate}}">{{'Process name' | translate}}</th>
<th class="case-column">{{'Display name' | translate}}</th>
<th class="case-column" >{{'Version' | translate}}</th>
<th bo-sorter="startDate" class="case-column" bo-sorter-title-asc="{{'sort by Start date ascending' | translate}}" bo-sorter-title-desc="{{'sort by Start date descending' | translate}}">{{'Start date' | translate}}</th>
<th class="case-column">{{'Started by' | translate}}</th>
......@@ -50,7 +51,8 @@
</td>
<td class="text-right case-detail"><a id="case-detail-link-{{case.id}}" target="_parent" href="{{::caseCtrl.getLinkToCase(case)}}">{{case['ID']}}</a></td>
<td class="case-detail"><a id="case-process-link-{{case.id}}" target="_parent" href="{{::caseCtrl.getLinkToProcess(case)}}">{{case['Process name']}}</a></td>
<td class="case-detail"><a id="case-process-link-{{case.id}}" target="_parent" href="{{::caseCtrl.getLinkToProcess(case)}}">{{case.processDefinitionId.name}}</a></td>
<td class="case-detail"><a id="case-process-link-{{case.id}}" target="_parent" href="{{::caseCtrl.getLinkToProcess(case)}}">{{case.processDefinitionId.displayName}}</a></td>
<td class="case-detail">{{::case['Version']}}</td>
<td class="case-detail">{{::caseCtrl.parseAndFormat(case['Start date'])}}</td>
<td class="case-detail" title="{{'username:' | translate}} {{::case['Started by'] || ('System' | translate)}}">{{::case['Started by fullname'] || ('System' | translate)}}</td>
......@@ -101,6 +103,7 @@
<th class="case-checkbox" data-ignore><div bo-selectall></div></th>
<th class="text-right case-column" bo-sorter="sourceObjectId" bo-sorter-title-asc="{{'sort by ID ascending' | translate}}" bo-sorter-title-desc="{{'sort by ID descending' | translate}}">{{'ID' | translate}}</th>
<th class="case-column" bo-sorter="name" bo-sorter-title-asc="{{'sort by Process name ascending' | translate}}" bo-sorter-title-desc="{{'sort by Process name descending' | translate}}">{{'Process name' | translate}}</th>
<th class="case-column">{{'Display name' | translate}}</th>
<th class="case-column" >{{'Version' | translate}}</th>
<th bo-sorter="startDate" class="case-column" bo-sorter-title-asc="{{'sort by Start date ascending' | translate}}" bo-sorter-title-desc="{{'sort by Start date descending' | translate}}">{{'Start date' | translate}}</th>
<th class="case-column" >{{'Started by' | translate}}</th>
......@@ -123,7 +126,8 @@
</td>
<td class="case-detail text-right"><a id="case-detail-link-{{case.id}}" target="_parent" href="{{::caseCtrl.getLinkToCase(case)}}">{{case['ID']}}</a></td>
<td class="case-detail"><a id="case-process-link-{{case.id}}" target="_parent" href="{{::caseCtrl.getLinkToProcess(case)}}">{{case['Process name']}}</a></td>
<td class="case-detail"><a id="case-process-link-{{case.id}}" target="_parent" href="{{::caseCtrl.getLinkToProcess(case)}}">{{case.processDefinitionId.name}}</a></td>
<td class="case-detail"><a id="case-process-link-{{case.id}}" target="_parent" href="{{::caseCtrl.getLinkToProcess(case)}}">{{case.processDefinitionId.displayName}}</a></td>
<td class="case-detail">{{::case['Version']}}</td>
<td class="case-detail">{{::caseCtrl.parseAndFormat(case['Start date'])}}</td>
<td class="case-detail" title="{{'username:' | translate}} {{::case['Started by'] || ('System' | translate)}}">{{::case['Started by fullname'] || ('System' | translate)}}</td>
......
......@@ -80,6 +80,12 @@
function CaseListCtrl($scope, caseAPI, casesColumns, defaultPageSize, defaultSort, defaultDeployedFields, defaultCounterFields, $location, $stateParams, pageSizes, defaultFilters, dateParser, $anchorScroll, growl, moreDetailToken, tabName, manageTopUrl, processId, supervisorId, caseStateFilter, FeatureManager) {
var vm = this;
var modeDetailProcessToken = 'processmoredetailsadmin';
var defaultFiltersArray = [];
if (supervisorId) {
defaultFiltersArray.push('supervisor_id=' + supervisorId);
moreDetailToken = moreDetailToken.replace('admin', 'pm');
modeDetailProcessToken = modeDetailProcessToken.replace('admin', 'pm');
}
/**
* @ngdoc property
......@@ -103,7 +109,8 @@
total: 0
};
$scope.selectedFilters = {
processId: processId
processId: processId,
selectedApp: [defaultFilters.appName, defaultFilters.appName]
};
$scope.pageSizes = pageSizes;
/**
......@@ -116,12 +123,6 @@
$scope.cases = undefined;
$scope.loading = true;
var defaultFiltersArray = [];
if (supervisorId) {
defaultFiltersArray.push('supervisor_id=' + supervisorId);
moreDetailToken = moreDetailToken.replace('admin', 'pm');
modeDetailProcessToken = modeDetailProcessToken.replace('admin', 'pm');
}
$scope.processManager = +!!supervisorId;
$scope.supervisorId = supervisorId;
......@@ -251,8 +252,8 @@
var filters = angular.copy(defaultFiltersArray);
if ($scope.selectedFilters.selectedProcessDefinition) {
filters.push('processDefinitionId=' + $scope.selectedFilters.selectedProcessDefinition);
} else if ($scope.selectedFilters.selectedApp && $scope.selectedFilters.selectedApp !== defaultFilters.appName) {
filters.push('name=' + $scope.selectedFilters.selectedApp);
} else if ($scope.selectedFilters.selectedApp[0] && $scope.selectedFilters.selectedApp[0] !== defaultFilters.appName) {
filters.push('name=' + $scope.selectedFilters.selectedApp[0]);
}
if ($scope.selectedFilters.selectedStatus && $scope.selectedFilters.selectedStatus !== defaultFilters.caseStatus) {
filters.push('state=' + $scope.selectedFilters.selectedStatus);
......
......@@ -89,6 +89,8 @@
"e2eOnly": "node --max-old-space-size=2048 ./node_modules/grunt-cli/bin/grunt testE2e",
"dev:serve": "grunt serve",
"dev:less": "watch --wait=1 \"npm-run-all --parallel build:*\" main/styles",
"start": "npm-run-all --parallel dev:*"
"start": "npm-run-all --parallel dev:*",
"listDependencies": "bower-license -e json > ./bonita-portal-js-bower-dependencies.json",
"listDependenciesYarn": "license-checker --json --production > ./bonita-portal-js-yarn-dependencies.json"
}
}
......@@ -105,5 +105,59 @@
</plugins>
</build>
</profile>
<profile>
<id>dependencies</id>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>install node and yarn</id>
<goals>
<goal>install-node-and-yarn</goal>
</goals>
<phase>initialize</phase>
</execution>
<execution>
<id>bower-license license-checker</id>
<goals>
<goal>yarn</goal>
</goals>
<phase>initialize</phase>
<configuration>
<arguments>add --dev bower-license license-checker</arguments>
</configuration>
</execution>
<execution>
<id>list bower dependencies</id>
<goals>
<goal>yarn</goal>
</goals>
<phase>initialize</phase>
<configuration>
<arguments>
listDependencies
</arguments>
</configuration>
</execution>
<execution>
<id>list yarn dependencies</id>
<goals>
<goal>yarn</goal>
</goals>
<phase>initialize</phase>
<configuration>
<arguments>
listDependenciesYarn
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
......@@ -77,6 +77,9 @@
element.all(by.xpath('//tbody//td[3]')).each(function(appNameColumn){
expect(appNameColumn.getText()).toBe('Poule');
});
element.all(by.xpath('//tbody//td[4]')).each(function(appNameColumn){
expect(appNameColumn.getText()).toBe('Poule');
});
expect(element.all(by.css('#cases-results-size-top')).count()).toBe(1);
expect(element.all(by.css('#cases-results-size-bottom')).count()).toBe(1);
});
......@@ -90,11 +93,14 @@
expect(appNameColumn.getText()).toBe('ProcessX');
});
element.all(by.xpath('//tbody//td[4]')).each(function(appNameColumn){
expect(appNameColumn.getText()).toBe('ProcessX');
});
element.all(by.xpath('//tbody//td[5]')).each(function(appNameColumn){
expect(appNameColumn.getText()).toBe('2.0');
});
var versionFilterButton = caseFilters.all(by.css('#case-app-version-filter button'));
expect(versionFilterButton.getText()).toEqual(['2.0']);
expect(element.all(by.css('#case-app-version-filter button')).getAttribute('disabled')).toEqual([null]);
expect(element.all(by.css('#case-app-version-filter button')).getAttribute('disabled')).toEqual(['true']);
expect(element.all(by.css('#cases-results-size-top')).count()).toBe(1);
expect(element.all(by.css('#cases-results-size-bottom')).count()).toBe(1);
expect(element.all(by.css('#cases-results-pages')).count()).toBe(0);
......
......@@ -23,8 +23,8 @@
describe('archived case admin list', function () {
var caseList,
nbColumnsDiplayed = (edition.isSP())?8:7,
nbTotalcolumns = (edition.isSP())?12:7;
nbColumnsDiplayed = (edition.isSP())?9:8,
nbTotalcolumns = (edition.isSP())?13:8;
beforeEach(function () {
browser.get('#/admin/cases/list/archived');
......@@ -42,13 +42,14 @@
expect(columnList.count()).toBe(nbColumnsDiplayed+2);
expect(columnList.get(1).getText()).toContain('ID');
expect(columnList.get(2).getText()).toContain('Process name');
expect(columnList.get(3).getText()).toContain('Version');
expect(columnList.get(4).getText()).toContain('Start date');
expect(columnList.get(5).getText()).toContain('Started by');
expect(columnList.get(6).getText()).toContain('End date');
expect(columnList.get(7).getText()).toContain('State');
expect(columnList.get(3).getText()).toContain('Display name');
expect(columnList.get(4).getText()).toContain('Version');
expect(columnList.get(5).getText()).toContain('Start date');
expect(columnList.get(6).getText()).toContain('Started by');
expect(columnList.get(7).getText()).toContain('End date');
expect(columnList.get(8).getText()).toContain('State');
if (edition.isSP()) {
expect(columnList.get(8).getText()).toContain('Search Key 1');
expect(columnList.get(9).getText()).toContain('Search Key 1');
}
});
it('should contains page size selection', function () {
......@@ -186,25 +187,25 @@
tableHeader.get(2).click();
expect(tableHeader.get(2).getText()).toContain('Start date');
if(edition.isSP()){
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '1', 'Pool', '1.0', '10/16/2014 4:05 PM', 'William Jobs', '11/02/2014 10:07 AM', 'started', 'No value', '']);
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '1', 'Pool', 'Pool', '1.0', '10/16/2014 4:05 PM', 'William Jobs', '11/02/2014 10:07 AM', 'started', 'No value', '']);
} else {
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '1', 'Pool', '1.0', '10/16/2014 4:05 PM', 'William Jobs', '11/02/2014 10:07 AM', 'started', '']);
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '1', 'Pool', 'Pool', '1.0', '10/16/2014 4:05 PM', 'William Jobs', '11/02/2014 10:07 AM', 'started', '']);
}
});
it('should order by date desc', function () {
tableHeader.get(2).click();
if(edition.isSP()){
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '1', 'ProcessX', '2.0', '10/20/2014 10:08 AM', 'System', '11/02/2014 10:07 AM', 'started', 'No value', '']);
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '1', 'ProcessX', 'ProcessX', '2.0', '10/20/2014 10:08 AM', 'System', '11/02/2014 10:07 AM', 'started', 'No value', '']);
} else {
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '1', 'ProcessX', '2.0', '10/20/2014 10:08 AM', 'System', '11/02/2014 10:07 AM', 'started', '']);
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '1', 'ProcessX', 'ProcessX', '2.0', '10/20/2014 10:08 AM', 'System', '11/02/2014 10:07 AM', 'started', '']);
}
});
it('should order by id desc', function () {
tableHeader.get(0).click();
if(edition.isSP()){
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '1', 'Leave Request', '1.0', '10/17/2014 4:05 PM', 'Walter Bates', '11/02/2014 10:07 AM', 'started', 'No value', '']);
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '1', 'Leave Request', 'Leave Request', '1.0', '10/17/2014 4:05 PM', 'Walter Bates', '11/02/2014 10:07 AM', 'started', 'No value', '']);
} else {
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '1', 'Leave Request', '1.0', '10/17/2014 4:05 PM', 'Walter Bates', '11/02/2014 10:07 AM', 'started', '' ]);
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '1', 'Leave Request', 'Leave Request', '1.0', '10/17/2014 4:05 PM', 'Walter Bates', '11/02/2014 10:07 AM', 'started', '' ]);
}
});
});
......@@ -216,7 +217,7 @@
afterEach(function() {
jasmine.getEnv().defaultTimeoutInterval = 30000;
});
it('should display the list of the 25 first cases and check the specifi content of the first row', function () {
it('should display the list of the 25 first cases and check the specific content of the first row', function () {
expect(element.all(by.css('#case-list tr.case-row')).count()).toBe(25);
caseList.all(by.css('#caseId-1 td')).then(function (poolCaseDetails) {
......@@ -224,13 +225,14 @@
expect(poolCaseDetails[1].element(by.css('a')).getAttribute('href')).toContain('#?id=1&_p=archivedcasemoredetailsadmin&');
expect(poolCaseDetails[2].getText()).toContain('Leave Request');
expect(poolCaseDetails[2].element(by.css('a')).getAttribute('href')).toContain('#?id=7626384556180392799&_p=processmoredetailsadmin&');
expect(poolCaseDetails[3].getText()).toContain('1.0');
expect(poolCaseDetails[4].getText()).toContain('10/17/2014 4:05 PM');
expect(poolCaseDetails[5].getText()).toContain('Walter Bates');
expect(poolCaseDetails[6].getText()).toContain('11/02/2014 10:07 AM');
expect(poolCaseDetails[7].getText()).toContain('started');
expect(poolCaseDetails[3].getText()).toContain('Leave Request');
expect(poolCaseDetails[4].getText()).toContain('1.0');
expect(poolCaseDetails[5].getText()).toContain('10/17/2014 4:05 PM');
expect(poolCaseDetails[6].getText()).toContain('Walter Bates');
expect(poolCaseDetails[7].getText()).toContain('11/02/2014 10:07 AM');
expect(poolCaseDetails[8].getText()).toContain('started');
if(edition.isSP()){
expect(poolCaseDetails[8].getText()).toContain('No value');
expect(poolCaseDetails[9].getText()).toContain('No value');
}
expect(poolCaseDetails[nbColumnsDiplayed+1].element(by.id('case-detail-btn-1')).getAttribute('href')).toContain('#?id=1&_p=archivedcasemoredetailsadmin&');
});
......
......@@ -74,10 +74,13 @@
appNamesFilter.all(by.css('ul')).each(function(column){
expect(column.isDisplayed()).toBeFalsy();
});
expect(appNamesFilter.all(by.css('button')).getText()).toEqual(['Poule']);
expect(appNamesFilter.all(by.css('button')).getText()).toEqual(['Poule (Poule)']);
element.all(by.xpath('//tbody//td[3]')).each(function(appNameColumn){
expect(appNameColumn.getText()).toBe('Poule');
});
element.all(by.xpath('//tbody//td[4]')).each(function(appNameColumn){
expect(appNameColumn.getText()).toBe('Poule');
});
expect(element.all(by.css('#cases-results-size-bottom')).count()).toBe(1);
expect(element.all(by.css('#cases-results-size-top')).count()).toBe(1);
expect(element.all(by.css('#cases-results-pages')).count()).toBe(0);
......@@ -88,16 +91,19 @@
var appFilterButton = caseFilters.all(by.css('#case-app-name-filter button'));
appFilterButton.click();
appNamesFilter.all(by.css('ul li')).get(4).click();
expect(appNamesFilter.all(by.css('button')).getText()).toEqual(['ProcessX']);
expect(appNamesFilter.all(by.css('button')).getText()).toEqual(['ProcessX (ProcessX)']);
element.all(by.xpath('//tbody//td[3]')).each(function(appNameColumn){
expect(appNameColumn.getText()).toBe('ProcessX');
});
element.all(by.xpath('//tbody//td[4]')).each(function(appNameColumn){
expect(appNameColumn.getText()).toBe('ProcessX');
});
element.all(by.xpath('//tbody//td[5]')).each(function(appNameColumn){
expect(appNameColumn.getText()).toBe('2.0');
});
var versionFilterButton = caseFilters.all(by.css('#case-app-version-filter button'));
expect(versionFilterButton.getText()).toEqual(['2.0']);
expect(element.all(by.css('#case-app-version-filter button')).getAttribute('disabled')).toEqual([null]);
expect(element.all(by.css('#case-app-version-filter button')).getAttribute('disabled')).toEqual(['true']);
expect(element.all(by.css('#cases-results-size-bottom')).count()).toBe(1);
expect(element.all(by.css('#cases-results-size-top')).count()).toBe(1);
expect(element.all(by.css('#cases-results-pages')).count()).toBe(0);
......@@ -119,7 +125,7 @@
var appNamesFilterButton = caseFilters.all(by.css('#case-app-name-filter button'));
appNamesFilterButton.click();
appNamesFilter.all(by.css('ul li')).get(3).click();
expect(appNamesFilter.all(by.css('button')).getText()).toEqual(['Poule']);
expect(appNamesFilter.all(by.css('button')).getText()).toEqual(['Poule (Poule)']);
var versionFilter = caseFilters.all(by.css('#case-app-version-filter'));
var versionFilterButton = caseFilters.all(by.css('#case-app-version-filter button'));
expect(versionFilter.getText()).toEqual(['All']);
......
......@@ -22,8 +22,8 @@
const edition = require('../../../utils/edition');
var caseList,
nbColumnsDiplayed = (edition.isSP())?8:7,
nbTotalcolumns = (edition.isSP())?12:7;
nbColumnsDiplayed = (edition.isSP())?9:8,
nbTotalcolumns = (edition.isSP())?13:8;
beforeEach(function () {
browser.get('#/admin/cases/list');
......@@ -41,13 +41,14 @@
expect(columnList.count()).toBe(nbColumnsDiplayed+2);
expect(columnList.get(1).getText()).toContain('ID');
expect(columnList.get(2).getText()).toContain('Process name');
expect(columnList.get(3).getText()).toContain('Version');
expect(columnList.get(4).getText()).toContain('Start date');
expect(columnList.get(5).getText()).toContain('Started by');
expect(columnList.get(6).getText()).toContain('Failed Flow Nodes');
expect(columnList.get(7).getText()).toContain('Pending Flow Nodes');
expect(columnList.get(3).getText()).toContain('Display name');
expect(columnList.get(4).getText()).toContain('Version');
expect(columnList.get(5).getText()).toContain('Start date');
expect(columnList.get(6).getText()).toContain('Started by');
expect(columnList.get(7).getText()).toContain('Failed Flow Nodes');
expect(columnList.get(8).getText()).toContain('Pending Flow Nodes');
if (edition.isSP()) {
expect(columnList.get(8).getText()).toContain('Search Key 1');
expect(columnList.get(9).getText()).toContain('Search Key 1');
}
});
it('should contains page size selection', function () {
......@@ -255,17 +256,17 @@
tableHeader.get(2).click();
expect(tableHeader.get(2).getText()).toContain('Start date');
if(edition.isSP()){
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '2', 'Pool', '1.0', '10/16/2014 4:05 PM', 'William Jobs', '0', '1', 'No value', '']);
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '2', 'Pool', 'Pool', '1.0', '10/16/2014 4:05 PM', 'William Jobs', '0', '1', 'No value', '']);
}else{
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '2', 'Pool', '1.0', '10/16/2014 4:05 PM', 'William Jobs', '0', '1', '']);
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '2', 'Pool', 'Pool', '1.0', '10/16/2014 4:05 PM', 'William Jobs', '0', '1', '']);
}
});
it('should order by date desc', function () {
tableHeader.get(2).click();
if(edition.isSP()){
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '1022', 'ProcessX', '2.0', '10/20/2014 10:08 AM', 'System', '0', '1', 'No value', '']);
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '1022', 'ProcessX', 'ProcessX', '2.0', '10/20/2014 10:08 AM', 'System', '0', '1', 'No value', '']);
}else {
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '1022', 'ProcessX', '2.0', '10/20/2014 10:08 AM', 'System', '0', '1', '']);
expect(caseList.all(by.css('tbody tr')).get(0).all(by.css('td')).getText()).toEqual(['', '1022', 'ProcessX', 'ProcessX', '2.0', '10/20/2014 10:08 AM', 'System', '0', '1', '']);
}
});
});
......@@ -281,13 +282,14 @@
expect(poolCaseDetails[1].element(by.css('a')).getAttribute('href')).toContain('#?id=298&_p=casemoredetailsadmin&');
expect(poolCaseDetails[2].getText()).toContain('Leave Request');
expect(poolCaseDetails[2].element(by.css('a')).getAttribute('href')).toContain('#?id=7626384556180392799&_p=processmoredetailsadmin&');
expect(poolCaseDetails[3].getText()).toContain('1.0');
expect(poolCaseDetails[4].getText()).toContain('10/17/2014 4:05 PM');
expect(poolCaseDetails[5].getText()).toContain('William Jobs');
expect(poolCaseDetails[6].getText()).toContain('0');
expect(poolCaseDetails[7].getText()).toContain('1');
expect(poolCaseDetails[3].getText()).toContain('Leave Request');
expect(poolCaseDetails[4].getText()).toContain('1.0');
expect(poolCaseDetails[5].getText()).toContain('10/17/2014 4:05 PM');
expect(poolCaseDetails[6].getText()).toContain('William Jobs');
expect(poolCaseDetails[7].getText()).toContain('0');
expect(poolCaseDetails[8].getText()).toContain('1');
if(edition.isSP()){
expect(poolCaseDetails[8].getText()).toContain('No value');
expect(poolCaseDetails[9].getText()).toContain('No value');
}
expect(poolCaseDetails[nbColumnsDiplayed+1].element(by.id('case-detail-btn-298')).getAttribute('href')).toContain('#?id=298&_p=casemoredetailsadmin&');
});
......
......@@ -1076,10 +1076,10 @@
});
it('should have app name', function() {
scope.$digest();
var processName = 'Process1';
var processName = ['Process1', 'Process1'];
scope.selectedFilters.selectedApp = processName;
casesCtrl.buildFilters();
expect(scope.searchOptions.filters).toEqual(['name=' + processName]);
expect(scope.searchOptions.filters).toEqual(['name=' + processName[0]]);
expect(scope.pagination.currentPage).toBe(1);
});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!