Fix the authenticate=false in scenario 91/51891/9
authorthuva4 <tharma.thuva@gmail.com>
Thu, 8 Feb 2018 09:11:05 +0000 (14:41 +0530)
committerThuvarakan Tharmarajasingam <tharma.thuva@gmail.com>
Mon, 12 Mar 2018 15:25:45 +0000 (15:25 +0000)
fix authetication issue in scenario page
add tests

Change-Id: I5d1457c4fde7c803459352223b1dfb2f970212df
Signed-off-by: thuva4 <tharma.thuva@gmail.com>
testapi/opnfv_testapi/tests/UI/e2e/authenticateFalseSpec.js [new file with mode: 0644]
testapi/opnfv_testapi/tests/UI/e2e/scenarioControllerSpec.js
testapi/opnfv_testapi/ui/Gruntfile.js
testapi/opnfv_testapi/ui/components/scenarios/scenario/scenario.html
testapi/opnfv_testapi/ui/components/scenarios/scenario/scenarioController.js
testapi/opnfv_testapi/ui/config.json

diff --git a/testapi/opnfv_testapi/tests/UI/e2e/authenticateFalseSpec.js b/testapi/opnfv_testapi/tests/UI/e2e/authenticateFalseSpec.js
new file mode 100644 (file)
index 0000000..3212b86
--- /dev/null
@@ -0,0 +1,385 @@
+
+var mock = require('protractor-http-mock');
+var baseURL = "http://localhost:8000/";
+
+
+describe('testing the pods page for anonymous user', function () {
+    beforeEach(function(){
+        mock([{
+            request: {
+              path: '/api/v1/pods',
+              method: 'GET'
+            },
+            response: {
+                data: {
+                    pods: [{role: "community-ci", name: "test", owner: "testUser",
+                    details: "DemoDetails", mode: "metal", _id: "59f02f099a07c84bfc5c7aed",
+                    creation_date: "2017-10-25 11:58:25.926168"}]
+                }
+            }
+        }
+        ]);
+    });
+
+    afterEach(function(){
+        mock.teardown();
+    });
+
+    it('Delete button is visible for  anonymous user', function () {
+        var fs = require('fs')
+        var m = JSON.parse(fs.readFileSync('testapi-ui/config.json').toString());
+        m.authenticate = false;
+        fs.writeFile('testapi-ui/config.json', JSON.stringify(m, null, 2))
+        browser.restart();
+        browser.get(baseURL+'#/pods');
+        var buttonDelete = element(by.buttonText('Delete'));
+        expect(buttonDelete.isDisplayed()).toBe(true)
+    });
+
+    it('Delete button is visible for anonymous  user', function () {
+        var buttonDelete = element(by.buttonText('Delete'));
+        expect(buttonDelete.isDisplayed()).toBe(true)
+    });
+
+    it('delete Operation is  visible for  user ', function () {
+        var deleteOperation = element(by.css('a[title=Delete]'));
+        expect(deleteOperation.isDisplayed()).toBe(true);
+    });
+});
+
+describe('testing the pods page for anonymous user', function () {
+    beforeEach(function(){
+        mock([
+            {
+                request: {
+                    path: '/api/v1/projects',
+                    method: 'GET'
+                },
+                response: {
+                    data: {
+                        "projects": [
+                            {
+                            "owner": "thuva4",
+                            "_id": "5a0c022f9a07c846d3c2cc94",
+                            "creation_date": "2017-11-15 14:30:31.200259",
+                            "description": "dsfsd",
+                            "name": "testproject"
+                            }
+                        ]
+                    }
+                }
+            }
+        ]);
+    });
+
+    afterEach(function(){
+        mock.teardown();
+    });
+
+    it('create button is visible for user', function () {
+        browser.get(baseURL+'#/projects');
+        var buttonCreate = element(by.buttonText('Create'));
+        expect(buttonCreate.isDisplayed()).toBe(true);
+    });
+
+    it('delete Operation is visible for  user ', function () {
+        browser.get(baseURL+'#/projects');
+        var deleteOperation = element(by.css('a[title=Delete]'));
+        expect(deleteOperation.isDisplayed()).toBe(true);
+    });
+
+    it('Edit Operation is visible for  user ', function () {
+        browser.get(baseURL+'#/projects');
+        var editOperation = element(by.css('a[title=Edit]'));
+        expect(editOperation.isDisplayed()).toBe(true);
+    });
+});
+
+
+describe('testing the scenarios page for anonymous user', function () {
+    beforeEach(function(){
+        mock([
+            {
+                request: {
+                    path: '/api/v1/scenarios',
+                    method: 'GET'
+                },
+                response: {
+                    data: {
+                        "scenarios": [
+                            {
+                            "installers": [
+                               {
+                                  "installer": "fuel",
+                                  "versions": [
+                                     {
+                                        "owner": "testUser",
+                                        "version": "colorado",
+                                        "projects": [
+                                           {
+                                              "project": "yardstick",
+                                              "customs": [
+                                                 "dvs"
+                                              ],
+                                              "scores": [
+                                                 {
+                                                    "date": "2016-12-11 01:45",
+                                                    "score": "14/24"
+                                                 }
+                                              ],
+                                              "trust_indicators": [
+                                                 {
+                                                    "date": "2016-12-09 11:38",
+                                                    "status": "silver"
+                                                 }
+                                              ]
+                                           },
+                                           {
+                                              "project": "functest",
+                                              "customs": [
+                                                 "vping_ssh",
+                                                 "vping_userdata",
+                                              ],
+                                              "scores": [
+                                                 {
+                                                    "date": "2016-12-09 11:28",
+                                                    "score": "6/8"
+                                                 }
+                                              ],
+                                              "trust_indicators": [
+                                                 {
+                                                    "date": "2016-12-09 11:38",
+                                                    "status": "silver"
+                                                 }
+                                              ]
+                                           },
+                                           {
+                                              "project": "sla",
+                                              "customs": [],
+                                              "scores": [
+                                                 {
+                                                    "date": "2018-01-16T18:30:00.000Z",
+                                                    "score": "sdS"
+                                                 }
+                                              ],
+                                              "trust_indicators": []
+                                           },
+                                           {
+                                              "project": "dvsd",
+                                              "customs": [],
+                                              "scores": [],
+                                              "trust_indicators": []
+                                           }
+                                        ]
+                                     },
+                                     {
+                                        "owner": "dfgvds",
+                                        "version": "df",
+                                        "projects": []
+                                     }
+                                  ]
+                               },
+                               {
+                                  "installer": "fuel2",
+                                  "versions": [
+                                     {
+                                        "owner": "testUser",
+                                        "version": "colorado",
+                                        "projects": [
+                                           {
+                                              "project": "yardstick",
+                                              "customs": [
+                                                 "tc002",
+                                                 "tc005",
+                                                 "tc010",
+                                                 "tc011"
+                                              ],
+                                              "scores": [
+                                                 {
+                                                    "date": "2016-12-11 01:45",
+                                                    "score": "14/24"
+                                                 }
+                                              ],
+                                              "trust_indicators": [
+                                                 {
+                                                    "date": "2016-12-09 11:38",
+                                                    "status": "silver"
+                                                 }
+                                              ]
+                                           },
+                                           {
+                                              "project": "functest",
+                                              "customs": [
+                                                 "vping_ssh",
+                                                 "vping_userdata"
+                                              ],
+                                              "scores": [
+                                                 {
+                                                    "date": "2016-12-09 11:28",
+                                                    "score": "6/8"
+                                                 }
+                                              ],
+                                              "trust_indicators": [
+                                                 {
+                                                    "date": "2016-12-09 11:38",
+                                                    "status": "silver"
+                                                 }
+                                              ]
+                                           }
+                                        ]
+                                     }
+                                  ]
+                               }
+                            ],
+                            "_id": "5a50fcacsdgdsgdasgfvb861c",
+                            "name": "test-scenario",
+                            "creation_date": "2018-01-06 22:13:24.160407"
+                            }
+                        ]
+                    }
+                }
+            }
+        ])
+    });
+
+    afterEach(function(){
+        mock.teardown();
+    });
+
+    it( 'should show the add installer option for anonymous user', function() {
+        browser.get(baseURL+"#/scenarios/test-scenario");
+        var EC = browser.ExpectedConditions;
+        browser.wait(EC.urlContains(baseURL+ '#/scenarios/test-scenario'), 10000);
+        var buttonAdd = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[2]/button'))
+        expect(buttonAdd.isDisplayed()).toBe(true);
+    });
+
+    it( 'should show the delete installer option for  user', function() {
+        browser.get(baseURL+"#/scenarios/test-scenario");
+        var EC = browser.ExpectedConditions;
+        browser.wait(EC.urlContains(baseURL+ '#/scenarios/test-scenario'), 10000);
+        var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[1]/a/p'))
+        installersShow.click();
+        var installerDelete = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[1]/td[3]/button'))
+        expect(installerDelete.isDisplayed()).toBe(true);
+    });
+
+    it( 'should show the add version option for  user', function() {
+        browser.get(baseURL+"#/scenarios/test-scenario");
+        var EC = browser.ExpectedConditions;
+        browser.wait(EC.urlContains(baseURL+ '#/scenarios/test-scenario'), 10000);
+        var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[1]/a/p'))
+        installersShow.click();
+        var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[1]/td[2]/a'))
+        installerShow.click();
+        var versionAdd = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[2]/button'))
+        versionAdd.click()
+        expect(versionAdd.isDisplayed()).toBe(true);
+    });
+
+    it( 'should show the delete version option for  user', function() {
+        browser.get(baseURL+"#/scenarios/test-scenario");
+        var EC = browser.ExpectedConditions;
+        browser.wait(EC.urlContains(baseURL+ '#/scenarios/test-scenario'), 10000);
+        var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[1]/a/p'))
+        installersShow.click();
+        var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[1]/td[2]/a'))
+        installerShow.click();
+        var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[1]/a/p'))
+        versionsShow.click();
+        var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[1]/td[2]/a'))
+        versionShow.click()
+        var versionDelete = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody[1]/tr[1]/td[3]/button'))
+        expect(versionDelete.isDisplayed()).toBe(true);
+    });
+
+    it( 'should show the add project option for  user', function() {
+        browser.get(baseURL+"#/scenarios/test-scenario");
+        var EC = browser.ExpectedConditions;
+        browser.wait(EC.urlContains(baseURL+ '#/scenarios/test-scenario'), 10000);
+        var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[1]/a/p'))
+        installersShow.click();
+        var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[1]/td[2]/a'))
+        installerShow.click();
+        var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[1]/a/p'))
+        versionsShow.click();
+        var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[1]/td[2]/a'))
+        versionShow.click()
+        var projectAdd = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[3]/td[2]/div[2]/button'))
+        projectAdd.click()
+        expect(projectAdd.isDisplayed()).toBe(true);
+    });
+
+    it( 'should show the delete project option for  user', function() {
+        browser.get(baseURL+"#/scenarios/test-scenario");
+        var EC = browser.ExpectedConditions;
+        browser.wait(EC.urlContains(baseURL+ '#/scenarios/test-scenario'), 10000);
+        var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[1]/a/p'))
+        installersShow.click();
+        var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[1]/td[2]/a'))
+        installerShow.click();
+        var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[1]/a/p'))
+        versionsShow.click();
+        var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[1]/td[2]/a'))
+        versionShow.click()
+        var projectsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[3]/td[2]/div[1]/a'))
+        projectsShow.click();
+        var projectDelete = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[3]/td[2]/div[3]/div/table/tbody[1]/tr[1]/td[3]/button'))
+        projectDelete.click()
+        expect(projectDelete.isDisplayed()).toBe(true);
+    });
+
+    it( 'should show the add customs option for  user', function() {
+        browser.get(baseURL+"#/scenarios/test-scenario");
+        var EC = browser.ExpectedConditions;
+        browser.wait(EC.urlContains(baseURL+ '#/scenarios/test-scenario'), 10000);
+        var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[1]/a/p'))
+        installersShow.click();
+        var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[1]/td[2]/a'))
+        installerShow.click();
+        var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[1]/a/p'))
+        versionsShow.click();
+        var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[1]/td[2]/a'))
+        versionShow.click()
+        var projectsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[3]/td[2]/div[1]/a'))
+        projectsShow.click();
+        var projectShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[3]/td[2]/div[3]/div/table/tbody/tr[1]/td[2]/a'))
+        projectShow.click();
+        var customsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[3]/td[2]/div[3]/div/table/tbody[1]/tr[4]/td[2]/a/p'))
+        customsShow.click();
+        var row = element.all(by.repeater('(indexCU, custom) in project.customs')).first();
+        var cells = row.all(by.tagName('td'));
+        expect(cells.get(0).getText()).toContain("dvs");
+        var buttonAdd = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[3]/td[2]/div[3]/div/table/tbody[1]/tr[4]/td[2]/button'))
+        buttonAdd.click()
+        expect(buttonAdd.isDisplayed()).toBe(true);
+    });
+
+    it( 'should show the delete customs option for  user', function() {
+        browser.get(baseURL+"#/scenarios/test-scenario");
+        var EC = browser.ExpectedConditions;
+        browser.wait(EC.urlContains(baseURL+ '#/scenarios/test-scenario'), 10000);
+        var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[1]/a/p'))
+        installersShow.click();
+        var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[1]/td[2]/a'))
+        installerShow.click();
+        var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[1]/a/p'))
+        versionsShow.click();
+        var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[1]/td[2]/a'))
+        versionShow.click()
+        var projectsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[3]/td[2]/div[1]/a'))
+        projectsShow.click();
+        var projectShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[3]/td[2]/div[3]/div/table/tbody/tr[1]/td[2]/a'))
+        projectShow.click();
+        var customsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[3]/td[2]/div[3]/div/table/tbody[1]/tr[4]/td[2]/a/p'))
+        customsShow.click();
+        var row = element.all(by.repeater('(indexCU, custom) in project.customs')).first();
+        var cells = row.all(by.tagName('td'));
+        expect(cells.get(0).getText()).toContain("dvs");
+        var buttonDelete = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[3]/td[2]/div[3]/div/table/tbody[1]/tr[4]/td[2]/table/tbody/tr[1]/td[2]/button'))
+        buttonDelete.click()
+        expect(buttonDelete.isDisplayed()).toBe(true);
+    });
+});
+
+
index f97a621..b943ece 100644 (file)
@@ -662,7 +662,7 @@ describe('testing the scenarios page for anonymous user', function () {
         browser.wait(EC.urlContains(baseURL+ '#/scenarios/test-scenario'), 10000);
     });
 
