3 angular.module('yardStickGui2App')
4 .controller('suitcreateController', ['$scope', '$state', '$stateParams', 'mainFactory', 'Upload', 'toaster', 'ngDialog',
5 function($scope, $state, $stateParams, mainFactory, Upload, toaster, ngDialog) {
14 $scope.constructTestSuit = constructTestSuit;
15 $scope.openDialog = openDialog;
16 $scope.createSuite = createSuite;
20 function getTestcaseList() {
21 mainFactory.getTestcaselist().get({
23 }).$promise.then(function(response) {
24 if (response.status == 1) {
25 $scope.testcaselist = response.result;
39 $scope.testsuiteList = [];
40 $scope.suitReconstructList = [];
42 function constructTestSuit(name) {
44 var index = $scope.testsuiteList.indexOf(name);
46 $scope.testsuiteList.splice(index, 1);
48 $scope.testsuiteList.push(name);
52 $scope.suitReconstructList = $scope.testsuiteList;
56 function createSuite(name) {
57 mainFactory.suiteCreate().post({
58 'action': 'create_suite',
61 'testcases': $scope.testsuiteList
63 }).$promise.then(function(response) {
64 if (response.status == 1) {
67 title: 'create suite success',
68 body: 'you can go next step',
85 function openDialog() {
87 template: 'views/modal/suiteName.html',
88 className: 'ngdialog-theme-default',
92 closeByDocument: false