Skip to content

Commit

Permalink
SED-702 TCs added to an already scheduled test set are skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromecomte committed Apr 7, 2021
1 parent 3208f4f commit 8b60797
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
Expand Up @@ -103,6 +103,10 @@ SelectionModel = function(dataFunction, idAttribute) {
this.getSelectedIds = function() {
return _.map(_.filter(_.pairs(me.selectionModel), function(pair) {return pair[1].selected}), function(pair) {return pair[0]});
}

this.areAllSelected = function() {
return me.getSelectedIds().length == _.pairs(me.selectionModel).length;
}

this.getId = function(val) {
if(idAttribute) {
Expand Down
Expand Up @@ -260,14 +260,15 @@ tecAdminControllers.directive('executionProgress', ['$http','$timeout','$interva
},$scope, executionViewServices);

$scope.getIncludedTestcases = function() {
var selectionMode = $scope.testCaseTable.getSelectionMode?$scope.testCaseTable.getSelectionMode():'all';
if(selectionMode=='all') {
var table = $scope.testCaseTable;
var selectionMode = table.getSelectionMode?table.getSelectionMode():'all';
if(selectionMode=='all' || table.areAllSelected()) {
return null;
} else if (selectionMode=='custom' || selectionMode=='none') {
var includedTestCases = {"by":$scope.execution.executionParameters.repositoryObject.repositoryID=="local"?"id":"name"};
var result = [];
if($scope.testCaseTable.getRows!=null) {
_.each($scope.testCaseTable.getRows(true),function(value){result.push(includedTestCases.by=="id"?value.artefactID:value.name)});
if(table.getRows!=null) {
_.each(table.getRows(true),function(value){result.push(includedTestCases.by=="id"?value.artefactID:value.name)});
}
includedTestCases.list = result;
return includedTestCases;
Expand Down
Expand Up @@ -83,15 +83,16 @@ angular.module('repositoryControllers', ['step'])
$scope.statusOptions = _.map(_.uniq(_.map(data.runs, function(e){return e.status})), function(e){return {text:e}});
});
$scope.functions.getIncludedTestcases = function() {
var selectionMode = $scope.tableHandle.getSelectionMode();
if(selectionMode=='all') {
var table = $scope.tableHandle;
var selectionMode = table.getSelectionMode();
if(selectionMode=='all' || table.areAllSelected()) {
return null;
} else if (selectionMode=='custom' || selectionMode=='none') {
var trackBy = $scope.trackTestcasesBy=='id'?'id':'name'
var includedTestCases = {"by":trackBy};
var result = [];
if($scope.tableHandle.getRows!=null) {
_.each($scope.tableHandle.getRows(true),function(value){result.push(trackBy=='id'?value.id:value.testplanName)});
if(table.getRows!=null) {
_.each(table.getRows(true),function(value){result.push(trackBy=='id'?value.id:value.testplanName)});
}
includedTestCases.list = result;
return includedTestCases;
Expand Down
Expand Up @@ -412,6 +412,7 @@ angular.module('tables', ['export'])
scope.handle.getSelectedIds = scope.selectionModel.getSelectedIds.bind(scope.selectionModel);
scope.handle.getSelection = scope.selectionModel.getSelection.bind(scope.selectionModel);
scope.handle.getSelectionMode = scope.selectionModel.getSelectionMode.bind(scope.selectionModel);
scope.handle.areAllSelected = scope.selectionModel.areAllSelected.bind(scope.selectionModel);

scope.handle.setSelection = scope.setSelection;
scope.handle.select = function(id) {
Expand Down

0 comments on commit 8b60797

Please sign in to comment.