-    it( 'should not show the add installer option for user', function() {
+    it( 'should show the add installer option for user', function() {
         browser.get(baseURL+"#/scenarios/test-scenario");
         var EC = browser.ExpectedConditions;
         browser.wait(EC.urlContains(baseURL+ '#/scenarios/test-scenario'), 10000);
index cfa8095..d439764 100644 (file)
@@ -123,7 +123,8 @@ module.exports = function (grunt) {
                             '../tests/UI/e2e/resultsControllerSpec.js',
                             '../tests/UI/e2e/scenariosControllerSpec.js',
                             '../tests/UI/e2e/scenarioControllerSpec.js',
-                            '../tests/UI/e2e/deployResultsControllerSpec.js'
+                            '../tests/UI/e2e/deployResultsControllerSpec.js',
+                            '../tests/UI/e2e/authenticateFalseSpec.js'
                         ]
                 }
             },
index 328a5e6..2a73e9b 100644 (file)
@@ -24,7 +24,7 @@
                                     <p ng-if="!ctrl.collapeInstallers">Show</p>
                             </a>
                         </div>
-                        <div class="col-md-1" style="padding:0px" ng-class="{'hidden' : !ctrl.buttonInstaller || !auth.isAuthenticated}">
+                        <div class="col-md-1" style="padding:0px" ng-class="{'hidden' : !ctrl.buttonInstaller || (!auth.isAuthenticated && authenticate)}">
                             <button type="button" class="btn btn-success btn-xs" ng-click="ctrl.openAddInstaller()" ><i class="fa fa-plus"></i>Add</button>
                         </div>
                         <div ng-class="{ 'hidden' : ! ctrl.collapeInstallers } ">
@@ -39,7 +39,7 @@
                                                     <a ng-click="ctrl.expandInstaller(indexI)">{{installer.installer}}</a>
                                             </td>
                                             <td  style="width:80%;border: none; padding: 0px;" ng-class="{'hidden' : !ctrl.buttonInstaller}">
-                                                    <button type="button" ng-class="{'hidden' : !auth.isAuthenticated}"  class="btn btn-danger btn-xs" ng-click="ctrl.openDeleteInstallerModal(installer.installer)" ><i class="fa fa-minus"></i>Delete</button>
+                                                    <button type="button" ng-class="{'hidden' : !auth.isAuthenticated && authenticate}"  class="btn btn-danger btn-xs" ng-click="ctrl.openDeleteInstallerModal(installer.installer)" ><i class="fa fa-minus"></i>Delete</button>
                                             </td>
                                         </tr>
                                         <tr ng-class="{ 'hidden' : ! ctrl.collapeInstaller[indexI] }">
@@ -54,7 +54,7 @@
                                                     </a>
                                                 </div>
                                                 <div class="col-md-1" style="padding:0px" ng-class="{'hidden' : !ctrl.buttonVersion}">
-                                                    <button type="button" class="btn btn-success btn-xs"  ng-class="{'hidden' : !auth.isAuthenticated}" ng-click="ctrl.openAddVersionModal(installer.installer)" ><i class="fa fa-plus"></i>Add</button>
+                                                    <button type="button" class="btn btn-success btn-xs"  ng-class="{'hidden' : !auth.isAuthenticated && authenticate}" ng-click="ctrl.openAddVersionModal(installer.installer)" ><i class="fa fa-plus"></i>Add</button>
                                                 </div>
                                                 <div ng-class="{ 'hidden' : ! ctrl.collapeVersions[indexI] } " class="col-md-12">
                                                     <div class="table-responsive">
@@ -68,7 +68,7 @@
                                                                     <a ng-click="ctrl.expandVersion(indexI,indexV)">{{version.version}}</a>
                                                                 </td>
                                                                 <td  style="width:80%;border: none; padding: 0px;" ng-class="{'hidden' : !ctrl.buttonVersion}">
-                                                                        <button type="button" class="btn btn-danger btn-xs" ng-class="{'hidden' : !auth.isAuthenticated}"  ng-click="ctrl.openDeleteVersionModal(version.version, installer.installer)" ><i class="fa fa-minus"></i>Delete</button>
+                                                                        <button type="button" class="btn btn-danger btn-xs" ng-class="{'hidden' : !auth.isAuthenticated && authenticate}"  ng-click="ctrl.openDeleteVersionModal(version.version, installer.installer)" ><i class="fa fa-minus"></i>Delete</button>
                                                                 </td>
                                                             </tr>
                                                             <tr style="padding:9px" ng-class="{ 'hidden' : ! ctrl.collapeVersion[indexI][indexV] } ">
@@ -89,7 +89,7 @@
                                                                         </a>
                                                                     </div>
                                                                     <div class="col-md-1" style="padding:0px" ng-class="{'hidden' : !ctrl.buttonProject }">
-                                                                        <button type="button" ng-class="{'hidden' : !auth.isAuthenticated}"  class="btn btn-success btn-xs" ng-click="ctrl.openAddProjectModal(version.version,installer.installer)" ><i class="fa fa-plus"></i>Add</button>
+                                                                        <button type="button" ng-class="{'hidden' : !auth.isAuthenticated && authenticate}"  class="btn btn-success btn-xs" ng-click="ctrl.openAddProjectModal(version.version,installer.installer)" ><i class="fa fa-plus"></i>Add</button>
                                                                     </div>
                                                                     <div ng-class="{ 'hidden' : ! ctrl.collapeProjects[indexI][indexV] } " class="col-md-12">
                                                                         <div class="table-responsive">
                                                                                     <a ng-click="ctrl.expandProject(indexI, indexV, indexP)">{{project.project}}</a>
                                                                                 </td>
                                                                                 <td  style="width:80%;border: none; padding: 0px;" ng-class="{'hidden' : !ctrl.buttonProject}">
-                                                                                        <button type="button" class="btn btn-danger btn-xs" ng-class="{'hidden' : !auth.isAuthenticated}"  ng-click="ctrl.openDeleteProjectModal(project,version.version, installer.installer)" ><i class="fa fa-minus"></i>Delete</button>
+                                                                                        <button type="button" class="btn btn-danger btn-xs" ng-class="{'hidden' : !auth.isAuthenticated && authenticate}"  ng-click="ctrl.openDeleteProjectModal(project,version.version, installer.installer)" ><i class="fa fa-minus"></i>Delete</button>
                                                                                 </td>
                                                                             </tr>
                                                                             <tr ng-class="{ 'hidden' : ! ctrl.collapeProject[indexI][indexV][indexP] }">
                                                                                                     </td>
                                                                                                 </tr>
                                                                                             </tbody>
-                                                                                            <tr>
-                                                                                                <button type="button" class="btn btn-success btn-xs" ng-click="ctrl.openAddTrustIndicatorModal(project.project,version.version,installer.installer)"  ng-class="{ 'hidden' : !ctrl.collapeTrustIndicator[index] || !auth.isAuthenticated}">
-                                                                                                    <i class="fa fa-plus"></i>Add</button>
-                                                                                            </tr>
                                                                                             </table>
                                                                                 </td>
                                                                             </tr>
                                                                                                     </td>
                                                                                             </tr>
                                                                                             </tbody>
-                                                                                            <tr>
-                                                                                                <button type="button" class="btn btn-success btn-xs" ng-click="ctrl.openAddScoreModal(project.project,version.version,installer.installer)"  ng-class="{ 'hidden' : !ctrl.collapeScore[index] || !auth.isAuthenticated}"><i class="fa fa-plus"></i>Add</button>
-                                                                                            </tr>
                                                                                             </table>
                                                                                 </td>
                                                                             </tr>
                                                                                                     {{custom}}
                                                                                                 </td>
                                                                                                 <td width="90%" class="podsTableLeftTd">
-                                                                                                        <button type="button" class="btn btn-danger btn-xs" ng-click="ctrl.openDeleteCustomModal(custom,project.project,version.version,installer.installer)" ng-class="{'hidden' : !auth.isAuthenticated}" ><i class="fa fa-minus"></i>Delete</button>
+                                                                                                        <button type="button" class="btn btn-danger btn-xs" ng-click="ctrl.openDeleteCustomModal(custom,project.project,version.version,installer.installer)" ng-class="{'hidden' : !auth.isAuthenticated && authenticate}" ><i class="fa fa-minus"></i>Delete</button>
                                                                                                 </td>
                                                                                             </tr>
                                                                                             <tr ng-repeat-end=>
                                                                                             </tr>
                                                                                             <tr>
-                                                                                                <button type="button" class="btn btn-success btn-xs" ng-click="ctrl.openAddCustomModal(project.project,version.version,installer.installer)"  ng-class="{ 'hidden' : !ctrl.collapeCustom[indexI][indexV][indexP] || !auth.isAuthenticated}"><i class="fa fa-plus"></i>Add</button>
+                                                                                                <button type="button" class="btn btn-success btn-xs" ng-click="ctrl.openAddCustomModal(project.project,version.version,installer.installer)"  ng-class="{ 'hidden' : !ctrl.collapeCustom[indexI][indexV][indexP] || (!auth.isAuthenticated && authenticate)}"><i class="fa fa-plus"></i>Add</button>
                                                                                             </tr>
                                                                                             </tbody>
                                                                                             </table>
index 53eb13a..9935649 100644 (file)
@@ -21,7 +21,7 @@
 
         ScenarioController.$inject = [
         '$scope', '$http', '$filter', '$state', '$window', '$uibModal', 'testapiApiUrl','raiseAlert',
-        'confirmModal'
+        'confirmModal', 'authenticate'
     ];
 
     /**
@@ -30,7 +30,7 @@
      * through Scenario declared in TestAPI.
      */
     function ScenarioController($scope, $http, $filter, $state, $window, $uibModal, testapiApiUrl,
-        raiseAlert, confirmModal) {
+        raiseAlert, confirmModal, authenticate) {
         var ctrl = this;
         ctrl.name = $state.params['name'];
         ctrl.url = testapiApiUrl + '/scenarios?name=' + ctrl.name;
index 26dfd08..63e1e97 100644 (file)
@@ -1,2 +1,4 @@
-{"testapiApiUrl": "http://localhost:8000/api/v1",
-"authenticate": true}
+{
+  "testapiApiUrl": "http://localhost:8000/api/v1",
+  "authenticate": true
+}
\ No newline at end of file