summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testapi/opnfv_testapi/tests/UI/e2e/homeControllerSpec.js56
-rw-r--r--testapi/opnfv_testapi/tests/UI/e2e/podsControllerSpec.js390
-rw-r--r--testapi/opnfv_testapi/tests/UI/e2e/projectControllerSpec.js354
-rw-r--r--testapi/opnfv_testapi/tests/UI/e2e/projectsControllerSpec.js416
-rw-r--r--testapi/opnfv_testapi/tests/UI/e2e/resultsControllerSpec.js20
-rw-r--r--testapi/opnfv_testapi/tests/UI/e2e/scenarioControllerSpec.js1041
-rw-r--r--testapi/opnfv_testapi/tests/UI/e2e/scenariosControllerSpec.js725
-rw-r--r--testapi/opnfv_testapi/ui/Gruntfile.js11
-rw-r--r--testapi/opnfv_testapi/ui/components/pods/pods.html13
-rw-r--r--testapi/opnfv_testapi/ui/components/pods/podsController.js41
-rw-r--r--testapi/opnfv_testapi/ui/components/projects/projects.html2
-rw-r--r--testapi/opnfv_testapi/ui/components/projects/projectsController.js4
-rw-r--r--testapi/opnfv_testapi/ui/components/results/resultsController.js217
-rw-r--r--testapi/opnfv_testapi/ui/components/scenarios/modals/projectModal.html62
-rw-r--r--testapi/opnfv_testapi/ui/components/scenarios/scenario/scenario.html463
-rw-r--r--testapi/opnfv_testapi/ui/components/scenarios/scenario/scenarioController.js319
-rw-r--r--testapi/opnfv_testapi/ui/components/scenarios/scenarios.html4
-rw-r--r--testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js142
18 files changed, 2845 insertions, 1435 deletions
diff --git a/testapi/opnfv_testapi/tests/UI/e2e/homeControllerSpec.js b/testapi/opnfv_testapi/tests/UI/e2e/homeControllerSpec.js
new file mode 100644
index 0000000..57794a6
--- /dev/null
+++ b/testapi/opnfv_testapi/tests/UI/e2e/homeControllerSpec.js
@@ -0,0 +1,56 @@
+'use strict';
+
+var mock = require('protractor-http-mock');
+var baseURL = "http://localhost:8000"
+describe('testing the home page for anonymous user', function () {
+
+ it( 'should navigate to pods link ', function() {
+ browser.get(baseURL);
+ var signOut = element(by.linkText('Sign In / Sign Up'))
+ expect(signOut.isDisplayed()).toBe(true);
+ });
+});
+
+describe('testing the home page for 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"}]
+ }
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/profile',
+ method: 'GET'
+ },
+ response: {
+ data: {
+ "fullname": "Test User", "_id": "79f82eey9a00c84bfhc7aed",
+ "user": "testUser", "groups": ["opnfv-testapi-users",
+ "opnfv-gerrit-functest-submitters"], "email": "testuser@test.com"
+ }
+ }
+ }])
+ });
+
+ afterEach(function(){
+ mock.teardown();
+ });
+
+ it( 'should show the profile page', function() {
+ browser.get(baseURL);
+ var profile = element(by.linkText('Profile'))
+ expect(profile.isDisplayed()).toBe(true);
+ profile.click()
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.urlContains(baseURL+ '/#/profile'), 10000);
+ });
+});
diff --git a/testapi/opnfv_testapi/tests/UI/e2e/podsControllerSpec.js b/testapi/opnfv_testapi/tests/UI/e2e/podsControllerSpec.js
index c3961ab..97e61ad 100644
--- a/testapi/opnfv_testapi/tests/UI/e2e/podsControllerSpec.js
+++ b/testapi/opnfv_testapi/tests/UI/e2e/podsControllerSpec.js
@@ -17,7 +17,24 @@ describe('testing the Pods page for anonymous user', function () {
creation_date: "2017-10-25 11:58:25.926168"}]
}
}
- }]);
+ },
+ {
+ request: {
+ path: '/api/v1/pods',
+ method: 'GET',
+ queryString: {
+ name: 'test'
+ }
+ },
+ 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(){
@@ -42,81 +59,249 @@ describe('testing the Pods page for anonymous user', function () {
expect(buttonFilter.isDisplayed()).toBe(true)
});
- it('clear button is visible for anonymous user', function () {
- var buttonClear = element(by.buttonText('Clear'));
- expect(buttonClear.isDisplayed()).toBe(true)
+ it('Delete button is visible for anonymous user', function () {
+ var buttonDelete = element(by.buttonText('Delete'));
+ expect(buttonDelete.isDisplayed()).toBeFalsy();
});
- it('Show results when click filter button', function () {
+ it('Show results', function () {
+ var row = element.all(by.repeater('(index, pod) in ctrl.data.pods')).first();
+ var cells = row.all(by.tagName('td'));
+ expect(cells.get(1).getText()).toContain("test");
+ });
+
+ it('Show relevant results to the filter', function () {
+ var filter = element(by.model('ctrl.filterText'));
+ filter.sendKeys('test');
var buttonFilter = element(by.buttonText('Filter'));
- buttonFilter.click();
- var pod = element(by.css('.show-pod'));
- expect(pod.isPresent()).toBe(true);
+ var row = element.all(by.repeater('(index, pod) in ctrl.data.pods')).first();
+ var cells = row.all(by.tagName('td'));
+ expect(cells.get(1).getText()).toContain("test");
});
- it('Show results when click clear button', function () {
+ it('delete Operation is not visible for user ', function () {
browser.get(baseURL+'#/pods');
- var buttonClear = element(by.buttonText('Clear'));
- buttonClear.click();
- var pod = element(by.css('.show-pod'));
- expect(pod.isPresent()).toBe(true);
+ var deleteOperation = element(by.css('a[title=Delete]'));
+ expect(deleteOperation.isDisplayed()).toBeFalsy();
});
- it('If details is not shown then show details when click the link',function() {
- expect(element(by.css('.show-pod.hidden')).isPresent()).toBe(true);
- var podslink = element(by.linkText('test')).click();
- expect(element(by.css('.show-pod.hidden')).isPresent()).toBe(false);
- });
- it('If details is shown then hide details when click the link',function() {
- expect(element(by.css('.show-pod.hidden')).isPresent()).toBe(false);
- var podslink = element(by.linkText('test')).click();
- expect(element(by.css('.show-pod.hidden')).isPresent()).toBe(true);
+});
+
+describe('testing the Pods page for authorized 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"}]
+ }
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/profile',
+ method: 'GET'
+ },
+ response: {
+ data: {
+ "fullname": "Test User", "_id": "79f82eey9a00c84bfhc7aed",
+ "user": "testUser", "groups": ["opnfv-testapi-users",
+ "opnfv-gerrit-functest-submitters"], "email": "testuser@test.com"
+ }
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/pods',
+ method: 'GET',
+ queryString: {
+ name: 'test'
+ }
+ },
+ 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"}]
+ }
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/pods/test',
+ method: 'DELETE'
+ },
+ response: {
+ data: {
+ href: baseURL+"/api/v1/pods/test"
+ }
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/pods/test1',
+ method: 'DELETE'
+ },
+ response: {
+ data: {
+ href: baseURL+"/api/v1/pods/test1"
+ }
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/pods',
+ method: 'POST'
+ },
+ response: {
+ data: {
+ href: baseURL+"/api/v1/pods/test1"
+ }
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/pods/test',
+ method: 'GET'
+ },
+ response: {
+ data: {role: "community-ci", name: "test", owner: "testUser",
+ details: "DemoDetails", mode: "metal", _id: "59f02f099a07c84bfc5c7aed",
+ creation_date: "2017-10-25 11:58:25.926168"}
+ }
+ }
+ ]);
});
- it('If backend is not responding then show error when click filter button', function () {
- browser.get(baseURL + '/#/pods');
+ afterEach(function(){
mock.teardown();
+ });
+
+ it( 'should navigate to pods link ', function() {
+ browser.get(baseURL);
+ var podslink = element(by.linkText('Pods')).click();
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.urlContains(baseURL+ '/#/pods'), 10000);
+ });
+
+ it('create button is not visible for user', function () {
+ browser.get(baseURL+'#/pods');
+ var buttonCreate = element(by.buttonText('Create'));
+ expect(buttonCreate.isDisplayed()).toBe(true);
+ });
+
+ it('filter button is visible for user', function () {
var buttonFilter = element(by.buttonText('Filter'));
- buttonFilter.click().then(function(){
- expect(element(by.css('.alert.alert-danger.ng-binding.ng-scope'))
- .isDisplayed()).toBe(true);
- });
+ expect(buttonFilter.isDisplayed()).toBe(true)
});
-});
+ it('Delete button is visible for user', function () {
+ var buttonDelete = element(by.buttonText('Delete'));
+ expect(buttonDelete.isDisplayed()).toBe(true)
+ });
-describe('testing the Pods page for authorized user', function () {
+ it('Show results', function () {
+ var row = element.all(by.repeater('(index, pod) in ctrl.data.pods')).first();
+ var cells = row.all(by.tagName('td'));
+ expect(cells.get(1).getText()).toContain("test");
+ });
- beforeEach(function(){
- mock([
- {
+ it('Show relevant results to the filter', function () {
+ var filter = element(by.model('ctrl.filterText'));
+ filter.sendKeys('test');
+ var buttonFilter = element(by.buttonText('Filter'));
+ var row = element.all(by.repeater('(index, pod) in ctrl.data.pods')).first();
+ var cells = row.all(by.tagName('td'));
+ expect(cells.get(1).getText()).toContain("test");
+ });
+
+ it('delete Operation is visible for user ', function () {
+ browser.get(baseURL+'#/pods');
+ var deleteOperation = element(by.css('a[title=Delete]'));
+ expect(deleteOperation.isDisplayed()).toBe(true);
+ });
+
+ it('Batch Delete the pods ', function () {
+ browser.get(baseURL+"#/pods");
+ var checkBox = element(by.model('ctrl.checkBox[index]'));
+ checkBox.click();
+ var buttonDelete = element(by.buttonText('Delete'));;
+ buttonDelete.click();
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.cssContainingText(".alert","Delete Success"))
+ .isDisplayed()).toBe(true);
+ });
+
+ it('Delete the pods ', function () {
+ browser.get(baseURL+"#/pods");
+ var deleteOperation = element(by.css('a[title=Delete]'));
+ deleteOperation.click();
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.cssContainingText(".alert","Delete Success"))
+ .isDisplayed()).toBe(true);
+ });
+
+ it('Create the pod', function () {
+ browser.get(baseURL+"#/pods");
+ var buttonCreate = element(by.buttonText('Create'));
+ buttonCreate.click();
+ var name = element(by.model('PodModalCtrl.pod.name'));
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.visibilityOf(name), 5000);
+ name.sendKeys('test1');
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.cssContainingText(".alert","Create Success"))
+ .isDisplayed()).toBe(true);
+ });
+
+ it('Showing error when creating with a empty name ', function () {
+ browser.get(baseURL+"#/pods");
+ var buttonCreate = element(by.buttonText('Create'));
+ buttonCreate.click();
+ var name = element(by.model('PodModalCtrl.pod.name'));
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.visibilityOf(name), 5000);
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click()
+ expect(element(by.cssContainingText(".alert","Name is missing."))
+ .isDisplayed()).toBe(true);
+ });
+
+ it('cancel the delete confimation modal of the pod ', function () {
+ browser.get(baseURL+"#/pods");
+ var deleteOperation = element(by.css('a[title=Delete]'));
+ deleteOperation.click();
+ var buttonCancel = element(by.buttonText('Cancel'));
+ buttonCancel.click();
+ expect(buttonCancel.isPresent()).toBe(false);
+ });
+
+ it('Delete the pods which do not exist ', function () {
+ mock.teardown();
+ mock([{
request: {
- path: '/api/v1/pods',
- method: 'POST'
+ path: '/api/v1/pods',
+ method: 'GET'
},
response: {
data: {
- href: baseURL+"/api/v1/pods/test"
+ pods: [{role: "community-ci", name: "test1", owner: "testUser",
+ details: "DemoDetails", mode: "metal", _id: "59f02f099a07c84bfc5c7aed",
+ creation_date: "2017-10-25 11:58:25.926168"}]
}
- }
- },
- {
- request: {
- path: '/api/v1/pods',
- method: 'POST',
- data: {
- name: 'test1',
- details : 'DemoDetails',
- role : 'community-ci',
- mode : 'metal'
- }
- },
- response: {
- status : 403
- }
- },
- {
+ }
+ },
+ {
request: {
path: '/api/v1/profile',
method: 'GET'
@@ -127,57 +312,48 @@ describe('testing the Pods page for authorized user', function () {
"user": "testUser", "groups": ["opnfv-testapi-users",
"opnfv-gerrit-functest-submitters"], "email": "testuser@test.com"
}
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/pods/test1',
+ method: 'DELETE'
+ },
+ response: {
+ status : 403,
+ data : 'pods do not exist'
}
}
]);
+ browser.get(baseURL+"#/pods");
+ var deleteOperation = element(by.css('a[title=Delete]'));
+ deleteOperation.click();
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.css(".alert.alert-danger"))
+ .isDisplayed()).toBe(true);
});
- afterEach(function(){
- mock.teardown();
- });
-
- it('create button is visible for authorized user', function () {
- browser.get(baseURL + '/#/pods');
- var buttonCreate = element(by.buttonText('Create'));
- expect(buttonCreate.isDisplayed()).toBe(true);
+ it('view the test case ', function () {
+ browser.get(baseURL+"#/pods");
+ var viewOperation = element(by.css('a[class=text-info]'));
+ viewOperation.click();
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.urlContains('#/pods/test'), 10000);
});
- it('Do not show error if input is acceptable', function () {
- var name = element(by.model('ctrl.name'));
- var details = element(by.model('ctrl.details'));
- name.sendKeys('test');
- details.sendKeys('DemoDetails');
- var buttonCreate = element(by.buttonText('Create'));
- buttonCreate.click().then(function(){
- expect(element(by.css('.alert.alert-danger.ng-binding.ng-scope'))
- .isDisplayed()).toBe(false);
- });
- });
-
- it('Show error when user click the create button with a empty name', function () {
- browser.get(baseURL+ '/#/pods');
- var details = element(by.model('ctrl.details'));
- details.sendKeys('DemoDetails');
- var buttonCreate = element(by.buttonText('Create'));
- buttonCreate.click();
- expect(element(by.cssContainingText(".alert","Name is missing.")).isDisplayed()).toBe(true);
- });
-
- it('Show error when user click the create button with an already existing name', function () {
- browser.get(baseURL+ '/#/pods');
- var name = element(by.model('ctrl.name'));
- var details = element(by.model('ctrl.details'));
- name.sendKeys('test1');
- details.sendKeys('DemoDetails');
- var buttonCreate = element(by.buttonText('Create'));
- buttonCreate.click();
- expect(element(by.cssContainingText(".alert","Error creating the new pod from server: undefined")).isDisplayed()).toBe(true);
- });
-
- it('If backend is not responding then show error when user click the create button',function(){
+ it('Show error if server is not responding', function () {
mock.teardown();
- mock([
- {
+ mock([{
+ request: {
+ path: '/api/v1/pods',
+ method: 'GET'
+ },
+ response: {
+ status : 404
+ }
+ },
+ {
request: {
path: '/api/v1/profile',
method: 'GET'
@@ -185,21 +361,15 @@ describe('testing the Pods page for authorized user', function () {
response: {
data: {
"fullname": "Test User", "_id": "79f82eey9a00c84bfhc7aed",
- "user": "testUser", "groups": ["opnfv-testapi-users"],
- "email": "testuser@test.com"
+ "user": "testUser", "groups": ["opnfv-testapi-users",
+ "opnfv-gerrit-functest-submitters"], "email": "testuser@test.com"
}
- }
}
+ },
]);
- browser.get(baseURL+ '/#/pods');
- var name = element(by.model('ctrl.name'));
- var details = element(by.model('ctrl.details'));
- name.sendKeys('test');
- details.sendKeys('DemoDetails');
- var buttonCreate = element(by.buttonText('Create'));
- buttonCreate.click().then(function(){
- expect(element(by.css('.alert.alert-danger.ng-binding'))
- .isDisplayed()).toBe(true);
- });
+ browser.get(baseURL+"#/pods");
+ expect(element(by.css(".alert.alert-danger"))
+ .isDisplayed()).toBe(true);
});
+
}); \ No newline at end of file
diff --git a/testapi/opnfv_testapi/tests/UI/e2e/projectControllerSpec.js b/testapi/opnfv_testapi/tests/UI/e2e/projectControllerSpec.js
deleted file mode 100644
index 475e037..0000000
--- a/testapi/opnfv_testapi/tests/UI/e2e/projectControllerSpec.js
+++ /dev/null
@@ -1,354 +0,0 @@
-'use strict';
-
-var mock = require('protractor-http-mock');
-var baseURL = "http://localhost:8000/#/"
-
-describe('testing the Project Link for anonymous user', function () {
- beforeEach(function(){
- mock([
- {
- request: {
- path: '/api/v1/projects/testproject',
- method: 'GET'
- },
- response: {
- data: {
- "owner": "thuva4",
- "_id": "5a0c022f9a07c846d3c2cc94",
- "creation_date": "2017-11-15 14:30:31.200259",
- "description": "dsfsd",
- "name": "testproject"
- }
- }
- }
- ]);
- });
-
- afterEach(function(){
- mock.teardown();
- });
-
- it( 'navigate to the project page', function() {
- browser.get(baseURL+"projects/testproject");
- var EC = browser.ExpectedConditions;
- browser.wait(EC.urlContains(baseURL+ 'projects/testproject'), 10000);
- });
-
- it('show the project details for anonymous user ', function(){
- var table = $$('.projects-table.ng-scope tr');
- var projectDetailsLable = ['Name','Description','Creation date']
- var projectDetails = ['testproject', 'dsfsd','2017-11-15 14:30:31.200259']
- table.each(function(row,index) {
- var rowElems = row.$$('td');
- expect(rowElems.count()).toBe(2);
- expect(rowElems.get(0).getText()).toMatch(projectDetailsLable[index]);
- expect(rowElems.get(1).getText()).toMatch(projectDetails[index]);
- });
- });
-
- it('should not show the update & delete button', function(){
- var buttonUpdate = element(by.buttonText('Update Project'));
- var buttonDelete = element(by.buttonText('Delete Project'));
- expect(buttonUpdate.isDisplayed()).toBeFalsy();
- expect(buttonDelete.isDisplayed()).toBeFalsy();
- });
-
-});
-
-
-describe('testing the Project Link for authorized user(not a submitter)', function () {
- beforeEach(function(){
- mock([
- {
- request: {
- path: '/api/v1/projects/testproject',
- method: 'GET'
- },
- response: {
- data: {
- "owner": "thuva4",
- "_id": "5a0c022f9a07c846d3c2cc94",
- "creation_date": "2017-11-15 14:30:31.200259",
- "description": "dsfsd",
- "name": "testproject"
- }
- }
- },
- {
- request: {
- path: '/api/v1/profile',
- method: 'GET'
- },
- response: {
- data: {
- "fullname": "Test User", "_id": "79f82eey9a00c84bfhc7aed",
- "user": "testUser", "groups": ["opnfv-testapi-users"],
- "email": "testuser@test.com"
- }
- }
- }
- ]);
- });
-
- afterEach(function(){
- mock.teardown();
- });
-
- it( 'navigate to the project page', function() {
- browser.get(baseURL+"projects/testproject");
- var EC = browser.ExpectedConditions;
- browser.wait(EC.urlContains(baseURL+ 'projects/testproject'), 10000);
- });
-
- it('show the project details for user ', function(){
- var table = $$('.projects-table.ng-scope tr');
- var projectDetailsLable = ['Name','Description','Creation date']
- var projectDetails = ['testproject', 'dsfsd','2017-11-15 14:30:31.200259']
- table.each(function(row,index) {
- var rowElems = row.$$('td');
- expect(rowElems.count()).toBe(2);
- expect(rowElems.get(0).getText()).toMatch(projectDetailsLable[index]);
- expect(rowElems.get(1).getText()).toMatch(projectDetails[index]);
- });
- });
-
- it('should not show the update & delete button', function(){
- var buttonUpdate = element(by.buttonText('Update Project'));
- var buttonDelete = element(by.buttonText('Delete Project'));
- expect(buttonUpdate.isDisplayed()).toBeFalsy();
- expect(buttonDelete.isDisplayed()).toBeFalsy();
- });
-
-});
-
-describe('testing the Project Link for authorized user(a submitter)', function () {
- beforeEach(function(){
- mock([
- {
- request: {
- path: '/api/v1/projects/testproject',
- method: 'GET'
- },
- response: {
- data: {
- "owner": "thuva4",
- "_id": "5a0c022f9a07c846d3c2cc94",
- "creation_date": "2017-11-15 14:30:31.200259",
- "description": "dsfsd",
- "name": "testproject"
- }
- }
- },
- {
- request: {
- path: '/api/v1/projects/testproject1',
- method: 'GET'
- },
- response: {
- data: {
- "owner": "thuva4",
- "_id": "5a0c022f9a07c846d3c2cc94",
- "creation_date": "2017-11-15 14:30:31.200259",
- "description": "dsfsd",
- "name": "testproject1"
- }
- }
- },
- {
- 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"
- }
- ]
- }
- }
- },
- {
- request: {
- path: '/api/v1/projects/testproject',
- method: 'DELETE'
- },
- response: {
- status : 200
- }
- },
- {
- request: {
- path: '/api/v1/projects/testproject1',
- method: 'DELETE'
- },
- response: {
- status : 403
- }
- },
- {
- request: {
- path: '/api/v1/projects/testproject',
- method: 'PUT',
- data: {
- name: 'testProject2',
- description : 'demoDescription',
- }
- },
- response: {
- status : 200,
- data : {
- "owner": "thuva4",
- "_id": "5a0c022f9a07c846d3c2cc94",
- "creation_date": "2017-11-15 14:30:31.200259",
- "description": "dsfsd",
- "name": "testproject2"
- }
- }
- },
- {
- request: {
- path: '/api/v1/projects/testproject',
- method: 'PUT',
- data: {
- name: 'testProject1',
- description : 'demoDescription',
- }
- },
- response: {
- status : 403
- }
- },
- {
- request: {
- path: '/api/v1/profile',
- method: 'GET'
- },
- response: {
- data: {
- "fullname": "Test User", "_id": "79f82eey9a00c84bfhc7aed",
- "user": "testUser", "groups": ["opnfv-testapi-users",
- "opnfv-gerrit-testProject-submitters",
- "opnfv-gerrit-testProject2-submitters" ],
- "email": "testuser@test.com"
- }
- }
- },
- ]);
- });
-
- afterEach(function(){
- mock.teardown();
- });
-
- it( 'navigate to the project page', function() {
- browser.get(baseURL+"projects/testproject");
- var EC = browser.ExpectedConditions;
- browser.wait(EC.urlContains(baseURL+ 'projects/testproject'), 10000);
- });
-
- it('show the project details for user ', function(){
- var table = $$('.projects-table.ng-scope tr');
- var projectDetailsLable = ['Name','Description','Creation date']
- var projectDetails = ['testproject', 'dsfsd','2017-11-15 14:30:31.200259']
- table.each(function(row,index) {
- var rowElems = row.$$('td');
- expect(rowElems.count()).toBe(2);
- expect(rowElems.get(0).getText()).toMatch(projectDetailsLable[index]);
- expect(rowElems.get(1).getText()).toMatch(projectDetails[index]);
- });
- });
-
- it('should show the update & delete button', function(){
- var buttonUpdate = element(by.buttonText('Update Project'));
- var buttonDelete = element(by.buttonText('Delete Project'));
- expect(buttonUpdate.isDisplayed()).toBe(true);
- expect(buttonDelete.isDisplayed()).toBe(true);
- });
-
- it('show the update modal when user clicks the update button', function(){
- browser.get(baseURL+"projects/testproject");
- var buttonDelete = element(by.buttonText('Update Project')).click();
- var EC = protractor.ExpectedConditions;
- var elm = element(by.css(".modal-body"));
- browser.wait(EC.textToBePresentInElement(elm, "Update"), 5000);
- expect(elm.isDisplayed()).toBe(true);
- var buttonCancel = element(by.buttonText('Cancel')).click();
- expect(elm.isPresent()).toEqual(false);
- });
-
- it('send a update request to server and show success when we click ok', function(){
- browser.get(baseURL+"projects/testproject");
- var buttonUpdate = element(by.buttonText('Update Project')).click();
- var EC = protractor.ExpectedConditions;
- var elm = element(by.css(".modal-body"));
- browser.wait(EC.textToBePresentInElement(elm, "Update"), 5000);
- expect(elm.isDisplayed()).toBe(true);
- var name = element(by.model('updateModal.name'));
- var description = element(by.model('updateModal.description'));
- name.click().clear().sendKeys('testProject2');
- description.click().clear().sendKeys('demoDescription');
- var buttonOk = element(by.buttonText('Ok')).click();
- expect(element(by.cssContainingText(".alert.alert-success",
- "Update Success"))
- .isDisplayed()).toBe(true);
- });
-
- it('show error when server send a error response when we click ok', function(){
- browser.get(baseURL+"projects/testproject");
- var buttonUpdate = element(by.buttonText('Update Project')).click();
- var EC = protractor.ExpectedConditions;
- var elm = element(by.css(".modal-body"));
- browser.wait(EC.textToBePresentInElement(elm, "Update"), 5000);
- expect(elm.isDisplayed()).toBe(true);
- var name = element(by.model('updateModal.name'));
- var description = element(by.model('updateModal.description'));
- name.click().clear().sendKeys('testProject1');
- description.click().clear().sendKeys('demoDescription');
- var buttonOk = element(by.buttonText('Ok')).click();
- expect(element(by.cssContainingText(".alert",
- "Error updating the existing Project from server: undefined"))
- .isDisplayed()).toBe(true);
- });
-
- it('show the confirm modal when user clicks the delete button', function(){
- var buttonDelete = element(by.buttonText('Delete Project')).click();
- var EC = protractor.ExpectedConditions;
- var elm = element(by.css(".modal-body"));
- browser.wait(EC.textToBePresentInElement(elm, "You are about to delete."), 5000);
- expect(elm.isDisplayed()).toBe(true);
- var buttonCancel = element(by.buttonText('Cancel')).click();
- expect(elm.isPresent()).toEqual(false);
- });
-
- it('send a delete request to server when we click ok', function(){
- var buttonDelete = element(by.buttonText('Delete Project')).click();
- var EC = protractor.ExpectedConditions;
- var elm = element(by.css(".modal-body"));
- browser.wait(EC.textToBePresentInElement(elm, "You are about to delete."), 5000);
- expect(elm.isDisplayed()).toBe(true);
- var buttonCancel = element(by.buttonText('Ok')).click();
- browser.wait(EC.urlContains(baseURL+ 'projects'), 10000);
- });
-
- it('show the error message when we click ok', function(){
- browser.get(baseURL+"projects/testproject1");
- var buttonDelete = element(by.buttonText('Delete Project')).click();
- var EC = protractor.ExpectedConditions;
- var elm = element(by.css(".modal-body"));
- browser.wait(EC.textToBePresentInElement(elm, "You are about to delete."), 5000);
- expect(elm.isDisplayed()).toBe(true);
- var buttonCancel = element(by.buttonText('Ok')).click();
- // browser.wait(EC.urlContains(baseURL+ 'projects'), 10000);
- expect(element(by.cssContainingText(".alert",
- "Error deleting project from server: undefined"))
- .isDisplayed()).toBe(true);
- // browser.pause();
- });
-
-}); \ No newline at end of file
diff --git a/testapi/opnfv_testapi/tests/UI/e2e/projectsControllerSpec.js b/testapi/opnfv_testapi/tests/UI/e2e/projectsControllerSpec.js
index 64a5aeb..8b908c9 100644
--- a/testapi/opnfv_testapi/tests/UI/e2e/projectsControllerSpec.js
+++ b/testapi/opnfv_testapi/tests/UI/e2e/projectsControllerSpec.js
@@ -51,18 +51,30 @@ describe('testing the Projects Link for anonymous user', function () {
expect(buttonCreate.isDisplayed()).toBeFalsy();
});
- it('Show projects list when user comes to the projects page', function () {
- var firstBookName = element(by.repeater('(index, project) in ctrl.data.projects').
- row(0).column('{{project.name}}'));
- expect(firstBookName).toBeDefined();
+ it('Delete button is not visible for anonymous user ', function () {
+ browser.get(baseURL+'#/projects');
+ var buttonCreate = element(by.buttonText('Create'));
+ expect(buttonCreate.isDisplayed()).toBeFalsy();
});
- it('redirect to project page when user clicks a project',function(){
- var projectlink = element(by.linkText('testproject')).click();
- var EC = browser.ExpectedConditions;
- browser.wait(EC.urlContains(baseURL+ '/#/projects/testproject'), 10000);
+ it('Show projects list when anonymous user comes to the projects page', function () {
+ var row = element.all(by.repeater('(index, project) in ctrl.data.projects')).first();
+ var cells = row.all(by.tagName('td'));
+ expect(cells.get(1).getText()).toContain("testproject");
});
+ // it('redirect to project page when user clicks a project',function(){
+ // var projectlink = element(by.linkText('testproject')).click();
+ // var EC = browser.ExpectedConditions;
+ // browser.wait(EC.urlContains(baseURL+ '/#/projects/testproject'), 10000);
+ // });
+
+ it('delete Operation is not visible for anonymous user ', function () {
+ browser.get(baseURL+'#/projects');
+ var deleteOperation = element(by.css('a[title=Delete]'));
+ expect(deleteOperation.isDisplayed()).toBeFalsy();
+ });
+
});
describe('testing the Project Link for user who is not in submitter group', function () {
@@ -70,6 +82,26 @@ describe('testing the Project Link for user who is not in submitter group', func
mock([
{
request: {
+ path: '/api/v1/projects',
+ method: 'GET',
+ queryString: {
+ name: 'test'
+ }
+ },
+ response: {
+ data: {
+ "projects": [
+ {
+ "_id": "5a0c1c9a9a07c846d3a7247b",
+ "creation_date": "2017-11-15 16:23:14.217093",
+ "description": "sdgfd",
+ "name": "test"
+ }]
+ }
+ }
+ },
+ {
+ request: {
path: '/api/v1/profile',
method: 'GET'
},
@@ -80,6 +112,25 @@ describe('testing the Project Link for user who is not in submitter group', func
"email": "testuser@test.com"
}
}
+ },
+ {
+ 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"
+ }
+ ]
+ }
+ }
}
]);
});
@@ -106,6 +157,28 @@ describe('testing the Project Link for user who is not in submitter group', func
var buttonCreate = element(by.buttonText('Create'));
expect(buttonCreate.isDisplayed()).toBeFalsy();
});
+
+ it('Delete button is not visible for user ', function () {
+ browser.get(baseURL+'#/projects');
+ var buttonCreate = element(by.buttonText('Create'));
+ expect(buttonCreate.isDisplayed()).toBeFalsy();
+ });
+
+ it('delete Operation is not visible for user ', function () {
+ browser.get(baseURL+'#/projects');
+ var deleteOperation = element(by.css('a[title=Delete]'));
+ expect(deleteOperation.isDisplayed()).toBeFalsy();
+ });
+
+ it('Show relevant results to the filter', function () {
+ var filter = element(by.model('ctrl.filterText'));
+ filter.sendKeys('test');
+ var buttonFilter = element(by.buttonText('Filter'));
+ buttonFilter.click()
+ var row = element.all(by.repeater('(index, project) in ctrl.data.projects')).first();
+ var cells = row.all(by.tagName('td'));
+ expect(cells.get(1).getText()).toContain("test");
+ });
})
describe('testing the Project Link for user who is in submitter group', function () {
@@ -139,6 +212,28 @@ describe('testing the Project Link for user who is in submitter group', function
},
{
request: {
+ path: '/api/v1/projects/vsfv',
+ method: 'DELETE'
+ },
+ response: {
+ data: {
+ href: baseURL+"/api/v1/projects/testProject1"
+ }
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/projects/vsfv',
+ method: 'PUT'
+ },
+ response: {
+ data: {
+ href: baseURL+"/api/v1/projects/testProject1"
+ }
+ }
+ },
+ {
+ request: {
path: '/api/v1/projects',
method: 'POST',
data: {
@@ -163,6 +258,23 @@ describe('testing the Project Link for user who is in submitter group', function
status : 403,
data : 'You do not have permission to perform this action'
}
+ },
+ {
+ request: {
+ path: '/api/v1/projects',
+ method: 'GET'
+ },
+ response: {
+ data : {
+ "projects": [
+ {
+ "_id": "5a0c1c9a9a07c846d3a7247b",
+ "creation_date": "2017-11-15 16:23:14.217093",
+ "description": "sdgfd",
+ "name": "vsfv"
+ }]
+ }
+ }
}
]);
});
@@ -190,53 +302,247 @@ describe('testing the Project Link for user who is in submitter group', function
expect(buttonCreate.isDisplayed()).toBe(true);
});
- it('Show error when user click the create button with a empty name', function () {
- browser.get(baseURL+ '/#/projects');
- var description = element(by.model('ctrl.description'));
- description.sendKeys('DemoDescription');
- var buttonCreate = element(by.buttonText('Create'));
- buttonCreate.click();
- expect(element(by.cssContainingText(".alert","Name is missing."))
+ it('Delete button is not visible for anonymous user ', function () {
+ browser.get(baseURL+'#/projects');
+ var buttonCreate = element(by.buttonText('Create'));
+ expect(buttonCreate.isDisplayed()).toBe(true);
+ });
+
+ it('delete Operation is not 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);
+ });
+
+ it('Create the Project', function () {
+ browser.get(baseURL+"#/projects");
+ var buttonCreate = element(by.buttonText('Create'));
+ buttonCreate.click();
+ var name = element(by.model('ProjectModalCtrl.project.name'));
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.visibilityOf(name), 5000);
+ name.sendKeys('testproject');
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.cssContainingText(".alert","Project is successfully created."))
.isDisplayed()).toBe(true);
- });
+ });
- it('Show error when user click the create button with an already existing name', function () {
- browser.get(baseURL+ '/#/projects');
- var name = element(by.model('ctrl.name'));
- var details = element(by.model('ctrl.description'));
- name.sendKeys('testProject2');
- details.sendKeys('demoDescription');
- var buttonCreate = element(by.buttonText('Create'));
- buttonCreate.click();
- expect(element(by.cssContainingText(".alert",
- "Error creating the new Project from server:undefined"))
+ it('Show error if user doesnt have permission to Create the Project', function () {
+ browser.get(baseURL+"#/projects");
+ var buttonCreate = element(by.buttonText('Create'));
+ buttonCreate.click();
+ var name = element(by.model('ProjectModalCtrl.project.name'));
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.visibilityOf(name), 5000);
+ var description = element(by.model('ProjectModalCtrl.project.description'));
+ name.sendKeys('testProject2');
+ description.sendKeys('demoDescription');
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.css(".alert.alert-danger")).isDisplayed()).toBe(true);
+ });
+
+ it('Showing error when creating with a empty name ', function () {
+ browser.get(baseURL+"#/projects");
+ var buttonCreate = element(by.buttonText('Create'));
+ buttonCreate.click();
+ var name = element(by.model('ProjectModalCtrl.project.name'));
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.visibilityOf(name), 5000);
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.cssContainingText(".alert","Name is missing."))
.isDisplayed()).toBe(true);
});
- it('Show error when user try to create a project which he is not belonged to ', function () {
- browser.get(baseURL+ '/#/projects');
- var name = element(by.model('ctrl.name'));
- var details = element(by.model('ctrl.description'));
- name.sendKeys('testProject3');
- details.sendKeys('demoDescription');
- var buttonCreate = element(by.buttonText('Create'));
+ it('Show error when user click the create button with an already existing name', function () {
+ browser.get(baseURL+"#/projects");
+ var buttonCreate = element(by.buttonText('Create'));
buttonCreate.click();
- expect(element(by.cssContainingText(".alert",
- 'Error creating the new Project from server:"You do not have permission to perform this action"')).isDisplayed())
- .toBe(true);
+ var name = element(by.model('ProjectModalCtrl.project.name'));
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.visibilityOf(name), 5000);
+ var description = element(by.model('ProjectModalCtrl.project.description'));
+ name.sendKeys('testProject3');
+ description.sendKeys('demoDescription');
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.css(".alert.alert-danger")).isDisplayed()).toBe(true);
});
- it('Do not show error if input is acceptable', function () {
- var name = element(by.model('ctrl.name'));
- var details = element(by.model('ctrl.description'));
- name.sendKeys('testProject1');
- details.sendKeys('demoDescription');
- var buttonCreate = element(by.buttonText('Create'));
- buttonCreate.click().then(function(){
- expect(element(by.cssContainingText(".alert",
- "Create Success"))
- .isDisplayed()).toBe(true);
- });
+ it('cancel the delete confimation modal of the project ', function () {
+ browser.get(baseURL+"#/projects");
+ var deleteOperation = element(by.css('a[title=Delete]'));
+ deleteOperation.click();
+ var buttonCancel = element(by.buttonText('Cancel'));
+ buttonCancel.click();
+ expect(buttonCancel.isPresent()).toBe(false);
+ });
+
+ it('Delete the projects ', function () {
+ browser.get(baseURL+"#/projects");
+ var deleteOperation = element(by.css('a[title=Delete]'));
+ deleteOperation.click();
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.cssContainingText(".alert","Projects is successfully deleted"))
+ .isDisplayed()).toBe(true);
+ });
+
+ it(' Show error if user doesnt has permission to delete the projects ', function () {
+ mock.teardown();
+ mock([
+ {
+ request: {
+ path: '/api/v1/profile',
+ method: 'GET'
+ },
+ response: {
+ data: {
+ "fullname": "Test User", "_id": "79f82eey9a00c84bfhc7aed",
+ "user": "testUser", "groups": ["opnfv-testapi-users",
+ "opnfv-gerrit-testProject1-submitters",
+ "opnfv-gerrit-testProject2-submitters" ],
+ "email": "testuser@test.com"
+ }
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/projects/testproject3',
+ method: 'DELETE'
+ },
+ response: {
+ status: 403
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/projects',
+ method: 'GET'
+ },
+ response: {
+ data : {
+ "projects": [
+ {
+ "_id": "5a0c1c9a9a07c846d3a7247b",
+ "creation_date": "2017-11-15 16:23:14.217093",
+ "description": "sdgfd",
+ "name": "testproject3"
+ }]
+ }
+ }
+ }
+ ]);
+ browser.get(baseURL+"#/projects");
+ var deleteOperation = element(by.css('a[title=Delete]'));
+ deleteOperation.click();
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.css(".alert.alert-danger")).isDisplayed()).toBe(true);
+ });
+
+ it('cancel the Edit modal of the Project ', function () {
+ browser.get(baseURL+"#/projects");
+ var editOperation = element(by.css('a[title=Edit]'));
+ editOperation.click();
+ var name = element(by.model('ProjectModalCtrl.project.name'));
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.visibilityOf(name), 5000);
+ name.sendKeys('test1');
+ var buttonCancel = element(by.buttonText('Cancel'));
+ buttonCancel.click();
+ expect(name.isPresent()).toBe(false);
+ });
+
+ it('Edit the Project ', function () {
+ browser.get(baseURL+"#/projects");
+ var editOperation = element(by.css('a[title=Edit]'));
+ editOperation.click();
+ var name = element(by.model('ProjectModalCtrl.project.name'));
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.visibilityOf(name), 5000);
+ name.sendKeys('test1');
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click()
+ expect(element(by.cssContainingText(".alert","Project is successfully updated."))
+ .isDisplayed()).toBe(true);
+ });
+
+ it('Show error if user doesnt has permission to edit the projects ', function () {
+ mock.teardown();
+ mock([
+ {
+ request: {
+ path: '/api/v1/profile',
+ method: 'GET'
+ },
+ response: {
+ data: {
+ "fullname": "Test User", "_id": "79f82eey9a00c84bfhc7aed",
+ "user": "testUser", "groups": ["opnfv-testapi-users",
+ "opnfv-gerrit-testProject1-submitters",
+ "opnfv-gerrit-testProject2-submitters" ],
+ "email": "testuser@test.com"
+ }
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/projects/testproject3',
+ method: 'PUT'
+ },
+ response: {
+ status: 403
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/projects',
+ method: 'GET'
+ },
+ response: {
+ data : {
+ "projects": [
+ {
+ "_id": "5a0c1c9a9a07c846d3a7247b",
+ "creation_date": "2017-11-15 16:23:14.217093",
+ "description": "sdgfd",
+ "name": "testproject3"
+ }]
+ }
+ }
+ }
+ ]);
+ browser.get(baseURL+"#/projects");
+ var editOperation = element(by.css('a[title=Edit]'));
+ editOperation.click();
+ var name = element(by.model('ProjectModalCtrl.project.name'));
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.visibilityOf(name), 5000);
+ name.sendKeys('test1');
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click()
+ expect(element(by.css(".alert.alert-danger")).isDisplayed()).toBe(true);
+ });
+
+ it('Batch Delete the projects ', function () {
+ browser.get(baseURL+"#/projects");
+ var checkBox = element(by.model('ctrl.checkBox[index]'));
+ checkBox.click();
+ var buttonDelete = element(by.buttonText('Delete'));;
+ buttonDelete.click();
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.cssContainingText(".alert","Projects is successfully deleted"))
+ .isDisplayed()).toBe(true);
});
it('If backend is not responding then show error when user click the create button',function(){
@@ -258,13 +564,17 @@ describe('testing the Project Link for user who is in submitter group', function
}
}
]);
- browser.get(baseURL+ '/#/projects');
- var name = element(by.model('ctrl.name'));
- var details = element(by.model('ctrl.description'));
- name.sendKeys('testProject1');
+ browser.get(baseURL+"#/projects");
+ var buttonCreate = element(by.buttonText('Create'));
+ buttonCreate.click();
+ var name = element(by.model('ProjectModalCtrl.project.name'));
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.visibilityOf(name), 5000);
+ var details = element(by.model('ProjectModalCtrl.project.description'));
+ name.sendKeys('testproject');
details.sendKeys('demoDescription');
- var buttonCreate = element(by.buttonText('Create'));
- buttonCreate.click().then(function(){
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click().then(function(){
expect(element(by.css(".alert.alert-danger")).isDisplayed()).toBe(true);
});
});
diff --git a/testapi/opnfv_testapi/tests/UI/e2e/resultsControllerSpec.js b/testapi/opnfv_testapi/tests/UI/e2e/resultsControllerSpec.js
index a14f8ea..d6dfa1c 100644
--- a/testapi/opnfv_testapi/tests/UI/e2e/resultsControllerSpec.js
+++ b/testapi/opnfv_testapi/tests/UI/e2e/resultsControllerSpec.js
@@ -132,7 +132,7 @@ describe('testing the result page for anonymous user', function () {
expect(element(by.cssContainingText(".ng-binding.ng-scope","Test Results")).isDisplayed()).toBe(true);
});
- it( 'navigate anonymous user to testCase page', function() {
+ it( 'navigate anonymous user to results page', function() {
browser.get(baseURL);
var resultLink = element(by.linkText('Results')).click();
var EC = browser.ExpectedConditions;
@@ -348,6 +348,24 @@ describe('testing the result page for user', function () {
buttonFilter.click();
expect(cells.get(0).getText()).toContain("5a45170bbb2092000e2643f6");
});
+
+ it('Clear the filter', function () {
+ browser.get(baseURL+"#/results");
+ var filter = element(by.model('ctrl.filter'));
+ var filterText = element(by.model('ctrl.filterText'));
+ filter.sendKeys('project');
+ filterText.sendKeys('testproject');
+ var buttonFilter = element(by.buttonText('Filter'));
+ buttonFilter.click();
+ var row = element.all(by.repeater('(index, result) in ctrl.data.results')).first();
+ var cells = row.all(by.tagName('td'));
+ expect(cells.get(0).getText()).toContain("5a45170bbb2092000e2643f5");
+ var buttonClear = element(by.buttonText('Clear'));
+ buttonClear.click();
+ var row = element.all(by.repeater('(index, result) in ctrl.data.results')).first();
+ var cells = row.all(by.tagName('td'));
+ expect(cells.get(0).getText()).toContain("5a45170bbb2092000e2643f4");
+ });
it('Should not show the results in results page related to the filters for user ', function () {
browser.get(baseURL+"#/results");
var filter = element(by.model('ctrl.filter'));
diff --git a/testapi/opnfv_testapi/tests/UI/e2e/scenarioControllerSpec.js b/testapi/opnfv_testapi/tests/UI/e2e/scenarioControllerSpec.js
new file mode 100644
index 0000000..f97a621
--- /dev/null
+++ b/testapi/opnfv_testapi/tests/UI/e2e/scenarioControllerSpec.js
@@ -0,0 +1,1041 @@
+'use strict';
+
+var mock = require('protractor-http-mock');
+var baseURL = "http://localhost:8000/"
+
+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"
+ },
+ {
+ "date": "2016-12-15 05:28",
+ "score": "17/24"
+ },
+ {
+ "date": "2016-12-17 03:41",
+ "score": "16/24"
+ },
+ {
+ "date": "2018-01-22T18:30:00.000Z",
+ "score": "10/13"
+ }
+ ],
+ "trust_indicators": [
+ {
+ "date": "2016-12-09 11:38",
+ "status": "silver"
+ },
+ {
+ "date": "2016-12-25 08:22",
+ "status": "gold"
+ },
+ {
+ "date": "2018-01-22T18:30:00.000Z",
+ "status": "sf"
+ },
+ {
+ "date": "2018-01-17T18:30:00.000Z",
+ "status": "df"
+ }
+ ]
+ },
+ {
+ "project": "functest",
+ "customs": [
+ "vping_ssh",
+ "vping_userdata",
+ ],
+ "scores": [
+ {
+ "date": "2016-12-09 11:28",
+ "score": "6/8"
+ },
+ {
+ "date": "2016-12-14 15:34",
+ "score": "8/8"
+ },
+ {
+ "date": "2016-12-19 13:22",
+ "score": "8/8"
+ },
+ {
+ "date": "2016-12-22 18:17",
+ "score": "8/8"
+ },
+ {
+ "date": "2016-12-25 08:22",
+ "score": "8/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"
+ },
+ {
+ "date": "2016-12-15 05:28",
+ "score": "17/24"
+ },
+ {
+ "date": "2016-12-17 03:41",
+ "score": "16/24"
+ }
+ ],
+ "trust_indicators": [
+ {
+ "date": "2016-12-09 11:38",
+ "status": "silver"
+ },
+ {
+ "date": "2016-12-25 08:22",
+ "status": "gold"
+ }
+ ]
+ },
+ {
+ "project": "functest",
+ "customs": [
+ "vping_ssh",
+ "vping_userdata"
+ ],
+ "scores": [
+ {
+ "date": "2016-12-09 11:28",
+ "score": "6/8"
+ },
+ {
+ "date": "2016-12-14 15:34",
+ "score": "8/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 scenarios page for anonymous user', function() {
+ browser.get(baseURL+"#/scenarios");
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.urlContains(baseURL+ '#/scenarios'), 10000);
+ var row = element.all(by.repeater('(index, scenario) in ctrl.data.scenarios')).first();
+ var cells = row.all(by.tagName('td'));
+ expect(cells.get(1).getText()).toContain("test-scenario");
+ var scenarioLink = element(by.linkText('test-scenario')).click();
+ browser.wait(EC.urlContains(baseURL+ '#/scenarios/test-scenario'), 10000);
+ });
+
+ it( 'should not 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(false);
+ });
+
+ it( 'Expand installers by anonymous user', function() {
+ browser.get(baseURL+"#/scenarios/test-scenario");
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.urlContains(baseURL+ '#/scenarios/test-scenario'), 10000);
+ var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[1]/a/p'))
+ installerShow.click();
+ var row = element.all(by.repeater('(indexI, installer) in ctrl.data.scenarios[0].installers')).first();
+ var cells = row.all(by.tagName('td'));
+ expect(cells.get(1).getText()).toContain("fuel");
+ });
+
+ it( 'should not show the delete 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 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(false);
+ });
+
+ it( 'Expand installer by anonymous 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'))
+ expect(versionsShow.isDisplayed()).toBe(true)
+ });
+
+ it( 'Expand versions by anonymous 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'))
+ expect(versionShow.isDisplayed()).toBe(true);
+ });
+
+ it( 'Expand version by anonymous 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'))
+ expect(projectsShow.isDisplayed()).toBe(true);
+ });
+
+ it( 'Expand projects by anonymous 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'))
+ expect(projectShow.isDisplayed()).toBe(true)
+ });
+
+ it( 'Expand project by anonymous 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/tr[4]/td[2]/a/p'))
+ expect(customsShow.isDisplayed()).toBe(true)
+ var trustIndicatorsShow = 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[2]/td[2]/a/p'))
+ expect(trustIndicatorsShow.isDisplayed()).toBe(true)
+ var scoresShow = 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[3]/td[2]/a/p'))
+ expect(scoresShow.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"
+ },
+ {
+ "date": "2016-12-15 05:28",
+ "score": "17/24"
+ },
+ {
+ "date": "2016-12-17 03:41",
+ "score": "16/24"
+ },
+ {
+ "date": "2018-01-22T18:30:00.000Z",
+ "score": "10/13"
+ }
+ ],
+ "trust_indicators": [
+ {
+ "date": "2016-12-09 11:38",
+ "status": "silver"
+ },
+ {
+ "date": "2016-12-25 08:22",
+ "status": "gold"
+ },
+ {
+ "date": "2018-01-22T18:30:00.000Z",
+ "status": "sf"
+ },
+ {
+ "date": "2018-01-17T18:30:00.000Z",
+ "status": "df"
+ }
+ ]
+ },
+ {
+ "project": "functest",
+ "customs": [
+ "vping_ssh",
+ "vping_userdata",
+ ],
+ "scores": [
+ {
+ "date": "2016-12-09 11:28",
+ "score": "6/8"
+ },
+ {
+ "date": "2016-12-14 15:34",
+ "score": "8/8"
+ },
+ {
+ "date": "2016-12-19 13:22",
+ "score": "8/8"
+ },
+ {
+ "date": "2016-12-22 18:17",
+ "score": "8/8"
+ },
+ {
+ "date": "2016-12-25 08:22",
+ "score": "8/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"
+ },
+ {
+ "date": "2016-12-15 05:28",
+ "score": "17/24"
+ },
+ {
+ "date": "2016-12-17 03:41",
+ "score": "16/24"
+ }
+ ],
+ "trust_indicators": [
+ {
+ "date": "2016-12-09 11:38",
+ "status": "silver"
+ },
+ {
+ "date": "2016-12-25 08:22",
+ "status": "gold"
+ }
+ ]
+ },
+ {
+ "project": "functest",
+ "customs": [
+ "vping_ssh",
+ "vping_userdata"
+ ],
+ "scores": [
+ {
+ "date": "2016-12-09 11:28",
+ "score": "6/8"
+ },
+ {
+ "date": "2016-12-14 15:34",
+ "score": "8/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"
+ }
+ ]
+ }
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/profile',
+ method: 'GET'
+ },
+ response: {
+ data: {
+ "fullname": "Test User", "_id": "79f82eey9a00c84bfhc7aed",
+ "user": "testUser", "groups": ["opnfv-testapi-users"],
+ "email": "testuser@test.com"
+ }
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/scenarios/test-scenario/installers',
+ method: 'POST'
+ },
+ response: {
+ status : 200
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/scenarios/test-scenario/installers',
+ method: 'DELETE'
+ },
+ response: {
+ status : 200
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/scenarios/test-scenario/versions',
+ method: 'POST',
+ queryString: {
+ installer: 'fuel'
+ }
+ },
+ response: {
+ status : 200
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/scenarios/test-scenario/versions',
+ method: 'DELETE',
+ queryString: {
+ installer: 'fuel'
+ }
+ },
+ response: {
+ status : 200
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/scenarios/test-scenario/projects',
+ method: 'POST',
+ queryString: {
+ installer: 'fuel',
+ version: 'colorado'
+ }
+ },
+ response: {
+ status : 200
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/scenarios/test-scenario/projects',
+ method: 'DELETE',
+ queryString: {
+ installer: 'fuel',
+ version: 'colorado'
+ }
+ },
+ response: {
+ status : 200
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/scenarios/test-scenario/customs',
+ method: 'POST',
+ queryString: {
+ installer: 'fuel',
+ version: 'colorado',
+ project: 'yardstick'
+ }
+ },
+ response: {
+ status : 200
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/scenarios/test-scenario/customs',
+ method: 'DELETE',
+ queryString: {
+ installer: 'fuel',
+ version: 'colorado',
+ project: 'yardstick'
+ }
+ },
+ response: {
+ status : 200
+ }
+ }
+ ]);
+ });
+
+ afterEach(function(){
+ mock.teardown();
+ });
+
+ it( 'should show the scenarios page for user', function() {
+ browser.get(baseURL+"#/scenarios");
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.urlContains(baseURL+ '#/scenarios'), 10000);
+ var row = element.all(by.repeater('(index, scenario) in ctrl.data.scenarios')).first();
+ var cells = row.all(by.tagName('td'));
+ expect(cells.get(1).getText()).toContain("test-scenario");
+ var scenarioLink = element(by.linkText('test-scenario')).click();
+ browser.wait(EC.urlContains(baseURL+ '#/scenarios/test-scenario'), 10000);
+ });
+
+ it( 'should not 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);
+ 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('add installer', 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'))
+ buttonAdd.click();
+ var name = element(by.model('installerModalCtrl.installer.installer'));
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.visibilityOf(name), 5000);
+ name.sendKeys('test');
+ var buttonOk = element(by.xpath('//*[@id="ng-app"]/body/div[3]/div/div/div/div[2]/button[1]'))
+ buttonOk.click()
+ expect(element(by.cssContainingText(".alert","Installers are successfully updated."))
+ .isDisplayed()).toBe(true);
+
+ });
+
+ it( 'Expand installers by user', function() {
+ browser.get(baseURL+"#/scenarios/test-scenario");
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.urlContains(baseURL+ '#/scenarios/test-scenario'), 10000);
+ var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[1]/a/p'))
+ installerShow.click();
+ var row = element.all(by.repeater('(indexI, installer) in ctrl.data.scenarios[0].installers')).first();
+ var cells = row.all(by.tagName('td'));
+ expect(cells.get(1).getText()).toContain("fuel");
+ });
+
+ 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( 'delete installer', 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'))
+ installerDelete.click()
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.cssContainingText(".alert","Installer is successfully deleted."))
+ .isDisplayed()).toBe(true);
+ });
+
+ it( 'Expand installer by 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'))
+ expect(versionsShow.isDisplayed()).toBe(true)
+ });
+
+ it( 'add version for an installer', 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()
+ var version = element(by.model('versionModalCtrl.version.version'));
+ browser.wait(EC.visibilityOf(version), 5000);
+ version.sendKeys('testV');
+ var owner = element(by.model('versionModalCtrl.version.owner'));
+ owner.sendKeys('testOwner');
+ var buttonOk = element(by.xpath('//*[@id="ng-app"]/body/div[3]/div/div/div/div[2]/button[1]'))
+ buttonOk.click()
+ expect(element(by.cssContainingText(".alert","Versions are successfully updated."))
+ .isDisplayed()).toBe(true);
+ });
+
+ it( 'Expand versions by 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'))
+ expect(versionShow.isDisplayed()).toBe(true);
+ var installerAdd = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[4]/td[2]/div[2]/button'))
+ 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(installerAdd.isDisplayed()).toBe(false);
+ expect(installerDelete.isDisplayed()).toBe(false)
+ });
+
+ it( 'delete version', 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'))
+ versionDelete.click()
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.cssContainingText(".alert","Versions are successfully deleted."))
+ .isDisplayed()).toBe(true);
+ });
+
+ it( 'Expand version by 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'))
+ expect(projectsShow.isDisplayed()).toBe(true);
+ });
+
+ it( 'add project', 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()
+ var project = element(by.model('projectModalCtrl.project.project'));
+ browser.wait(EC.visibilityOf(project), 5000);
+ project.sendKeys('testP');
+ var buttonOk = element(by.xpath('//*[@id="ng-app"]/body/div[3]/div/div/div/div[2]/button[1]'))
+ buttonOk.click()
+ expect(element(by.cssContainingText(".alert","Projects are successfully updated."))
+ .isDisplayed()).toBe(true);
+ });
+
+ it( 'Expand projects by 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'))
+ expect(projectShow.isDisplayed()).toBe(true)
+ 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'))
+ 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/tr[1]/td[3]/button'))
+ expect(versionAdd.isDisplayed()).toBe(false)
+ expect(versionDelete.isDisplayed()).toBe(false)
+ });
+
+ it( 'delete project', 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()
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.cssContainingText(".alert","Projects are successfully Deleted."))
+ .isDisplayed()).toBe(true);
+ });
+
+ it( 'Expand project by 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/tr[4]/td[2]/a/p'))
+ expect(customsShow.isDisplayed()).toBe(true)
+ var trustIndicatorsShow = 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[2]/td[2]/a/p'))
+ expect(trustIndicatorsShow.isDisplayed()).toBe(true)
+ var scoresShow = 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[3]/td[2]/a/p'))
+ expect(scoresShow.isDisplayed()).toBe(true)
+ });
+
+ it( 'Expand trust indicator by 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 trustIndicatorsShow = 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[2]/td[2]/a/p'))
+ trustIndicatorsShow.click();
+ var row = element.all(by.repeater('(indexTI, trust_indicator) in project.trust_indicators')).first();
+ var cells = row.all(by.tagName('td'));
+ expect(cells.get(1).getText()).toContain("silver");
+ });
+
+ it( 'Expand score by 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 scoresShow = 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[3]/td[2]/a/p'))
+ scoresShow.click();
+ var row = element.all(by.repeater('(indexSC, score) in project.scores')).first();
+ var cells = row.all(by.tagName('td'));
+ expect(cells.get(1).getText()).toContain("14/24");
+ });
+
+ it( 'Expand Customs by 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 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'))
+ 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'))
+ expect(projectDelete.isDisplayed()).toBe(false)
+ expect(projectAdd.isDisplayed()).toBe(false)
+ 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'))
+ 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'))
+ expect(buttonAdd.isDisplayed()).toBe(true)
+ expect(buttonDelete.isDisplayed()).toBe(true)
+ });
+
+ it( 'Add Customs by 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()
+ var custom = element(by.model('customModalCtrl.custom'));
+ browser.wait(EC.visibilityOf(custom), 5000);
+ custom.sendKeys('testC');
+ var buttonOk = element(by.xpath('//*[@id="ng-app"]/body/div[3]/div/div/div/div[2]/button[1]'))
+ buttonOk.click()
+ expect(element(by.cssContainingText(".alert","Customs are successfully updated."))
+ .isDisplayed()).toBe(true);
+ });
+
+ it( 'Delete Customs by 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]/table/tbody/tr[1]/td[2]/button'))
+ buttonAdd.click()
+ var buttonOk = element(by.xpath('//*[@id="ng-app"]/body/div[3]/div/div/div[3]/button[1]'))
+ buttonOk.click()
+ expect(element(by.cssContainingText(".alert","Customs are successfully deleted."))
+ .isDisplayed()).toBe(true);
+ });
+
+}); \ No newline at end of file
diff --git a/testapi/opnfv_testapi/tests/UI/e2e/scenariosControllerSpec.js b/testapi/opnfv_testapi/tests/UI/e2e/scenariosControllerSpec.js
new file mode 100644
index 0000000..505b42f
--- /dev/null
+++ b/testapi/opnfv_testapi/tests/UI/e2e/scenariosControllerSpec.js
@@ -0,0 +1,725 @@
+'use strict';
+
+var mock = require('protractor-http-mock');
+var baseURL = "http://localhost:8000/"
+
+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"
+ },
+ {
+ "date": "2016-12-15 05:28",
+ "score": "17/24"
+ },
+ {
+ "date": "2016-12-17 03:41",
+ "score": "16/24"
+ },
+ {
+ "date": "2018-01-22T18:30:00.000Z",
+ "score": "10/13"
+ }
+ ],
+ "trust_indicators": [
+ {
+ "date": "2016-12-09 11:38",
+ "status": "silver"
+ },
+ {
+ "date": "2016-12-25 08:22",
+ "status": "gold"
+ },
+ {
+ "date": "2018-01-22T18:30:00.000Z",
+ "status": "sf"
+ },
+ {
+ "date": "2018-01-17T18:30:00.000Z",
+ "status": "df"
+ }
+ ]
+ },
+ {
+ "project": "functest",
+ "customs": [
+ "vping_ssh",
+ "vping_userdata",
+ ],
+ "scores": [
+ {
+ "date": "2016-12-09 11:28",
+ "score": "6/8"
+ },
+ {
+ "date": "2016-12-14 15:34",
+ "score": "8/8"
+ },
+ {
+ "date": "2016-12-19 13:22",
+ "score": "8/8"
+ },
+ {
+ "date": "2016-12-22 18:17",
+ "score": "8/8"
+ },
+ {
+ "date": "2016-12-25 08:22",
+ "score": "8/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"
+ },
+ {
+ "date": "2016-12-15 05:28",
+ "score": "17/24"
+ },
+ {
+ "date": "2016-12-17 03:41",
+ "score": "16/24"
+ }
+ ],
+ "trust_indicators": [
+ {
+ "date": "2016-12-09 11:38",
+ "status": "silver"
+ },
+ {
+ "date": "2016-12-25 08:22",
+ "status": "gold"
+ }
+ ]
+ },
+ {
+ "project": "functest",
+ "customs": [
+ "vping_ssh",
+ "vping_userdata"
+ ],
+ "scores": [
+ {
+ "date": "2016-12-09 11:28",
+ "score": "6/8"
+ },
+ {
+ "date": "2016-12-14 15:34",
+ "score": "8/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 scenarios page for anonymous user', function() {
+ browser.get(baseURL+"#/scenarios");
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.urlContains(baseURL+ '#/scenarios'), 10000);
+ });
+
+ it( 'navigate anonymous user to scenarios page', function() {
+ browser.get(baseURL);
+ var resultLink = element(by.linkText('Scenarios')).click();
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.urlContains(baseURL+ '#/scenarios'), 10000);
+ });
+
+ it('Should show the scenarios in scenarios page for anonymous user ', function () {
+ browser.get(baseURL+"#/scenarios");
+ var row = element.all(by.repeater('(index, scenario) in ctrl.data.scenarios')).first();
+ var cells = row.all(by.tagName('td'));
+ expect(cells.get(1).getText()).toContain("test-scenario");
+ });
+
+ it('create button is not visible for anonymous user ', function () {
+ browser.get(baseURL+'#/scenarios');
+ var buttonCreate = element(by.buttonText('Create'));
+ expect(buttonCreate.isDisplayed()).toBeFalsy();
+ });
+ it('delete button is not visible for anonymous user ', function () {
+ browser.get(baseURL+'#/scenarios');
+ var buttonCreate = element(by.buttonText('Delete'));
+ expect(buttonCreate.isDisplayed()).toBeFalsy();
+ });
+
+});
+
+describe('testing the scenarios page for 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"
+ },
+ {
+ "date": "2016-12-15 05:28",
+ "score": "17/24"
+ },
+ {
+ "date": "2016-12-17 03:41",
+ "score": "16/24"
+ },
+ {
+ "date": "2018-01-22T18:30:00.000Z",
+ "score": "10/13"
+ }
+ ],
+ "trust_indicators": [
+ {
+ "date": "2016-12-09 11:38",
+ "status": "silver"
+ },
+ {
+ "date": "2016-12-25 08:22",
+ "status": "gold"
+ },
+ {
+ "date": "2018-01-22T18:30:00.000Z",
+ "status": "sf"
+ },
+ {
+ "date": "2018-01-17T18:30:00.000Z",
+ "status": "df"
+ }
+ ]
+ },
+ {
+ "project": "functest",
+ "customs": [
+ "vping_ssh",
+ "vping_userdata",
+ ],
+ "scores": [
+ {
+ "date": "2016-12-09 11:28",
+ "score": "6/8"
+ },
+ {
+ "date": "2016-12-14 15:34",
+ "score": "8/8"
+ },
+ {
+ "date": "2016-12-19 13:22",
+ "score": "8/8"
+ },
+ {
+ "date": "2016-12-22 18:17",
+ "score": "8/8"
+ },
+ {
+ "date": "2016-12-25 08:22",
+ "score": "8/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"
+ },
+ {
+ "date": "2016-12-15 05:28",
+ "score": "17/24"
+ },
+ {
+ "date": "2016-12-17 03:41",
+ "score": "16/24"
+ }
+ ],
+ "trust_indicators": [
+ {
+ "date": "2016-12-09 11:38",
+ "status": "silver"
+ },
+ {
+ "date": "2016-12-25 08:22",
+ "status": "gold"
+ }
+ ]
+ },
+ {
+ "project": "functest",
+ "customs": [
+ "vping_ssh",
+ "vping_userdata"
+ ],
+ "scores": [
+ {
+ "date": "2016-12-09 11:28",
+ "score": "6/8"
+ },
+ {
+ "date": "2016-12-14 15:34",
+ "score": "8/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"
+ }
+ ]
+ }
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/profile',
+ method: 'GET'
+ },
+ response: {
+ data: {
+ "fullname": "Test User", "_id": "79f82eey9a00c84bfhc7aed",
+ "user": "testUser", "groups": ["opnfv-testapi-users"],
+ "email": "testuser@test.com"
+ }
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/scenarios',
+ method: 'POST'
+ },
+ response: {
+ data: {
+ href: baseURL+"/api/v1/scenarios/testScenario"
+ }
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/scenarios/test-scenario',
+ method: 'DELETE'
+ },
+ response: {
+ data: {
+ href: baseURL+"/api/v1/scenarios/testScenario"
+ }
+ }
+ },
+ {
+ request: {
+ path: '/api/v1/scenarios/test-scenario',
+ method: 'PUT'
+ },
+ response: {
+ data: {
+ href: baseURL+"/api/v1/scenarios/testScenario"
+ }
+ }
+ }
+ ]);
+ });
+
+ afterEach(function(){
+ mock.teardown();
+ });
+
+ it( 'should show the scenarios page for user', function() {
+ browser.get(baseURL+"#/scenarios");
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.urlContains(baseURL+ '#/scenarios'), 10000);
+ });
+
+ it( 'navigate user to scenarios page', function() {
+ browser.get(baseURL);
+ var resultLink = element(by.linkText('Scenarios')).click();
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.urlContains(baseURL+ '#/scenarios'), 10000);
+ });
+
+ it('Should show the scenarios in scenarios page for user ', function () {
+ browser.get(baseURL+"#/scenarios");
+ var row = element.all(by.repeater('(index, scenario) in ctrl.data.scenarios')).first();
+ var cells = row.all(by.tagName('td'));
+ expect(cells.get(1).getText()).toContain("test-scenario");
+ });
+
+ it('create button is not visible for user ', function () {
+ browser.get(baseURL+'#/scenarios');
+ var buttonCreate = element(by.buttonText('Create'));
+ expect(buttonCreate.isDisplayed()).toBe(true);
+ });
+
+ it('delete button is not visible for user ', function () {
+ browser.get(baseURL+'#/scenarios');
+ var buttonDelete = element(by.buttonText('Delete'));
+ expect(buttonDelete.isDisplayed()).toBe(true);
+ });
+
+ it('craete scenarrio by user without installers ', function () {
+ browser.get(baseURL+'#/scenarios');
+ var buttonCreate = element(by.buttonText('Create')).click();
+ var name = element(by.model('scenarioModalController.scenario.name'));
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.visibilityOf(name), 5000);
+ name.sendKeys('test');
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.cssContainingText(".alert","Scenario is successfully created."))
+ .isDisplayed()).toBe(true);
+ });
+
+ it('create scenarrio by user with installers ', function () {
+ browser.get(baseURL+'#/scenarios');
+ var buttonCreate = element(by.buttonText('Create')).click();
+ var name = element(by.model('scenarioModalController.scenario.name'));
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.visibilityOf(name), 5000);
+ name.sendKeys('test');
+ var buttonInstaller = element(by.xpath('//*[@id="ng-app"]/body/div[3]/div/div/div/div[1]/div[1]/fieldset/div/div/div[2]/div[2]/button'))
+ buttonInstaller.click();
+ var installer = element(by.model('installerModalCtrl.installer.installer'));
+ browser.wait(EC.visibilityOf(installer), 5000);
+ installer.sendKeys('testI');
+ var buttonOK = element(by.xpath('//*[@id="ng-app"]/body/div[4]/div/div/div/div[2]/button[1]'));
+ buttonOK.click();
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.cssContainingText(".alert","Scenario is successfully created."))
+ .isDisplayed()).toBe(true);
+ });
+
+ it('create scenarrio by user with installers with versions ', function () {
+ browser.get(baseURL+'#/scenarios');
+ var buttonCreate = element(by.buttonText('Create')).click();
+ var name = element(by.model('scenarioModalController.scenario.name'));
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.visibilityOf(name), 5000);
+ name.sendKeys('test');
+ var buttonInstaller = element(by.xpath('//*[@id="ng-app"]/body/div[3]/div/div/div/div[1]/div[1]/fieldset/div/div/div[2]/div[2]/button'))
+ buttonInstaller.click();
+ var installer = element(by.model('installerModalCtrl.installer.installer'));
+ browser.wait(EC.visibilityOf(installer), 5000);
+ installer.sendKeys('testI');
+ var buttonVersion = element(by.xpath('//*[@id="ng-app"]/body/div[4]/div/div/div/div[1]/div[1]/fieldset/div/div/div[2]/div[2]/button'))
+ buttonVersion.click();
+ var version = element(by.model('versionModalCtrl.version.version'));
+ browser.wait(EC.visibilityOf(version), 5000);
+ version.sendKeys('testV');
+ var owner = element(by.model('versionModalCtrl.version.owner'));
+ owner.sendKeys('testOwner');
+ var buttonOK = element(by.xpath('//*[@id="ng-app"]/body/div[5]/div/div/div/div[2]/button[1]'));
+ buttonOK.click();
+ var buttonOK = element(by.xpath('//*[@id="ng-app"]/body/div[4]/div/div/div/div[2]/button[1]'));
+ buttonOK.click();
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.cssContainingText(".alert","Scenario is successfully created."))
+ .isDisplayed()).toBe(true);
+ });
+
+ it('create scenarrio by user with installers with versions with project', function () {
+ browser.get(baseURL+'#/scenarios');
+ var buttonCreate = element(by.buttonText('Create')).click();
+ var name = element(by.model('scenarioModalController.scenario.name'));
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.visibilityOf(name), 5000);
+ name.sendKeys('test');
+ var buttonInstaller = element(by.xpath('//*[@id="ng-app"]/body/div[3]/div/div/div/div[1]/div[1]/fieldset/div/div/div[2]/div[2]/button'))
+ buttonInstaller.click();
+ var installer = element(by.model('installerModalCtrl.installer.installer'));
+ browser.wait(EC.visibilityOf(installer), 5000);
+ installer.sendKeys('testI');
+ var buttonVersion = element(by.xpath('//*[@id="ng-app"]/body/div[4]/div/div/div/div[1]/div[1]/fieldset/div/div/div[2]/div[2]/button'))
+ buttonVersion.click();
+ var version = element(by.model('versionModalCtrl.version.version'));
+ browser.wait(EC.visibilityOf(version), 5000);
+ version.sendKeys('testV');
+ var owner = element(by.model('versionModalCtrl.version.owner'));
+ owner.sendKeys('testOwner');
+ var buttonProject = element(by.xpath('//*[@id="ng-app"]/body/div[5]/div/div/div/div[1]/div[1]/fieldset/div/div/div[3]/div[2]/button'))
+ buttonProject.click();
+ var project = element(by.model('projectModalCtrl.project.project'));
+ browser.wait(EC.visibilityOf(project), 5000);
+ project.sendKeys('testP');
+ var buttonOK = element(by.xpath('//*[@id="ng-app"]/body/div[6]/div/div/div/div[2]/button[1]'));
+ buttonOK.click();
+ var buttonOK = element(by.xpath('//*[@id="ng-app"]/body/div[5]/div/div/div/div[2]/button[1]'));
+ buttonOK.click();
+ var buttonOK = element(by.xpath('//*[@id="ng-app"]/body/div[4]/div/div/div/div[2]/button[1]'));
+ buttonOK.click();
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.cssContainingText(".alert","Scenario is successfully created."))
+ .isDisplayed()).toBe(true);
+ });
+
+ it('create scenarrio by user with installers with versions with project with custom', function () {
+ browser.get(baseURL+'#/scenarios');
+ var buttonCreate = element(by.buttonText('Create')).click();
+ var name = element(by.model('scenarioModalController.scenario.name'));
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.visibilityOf(name), 5000);
+ name.sendKeys('test');
+ var buttonInstaller = element(by.xpath('//*[@id="ng-app"]/body/div[3]/div/div/div/div[1]/div[1]/fieldset/div/div/div[2]/div[2]/button'))
+ buttonInstaller.click();
+ var installer = element(by.model('installerModalCtrl.installer.installer'));
+ browser.wait(EC.visibilityOf(installer), 5000);
+ installer.sendKeys('testI');
+ var buttonVersion = element(by.xpath('//*[@id="ng-app"]/body/div[4]/div/div/div/div[1]/div[1]/fieldset/div/div/div[2]/div[2]/button'))
+ buttonVersion.click();
+ var version = element(by.model('versionModalCtrl.version.version'));
+ browser.wait(EC.visibilityOf(version), 5000);
+ version.sendKeys('testV');
+ var owner = element(by.model('versionModalCtrl.version.owner'));
+ owner.sendKeys('testOwner');
+ var buttonProject = element(by.xpath('//*[@id="ng-app"]/body/div[5]/div/div/div/div[1]/div[1]/fieldset/div/div/div[3]/div[2]/button'))
+ buttonProject.click();
+ var project = element(by.model('projectModalCtrl.project.project'));
+ browser.wait(EC.visibilityOf(project), 5000);
+ project.sendKeys('testP');
+ var buttonCustom = element(by.xpath('//*[@id="ng-app"]/body/div[6]/div/div/div/div[1]/div[1]/fieldset/div/div/div[2]/div[2]/button'))
+ buttonCustom.click();
+ var custom = element(by.model('customModalCtrl.custom'));
+ browser.wait(EC.visibilityOf(custom), 5000);
+ custom.sendKeys('testC');
+ var buttonOK = element(by.xpath('//*[@id="ng-app"]/body/div[7]/div/div/div/div[2]/button[1]'));
+ buttonOK.click();
+ var buttonOK = element(by.xpath('//*[@id="ng-app"]/body/div[6]/div/div/div/div[2]/button[1]'));
+ buttonOK.click();
+ var buttonOK = element(by.xpath('//*[@id="ng-app"]/body/div[5]/div/div/div/div[2]/button[1]'));
+ buttonOK.click();
+ var buttonOK = element(by.xpath('//*[@id="ng-app"]/body/div[4]/div/div/div/div[2]/button[1]'));
+ buttonOK.click();
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.cssContainingText(".alert","Scenario is successfully created."))
+ .isDisplayed()).toBe(true);
+ });
+
+ it('view scenarrio by user ', function () {
+ browser.get(baseURL+'#/scenarios');
+ var scenarioLink = element(by.linkText('test-scenario')).click();
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.urlContains(baseURL+ '#/scenarios/test-scenario'), 10000);
+ });
+
+ it('delete Operation is visible for user ', function () {
+ browser.get(baseURL+'#/scenarios');
+ var deleteOperation = element(by.css('a[title=Delete]'));
+ expect(deleteOperation.isDisplayed()).toBe(true);
+ });
+
+ it('edit Operation is visible for user ', function () {
+ browser.get(baseURL+'#/scenarios');
+ var deleteOperation = element(by.css('a[title=Edit]'));
+ expect(deleteOperation.isDisplayed()).toBe(true);
+ });
+
+ it('Delete the Scenario ', function () {
+ browser.get(baseURL+'#/scenarios');
+ var deleteOperation = element(by.css('a[title=Delete]'));
+ deleteOperation.click();
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.cssContainingText(".alert","Scenario is successfully deleted."))
+ .isDisplayed()).toBe(true);
+ });
+
+ it('Batch Delete the scenarios ', function () {
+ browser.get(baseURL+'#/scenarios');
+ var checkBox = element(by.model('ctrl.checkBox[index]'));
+ checkBox.click();
+ var buttonDelete = element(by.buttonText('Delete'));;
+ buttonDelete.click();
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click();
+ expect(element(by.cssContainingText(".alert","Scenario is successfully deleted."))
+ .isDisplayed()).toBe(true);
+ });
+
+ it('Edit the scenarios ', function () {
+ browser.get(baseURL+'#/scenarios');
+ var editOperation = element(by.css('a[title=Edit]'));
+ editOperation.click();
+ var name = element(by.model('ScenarioNameUpdateCtrl.name'));
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.visibilityOf(name), 5000);
+ name.sendKeys('test2');
+ var buttonOK = element(by.buttonText('Ok'));
+ buttonOK.click()
+ expect(element(by.cssContainingText(".alert","Scenario is successfully Updated."))
+ .isDisplayed()).toBe(true);
+ });
+
+}); \ No newline at end of file
diff --git a/testapi/opnfv_testapi/ui/Gruntfile.js b/testapi/opnfv_testapi/ui/Gruntfile.js
index 72a47e1..1be08b5 100644
--- a/testapi/opnfv_testapi/ui/Gruntfile.js
+++ b/testapi/opnfv_testapi/ui/Gruntfile.js
@@ -115,8 +115,15 @@ module.exports = function (grunt) {
noColor: false,
coverageDir: '../tests/UI/coverage',
args: {
- specs: ['../tests/UI/e2e/testCasesControllerSpec.js',
- '../tests/UI/e2e/resultsControllerSpec.js']
+ specs: [
+ '../tests/UI/e2e/homeControllerSpec.js',
+ '../tests/UI/e2e/podsControllerSpec.js',
+ '../tests/UI/e2e/projectsControllerSpec.js',
+ '../tests/UI/e2e/testCasesControllerSpec.js',
+ '../tests/UI/e2e/resultsControllerSpec.js',
+ '../tests/UI/e2e/scenariosControllerSpec.js',
+ '../tests/UI/e2e/scenarioControllerSpec.js'
+ ]
}
},
local: {
diff --git a/testapi/opnfv_testapi/ui/components/pods/pods.html b/testapi/opnfv_testapi/ui/components/pods/pods.html
index e092699..4fa8fb1 100644
--- a/testapi/opnfv_testapi/ui/components/pods/pods.html
+++ b/testapi/opnfv_testapi/ui/components/pods/pods.html
@@ -22,14 +22,7 @@
</div>
<div class="col-sm-3 pull-right">
<span style="margin-top:6px">Search:&nbsp;&nbsp;</span>
- <input type="text" class="form-control search" ngModel="filter" placeholder="Search String">
- </div>
- <div class="col-md-3 row pull-right">
- <span style="margin-top:6px">Filter:&nbsp;&nbsp;</span>
- <select ng-model="ctrl.filter" class="form-control">
- <option value="name">Name</option>
- <option value="owner">Owner</option>
- </select>
+ <input type="text" class="form-control search" ng-Model="ctrl.filterText" placeholder="Search String">
</div>
</div>
<div class="col-md-12">
@@ -67,9 +60,7 @@
<td>{{pod.mode}}</td>
<td ng-class="{ 'hidden': !auth.isAuthenticated }">
<span class="podsTable-col">
- <a class="text-warning" title="Edit">
- <i class="fa fa-pencil-square-o"></i></a>
- <a class="text-danger" ng-click="ctrl.openDeleteModal(pod.name)" title="Delete">
+ <a class="text-danger" ng-click="ctrl.openDeleteModal(pod.name)" title="Delete" ng-class="{ 'hidden': !auth.isAuthenticated }">
<i class="fa fa-trash-o"></i></a>
</span>
</td>
diff --git a/testapi/opnfv_testapi/ui/components/pods/podsController.js b/testapi/opnfv_testapi/ui/components/pods/podsController.js
index c66873a..95e3571 100644
--- a/testapi/opnfv_testapi/ui/components/pods/podsController.js
+++ b/testapi/opnfv_testapi/ui/components/pods/podsController.js
@@ -40,13 +40,13 @@
ctrl.listPods = listPods;
ctrl.open = open;
ctrl.filter = 'name'
- ctrl.clearFilters = clearFilters;
ctrl.openDeleteModal = openDeleteModal
ctrl.openBatchDeleteModal = openBatchDeleteModal
ctrl.openCreateModal = openCreateModal
ctrl.podDelete = podDelete
ctrl.batchDelete = batchDelete;
ctrl.viewPod = viewPod
+ ctrl.filterText = ''
/**
* This is called when the date filter calendar is opened. It
@@ -61,13 +61,6 @@
ctrl[openVar] = true;
}
- /**
- * This function will clear all filters and update the results
- * listing.
- */
- function clearFilters() {
- ctrl.listPods();
- }
/**
* This will contact the TestAPI to create a new pod.
@@ -91,7 +84,7 @@
ctrl.listPods();
}).catch(function (data) {
ctrl.showError = true;
- ctrl.error = "Error creating the new pod from server: " + data.statusText;
+ ctrl.error = data.statusText;
});
}
else{
@@ -105,21 +98,21 @@
*/
function listPods() {
ctrl.showError = false;
+ var reqURL = ctrl.url;
+ if(ctrl.filterText!=''){
+ reqURL = ctrl.url + "?name=" + ctrl.filterText
+ }
ctrl.podsRequest =
- $http.get(ctrl.url).success(function (data) {
+ $http.get(reqURL).success(function (data) {
ctrl.data = data;
- // mapNametoRandom
- }).error(function (error) {
+ }).catch(function (data) {
ctrl.data = null;
ctrl.showError = true;
- ctrl.error =
- 'Error retrieving pods from server: ' +
- angular.toJson(error);
+ ctrl.error = data.statusText;
});
}
function viewPod(name){
- console.log('hello');
$state.go('pod', {'name':name}, {reload: true});
}
/**
@@ -192,22 +185,6 @@
});
}
- // function openUpdateModal(podName){
- // $uibModal.open({
- // templateUrl: 'testapi-ui/components/pods/modals/createModal.html',
- // controller: 'PodModalCtrl as PodModalCtrl',
- // size: 'md',
- // resolve: {
- // data: function () {
- // return {
- // text: "Update",
- // successHandler: ctrl.update,
- // // pod: ctrl.
- // };
- // }
- // }
- // });
- // }
ctrl.listPods();
}
diff --git a/testapi/opnfv_testapi/ui/components/projects/projects.html b/testapi/opnfv_testapi/ui/components/projects/projects.html
index 5a3b421..b6b73d4 100644
--- a/testapi/opnfv_testapi/ui/components/projects/projects.html
+++ b/testapi/opnfv_testapi/ui/components/projects/projects.html
@@ -26,7 +26,7 @@
<span class="pull-right">&nbsp;{{ctrl.error}}</span>
<span class="glyphicon glyphicon-exclamation-sign pull-right" aria-hidden="true" >Error:</span>
</div>
- <div ng-show="ctrl.showCreateSuccess" class="alert alert-success" role="alert">
+ <div ng-show="ctrl.showSuccess" class="alert alert-success" role="alert">
<span class="pull-right">&nbsp;{{ctrl.success}}</span>
<span class="glyphicon glyphicon-ok pull-right" aria-hidden="true"></span>
</div>
diff --git a/testapi/opnfv_testapi/ui/components/projects/projectsController.js b/testapi/opnfv_testapi/ui/components/projects/projectsController.js
index bb394c0..940c1e2 100644
--- a/testapi/opnfv_testapi/ui/components/projects/projectsController.js
+++ b/testapi/opnfv_testapi/ui/components/projects/projectsController.js
@@ -56,7 +56,7 @@
*/
function create(project) {
ctrl.showError = false;
- ctrl.showCreateSuccess = false;
+ ctrl.showSuccess = false;
var projects_url = ctrl.url;
var body = {
name: project.name,
@@ -64,7 +64,7 @@
};
ctrl.projectsRequest =
$http.post(projects_url, body).success(function (data){
- ctrl.showCreateSuccess = true ;
+ ctrl.showSuccess = true ;
ctrl.success = "Project is successfully created."
ctrl.listProjects();
}).catch(function (data) {
diff --git a/testapi/opnfv_testapi/ui/components/results/resultsController.js b/testapi/opnfv_testapi/ui/components/results/resultsController.js
index 55bf0ba..73f3c15 100644
--- a/testapi/opnfv_testapi/ui/components/results/resultsController.js
+++ b/testapi/opnfv_testapi/ui/components/results/resultsController.js
@@ -50,15 +50,8 @@
raiseAlert) {
var ctrl = this;
- ctrl.uploadFile=uploadFile;
ctrl.open = open;
ctrl.clearFilters = clearFilters;
- ctrl.associateMeta = associateMeta;
- ctrl.getVersionList = getVersionList;
- ctrl.getUserProducts = getUserProducts;
- ctrl.associateProductVersion = associateProductVersion;
- ctrl.getProductVersions = getProductVersions;
- ctrl.prepVersionEdit = prepVersionEdit;
ctrl.deleteTag = deleteTag;
ctrl.filterList= filterList;
ctrl.testFilter = testFilter
@@ -102,12 +95,12 @@
/** Check to see if this page should display user-specific results. */
// ctrl.isUserResults = $state.current.name === 'userResults';
// need auth to browse
- ctrl.isUserResults = $state.current.name === 'userResults';
+ // ctrl.isUserResults = $state.current.name === 'userResults';
- // Should only be on user-results-page if authenticated.
- if (ctrl.isUserResults && !$scope.auth.isAuthenticated) {
- $state.go('home');
- }
+ // // Should only be on user-results-page if authenticated.
+ // if (ctrl.isUserResults && !$scope.auth.isAuthenticated) {
+ // $state.go('home');
+ // }
ctrl.pageHeader = "Test Results"
@@ -116,17 +109,17 @@
'The most recently uploaded community test results are listed ' +
'here.';
- ctrl.uploadState = '';
+ // ctrl.uploadState = '';
ctrl.isPublic = false;
- if (ctrl.isUserResults) {
- ctrl.authRequest = $scope.auth.doSignCheck()
- .then(ctrl.filterList);
- // ctrl.getUserProducts();
- } else {
- ctrl.filterList();
- }
+ // if (ctrl.isUserResults) {
+ // ctrl.authRequest = $scope.auth.doSignCheck()
+ // .then(ctrl.filterList);
+ // // ctrl.getUserProducts();
+ // } else {
+ // ctrl.filterList();
+ // }
function viewResult(_id){
$state.go('result', {'_id':_id}, {reload: true});
@@ -146,37 +139,6 @@
return false;
}
-
- function uploadFileToUrl(file, uploadUrl){
- var fd = new FormData();
- fd.append('file', file);
- fd.append('public', ctrl.isPublic)
-
- $http.post(uploadUrl, fd, {
- transformRequest: angular.identity,
- headers: {'Content-Type': undefined}
- })
-
- .success(function(data){
- var id = data.href.substr(data.href.lastIndexOf('/')+1);
- ctrl.uploadState = "Upload succeed. Result id is " + id;
- ctrl.filterList();
- })
-
- .error(function(data, status){
- ctrl.uploadState = "Upload failed. Error code is " + status;
- });
- }
-
- function uploadFile(){
- var file = $scope.resultFile;
- console.log('file is ' );
- console.dir(file);
-
- var uploadUrl = testapiApiUrl + "/results/upload";
- uploadFileToUrl(file, uploadUrl);
- };
-
/**
* This will contact the TestAPI API to get a listing of test run
* results.
@@ -248,158 +210,5 @@
ctrl.filter = undefined
ctrl.filterList();
}
-
- /**
- * This will send an API request in order to associate a metadata
- * key-value pair with the given testId
- * @param {Number} index - index of the test object in the results list
- * @param {String} key - metadata key
- * @param {String} value - metadata value
- */
- function associateMeta(index, key, value) {
- var testId = ctrl.data.results[index].id;
- var metaUrl = [
- testapiApiUrl, '/results/', testId, '/meta/', key
- ].join('');
-
- var editFlag = key + 'Edit';
- if (value) {
- ctrl.associateRequest = $http.post(metaUrl, value)
- .success(function () {
- ctrl.data.results[index][editFlag] = false;
- }).error(function (error) {
- raiseAlert('danger', error.title, error.detail);
- });
- }
- else {
- ctrl.unassociateRequest = $http.delete(metaUrl)
- .success(function () {
- ctrl.data.results[index][editFlag] = false;
- }).error(function (error) {
- if (error.code == 404) {
- // Key doesn't exist, so count it as a success,
- // and don't raise an alert.
- ctrl.data.results[index][editFlag] = false;
- }
- else {
- raiseAlert('danger', error.title, error.detail);
- }
- });
- }
- }
-
- /**
- * Retrieve an array of available capability files from the TestAPI
- * API server, sort this array reverse-alphabetically, and store it in
- * a scoped variable.
- * Sample API return array: ["2015.03.json", "2015.04.json"]
- */
- function getVersionList() {
- if (ctrl.versionList) {
- return;
- }
- var content_url = testapiApiUrl + '/guidelines';
- ctrl.versionsRequest =
- $http.get(content_url).success(function (data) {
- ctrl.versionList = data.sort().reverse();
- }).error(function (error) {
- raiseAlert('danger', error.title,
- 'Unable to retrieve version list');
- });
- }
-
- /**
- * Get products user has management rights to or all products depending
- * on the passed in parameter value.
- */
- function getUserProducts() {
- if (ctrl.products) {
- return;
- }
- var contentUrl = testapiApiUrl + '/products';
- ctrl.productsRequest =
- $http.get(contentUrl).success(function (data) {
- ctrl.products = {};
- angular.forEach(data.products, function(prod) {
- if (prod.can_manage) {
- ctrl.products[prod.id] = prod;
- }
- });
- }).error(function (error) {
- ctrl.products = null;
- ctrl.showError = true;
- ctrl.error =
- 'Error retrieving Products listing from server: ' +
- angular.toJson(error);
- });
- }
-
- /**
- * Send a PUT request to the API server to associate a product with
- * a test result.
- */
- function associateProductVersion(result) {
- var verId = (result.selectedVersion ?
- result.selectedVersion.id : null);
- var testId = result.id;
- var url = testapiApiUrl + '/results/' + testId;
- ctrl.associateRequest = $http.put(url, {'product_version_id':
- verId})
- .success(function (data) {
- result.product_version = result.selectedVersion;
- if (result.selectedVersion) {
- result.product_version.product_info =
- result.selectedProduct;
- }
- result.productEdit = false;
- }).error(function (error) {
- raiseAlert('danger', error.title, error.detail);
- });
- }
-
- /**
- * Get all versions for a product.
- */
- function getProductVersions(result) {
- if (!result.selectedProduct) {
- result.productVersions = [];
- result.selectedVersion = null;
- return;
- }
-
- var url = testapiApiUrl + '/products/' +
- result.selectedProduct.id + '/versions';
- ctrl.getVersionsRequest = $http.get(url)
- .success(function (data) {
- result.productVersions = data;
-
- // If the test result isn't already associated to a
- // version, default it to the null version.
- if (!result.product_version) {
- angular.forEach(data, function(ver) {
- if (!ver.version) {
- result.selectedVersion = ver;
- }
- });
- }
- }).error(function (error) {
- raiseAlert('danger', error.title, error.detail);
- });
- }
-
- /**
- * Instantiate variables needed for editing product/version
- * associations.
- */
- function prepVersionEdit(result) {
- result.productEdit = true;
- if (result.product_version) {
- result.selectedProduct =
- ctrl.products[result.product_version.product_info.id];
- }
- result.selectedVersion = result.product_version;
- ctrl.getProductVersions(result);
- }
-
}
})();
diff --git a/testapi/opnfv_testapi/ui/components/scenarios/modals/projectModal.html b/testapi/opnfv_testapi/ui/components/scenarios/modals/projectModal.html
index 5885a61..0a14be9 100644
--- a/testapi/opnfv_testapi/ui/components/scenarios/modals/projectModal.html
+++ b/testapi/opnfv_testapi/ui/components/scenarios/modals/projectModal.html
@@ -16,24 +16,6 @@
</div>
<div class="update-project">
<div class="col-sm-4">
- <label for="cpid" class="control-label"> Trust&nbsp;Indicator: </label>
- </div>
- <div class="col-sm-6">
- <button class="btn btn-primary" ng-click="projectModalCtrl.openTrustIndicatorModal()">Add&nbsp;Trust&nbsp;Indicator</button>
- <p class="help-block"></p>
- </div>
- </div>
- <div class="update-project">
- <div class="col-sm-4">
- <label for="cpid" class="control-label"> Score: </label>
- </div>
- <div class="col-sm-6">
- <button class="btn btn-primary" ng-click="projectModalCtrl.openScoreModal()">Add&nbsp;Score</button>
- <p class="help-block"></p>
- </div>
- </div>
- <div class="update-project">
- <div class="col-sm-4">
<label for="cpid" class="control-label"> Custom: </label>
</div>
<div class="col-sm-6">
@@ -46,50 +28,6 @@
</fieldset>
</div>
<div class='clo-md-12' style="padding-right:0px">
- <h3>Scores</h3>
- <div class="table-responsive">
- <table class="table table-bordered table-hover" ng-data="projectModalCtrl.project.scores">
- <thead>
- <tr style="
- text-align: center;">
- <th style="width: 1%;">Score</th>
- <th style="width: 19%;">Date</th>
- </tr>
- </thead>
- <tbody>
- <tr ng-repeat-start="(index, score) in projectModalCtrl.project.scores" style="padding:9px">
- <td>{{score.score}}</td>
- <td>{{score.date}}</td>
- </tr>
- <tr ng-repeat-end=>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div class='clo-md-12' style="padding-right:0px">
- <h3>Trust&nbsp;Indicator</h3>
- <div class="table-responsive">
- <table class="table table-bordered table-hover" ng-data="projectModalCtrl.project.trust_indicators">
- <thead>
- <tr style="
- text-align: center;">
- <th style="width: 1%;">Status</th>
- <th style="width: 19%;">Date</th>
- </tr>
- </thead>
- <tbody>
- <tr ng-repeat-start="(index, trustIndicator) in projectModalCtrl.project.trust_indicators" style="padding:9px">
- <td>{{trustIndicator.status}}</td>
- <td>{{trustIndicator.date}}</td>
- </tr>
- <tr ng-repeat-end=>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div class='clo-md-12' style="padding-right:0px">
<h3>Customs</h3>
<div class="table-responsive">
<table class="table table-bordered table-hover" ng-data="projectModalCtrl.project.customs">
diff --git a/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenario.html b/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenario.html
index d96986e..328a5e6 100644
--- a/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenario.html
+++ b/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenario.html
@@ -1,234 +1,241 @@
<legend>Scenario</legend>
-<div style="padding-right:0px">
- <div class="table-responsive">
- <table class="table" ng-data="ctrl.data">
- <tbody>
- <tr style="padding:9px">
- <td class="podsTableTd">Id&nbsp;:</td>
- <td class="podsTableLeftTd">{{ctrl.data.scenarios[0]._id}}</td>
- </tr>
- <tr style="padding:9px">
- <td class="podsTableTd">Name&nbsp;:</td>
- <td width="90%" class="podsTableLeftTd">{{ctrl.data.scenarios[0].name}}</td>
- </tr>
- <tr style="padding:9px">
- <td class="podsTableTd">Created&nbsp;at&nbsp;:</td>
- <td width="90%" class="podsTableLeftTd">{{ctrl.data.scenarios[0].creation_date}}</td>
- </tr>
- <tr style="padding:9px">
- <td class="podsTableTd">Installers</td>
- <td width="90%" class="podsTableLeftTd">
- <div class="col-md-1" style="padding:0px">
- <a ng-click="ctrl.expandInstallers()">
- <p ng-if="ctrl.collapeInstallers">Hide</p>
- <p ng-if="!ctrl.collapeInstallers">Show</p>
- </a>
- </div>
- <div class="col-md-1" style="padding:0px">
- <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 } ">
- <div class="table-responsive">
- <table class="table " ng-data="ctrl.data.scenarios[0].installers">
- <tbody ng-repeat="(index, installer) in ctrl.data.scenarios[0].installers">
- <tr style="padding:9px">
- <td class="podsTableTd">
- {{index+1}}.&nbsp;Installer:&nbsp;
- </td>
- <td class="podsTableLeftTd" style="width:10%;padding-top: 7px;">
- <a ng-click="ctrl.expandInstaller(index)">{{installer.installer}}</a>
- </td>
- <td style="width:80%;border: none; padding: 0px;">
- <button type="button" 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[index] }">
- <td class="podsTableTd">
- Versions:
- </td>
- <td width="90%" class="podsTableLeftTd">
- <div class="col-md-1" style="padding:0px">
- <a ng-click="ctrl.expandVersions(index)">
- <p ng-if="ctrl.collapeVersions[index]">Hide</p>
- <p ng-if="!ctrl.collapeVersions[index]">Show</p>
- </a>
+<div style="padding-right:0px" class="col-md-12">
+ <div class="table-responsive">
+ <table class="table" ng-data="ctrl.data">
+ <tbody>
+ <tr style="padding:9px">
+ <td class="podsTableTd">Id&nbsp;:</td>
+ <td class="podsTableLeftTd">{{ctrl.data.scenarios[0]._id}}</td>
+ </tr>
+ <tr style="padding:9px">
+ <td class="podsTableTd">Name&nbsp;:</td>
+ <td width="90%" class="podsTableLeftTd">{{ctrl.data.scenarios[0].name}}</td>
+ </tr>
+ <tr style="padding:9px">
+ <td class="podsTableTd">Created&nbsp;at&nbsp;:</td>
+ <td width="90%" class="podsTableLeftTd">{{ctrl.data.scenarios[0].creation_date}}</td>
+ </tr>
+ <tr style="padding:9px">
+ <td class="podsTableTd">Installers</td>
+ <td width="90%" class="podsTableLeftTd">
+ <div class="col-md-1" style="padding:0px">
+ <a ng-click="ctrl.expandInstallers()">
+ <p ng-if="ctrl.collapeInstallers">Hide</p>
+ <p ng-if="!ctrl.collapeInstallers">Show</p>
+ </a>
+ </div>
+ <div class="col-md-1" style="padding:0px" ng-class="{'hidden' : !ctrl.buttonInstaller || !auth.isAuthenticated}">
+ <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 } ">
+ <div class="table-responsive">
+ <table class="table " ng-data="ctrl.data.scenarios[0].installers">
+ <tbody ng-repeat="(indexI, installer) in ctrl.data.scenarios[0].installers">
+ <tr style="padding:9px">
+ <td class="podsTableTd">
+ {{indexI+1}}.&nbsp;Installer:&nbsp;
+ </td>
+ <td class="podsTableLeftTd" style="width:10%;padding-top: 7px;">
+ <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>
+ </td>
+ </tr>
+ <tr ng-class="{ 'hidden' : ! ctrl.collapeInstaller[indexI] }">
+ <td class="podsTableTd">
+ Versions:
+ </td>
+ <td width="90%" class="podsTableLeftTd">
+ <div class="col-md-1" style="padding:0px">
+ <a ng-click="ctrl.expandVersions(indexI)">
+ <p ng-if="ctrl.collapeVersions[indexI]">Hide</p>
+ <p ng-if="!ctrl.collapeVersions[indexI]">Show</p>
+ </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>
+ </div>
+ <div ng-class="{ 'hidden' : ! ctrl.collapeVersions[indexI] } " class="col-md-12">
+ <div class="table-responsive">
+ <table class="table " ng-data="inctrl.data.scenarios[0].installers">
+ <tbody ng-repeat="(indexV, version) in installer.versions">
+ <tr style="padding:9px">
+ <td class="podsTableTd">
+ {{indexV+1}}.&nbsp;Version:
+ </td>
+ <td class="podsTableLeftTd" style="width:10%;padding-top: 7px;">
+ <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>
+ </td>
+ </tr>
+ <tr style="padding:9px" ng-class="{ 'hidden' : ! ctrl.collapeVersion[indexI][indexV] } ">
+ <td class="podsTableTd">
+ Owner:
+ </td>
+ <td class="podsTableLeftTd" style="width:90%">{{version.owner}}</td>
+ </tr>
+ <tr style="padding:9px" ng-class="{ 'hidden' : ! ctrl.collapeVersion[indexI][indexV] }">
+ <td class="podsTableTd">
+ Projects:
+ </td>
+ <td width="90%" class="podsTableLeftTd">
+ <div class="col-md-1" style="padding:0px">
+ <a ng-click="ctrl.expandProjects(indexI,indexV)">
+ <p style="width:50%" ng-if="ctrl.collapeProjects[indexI][indexV]">Hide</p>
+ <p style="width:50%" ng-if="!ctrl.collapeProjects[indexI][indexV]">Show</p>
+ </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>
+ </div>
+ <div ng-class="{ 'hidden' : ! ctrl.collapeProjects[indexI][indexV] } " class="col-md-12">
+ <div class="table-responsive">
+ <table class="table " ng-data="version.projects">
+ <tbody ng-repeat="(indexP, project) in version.projects" >
+ <tr style="padding:9px">
+ <td class="podsTableTd">
+ {{indexP+1}}.&nbsp;Project:
+ </td>
+ <td class="podsTableLeftTd" style="width:10%;padding-top: 7px;">
+ <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>
+ </td>
+ </tr>
+ <tr ng-class="{ 'hidden' : ! ctrl.collapeProject[indexI][indexV][indexP] }">
+ <td class="podsTableTd">
+ Trust&nbsp;Indicators:
+ </td>
+ <td class="podsTableLeftTd" style="width:90%">
+ <a ng-click="ctrl.expandTrustIndicator(indexI, indexV, indexP)">
+ <p ng-if="ctrl.collapeTrustIndicator[indexI][indexV][indexP]">Hide</p>
+ <p ng-if="!ctrl.collapeTrustIndicator[indexI][indexV][indexP]">Show</p>
+ </a>
+ <table class="table " ng-class="{ 'hidden' : ! ctrl.collapeTrustIndicator[indexI][indexV][indexP] } " ng-data="project.trust_indicators">
+ <tbody ng-repeat="(indexTI, trust_indicator) in project.trust_indicators" >
+ <tr style="padding:9px">
+ <td class="podsTableTd">
+ Status:&nbsp;
+ </td>
+ <td width="90%" class="podsTableLeftTd">
+ {{trust_indicator.status}}
+ </td>
+ </tr>
+ <tr style="padding:9px">
+ <td class="podsTableTd">
+ Date:&nbsp;
+ </td>
+ <td width="90%" class="podsTableLeftTd">
+ {{trust_indicator.date}}
+ </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>
+ <tr ng-class="{ 'hidden' : ! ctrl.collapeProject[indexI][indexV][indexP] }">
+ <td class="podsTableTd">
+ Scores:
+ </td>
+ <td class="podsTableLeftTd" style="width:90%">
+ <a ng-click="ctrl.expandScore(indexI, indexV, indexP)">
+ <p ng-if="ctrl.collapeScore[indexI][indexV][indexP]">Hide</p>
+ <p ng-if="!ctrl.collapeScore[indexI][indexV][indexP]">Show</p>
+ </a>
+ <table class="table" ng-class="{ 'hidden' : ! ctrl.collapeScore[indexI][indexV][indexP] } " ng-data="project.scores">
+ <tbody ng-repeat="(indexSC, score) in project.scores" >
+ <tr style="padding:9px">
+ <td class="podsTableTd">
+ Score:&nbsp;
+ </td>
+ <td width="90%" class="podsTableLeftTd">
+ {{score.score}}
+ </td>
+ </tr>
+ <tr style="padding:9px">
+ <td class="podsTableTd">
+ Date:&nbsp;
+ </td>
+ <td width="90%" class="podsTableLeftTd">
+ {{score.date}}
+ </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>
+ <tr ng-class="{ 'hidden' : ! ctrl.collapeProject[indexI][indexV][indexP] }">
+ <td class="podsTableTd">
+ Customs:
+ </td>
+ <td class="podsTableLeftTd" style="width:90%">
+ <a ng-click="ctrl.expandCustom(indexI, indexV, indexP)">
+ <p ng-if="ctrl.collapeCustom[indexI][indexV][indexP]">Hide</p>
+ <p ng-if="!ctrl.collapeCustom[indexI][indexV][indexP]">Show</p>
+ </a>
+ <table class="table" ng-class="{ 'hidden' : ! ctrl.collapeCustom[indexI][indexV][indexP] } " ng-data="project.customs">
+ <tbody>
+ <tr ng-repeat-start="(indexCU, custom) in project.customs" style="padding:9px">
+ <td class="podsTableTd" style="float: none!important;">
+ {{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>
+ </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>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ <tr ng-repeat-end=>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
</div>
- <div class="col-md-1" style="padding:0px">
- <button type="button" class="btn btn-success btn-xs" ng-click="ctrl.openAddVersionModal(installer.installer)" ><i class="fa fa-plus"></i>Add</button>
- </div>
- <div ng-class="{ 'hidden' : ! ctrl.collapeVersions[index] } " class="col-md-12">
- <div class="table-responsive">
- <table class="table " ng-data="inctrl.data.scenarios[0].installers">
- <tbody ng-repeat="(index, version) in installer.versions">
- <tr style="padding:9px">
- <td class="podsTableTd">
- {{index+1}}.&nbsp;Version:
- </td>
- <td class="podsTableLeftTd" style="width:10%;padding-top: 7px;">
- <a ng-click="ctrl.expandVersion(index)">{{version.version}}</a>
- </td>
- <td style="width:80%;border: none; padding: 0px;">
- <button type="button" class="btn btn-danger btn-xs" 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[index] } ">
- <td class="podsTableTd">
- Owner:
- </td>
- <td class="podsTableLeftTd" style="width:90%">{{version.owner}}</td>
- </tr>
- <tr style="padding:9px" ng-class="{ 'hidden' : ! ctrl.collapeVersion[index] }">
- <td class="podsTableTd">
- Projects:
- </td>
- <td width="90%" class="podsTableLeftTd">
- <div class="col-md-1" style="padding:0px">
- <a ng-click="ctrl.expandProjects(index)">
- <p style="width:50%" ng-if="ctrl.collapeProjects[index]">Hide</p>
- <p style="width:50%" ng-if="!ctrl.collapeProjects[index]">Show</p>
- </a>
- </div>
- <div class="col-md-1" style="padding:0px">
- <button type="button" 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[index] } " class="col-md-12">
- <div class="table-responsive">
- <table class="table " ng-data="version.projects">
- <tbody ng-repeat="(index, project) in version.projects" >
- <tr style="padding:9px">
- <td class="podsTableTd">
- {{index+1}}.&nbsp;Project:
- </td>
- <td class="podsTableLeftTd" style="width:90%">
- <a ng-click="ctrl.expandProject(index)">{{project.project}}</a>
- </td>
- </tr>
- <tr ng-class="{ 'hidden' : ! ctrl.collapeProject[index] }">
- <td class="podsTableTd">
- Trust&nbsp;Indicators:
- </td>
- <td class="podsTableLeftTd" style="width:90%">
- <a ng-click="ctrl.expandTrustIndicator(index)">
- <p ng-if="ctrl.collapeTrustIndicator[index]">Hide</p>
- <p ng-if="!ctrl.collapeTrustIndicator[index]">Show</p>
- </a>
- <table class="table " ng-class="{ 'hidden' : ! ctrl.collapeTrustIndicator[index] } " ng-data="project.trust_indicators">
- <tbody ng-repeat="(index, trust_indicator) in project.trust_indicators" >
- <tr style="padding:9px">
- <td class="podsTableTd">
- Status:&nbsp;
- </td>
- <td width="90%" class="podsTableLeftTd">
- {{trust_indicator.status}}
- </td>
- </tr>
- <tr style="padding:9px">
- <td class="podsTableTd">
- Date:&nbsp;
- </td>
- <td width="90%" class="podsTableLeftTd">
- {{trust_indicator.date}}
- </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]}">
- <i class="fa fa-plus"></i>Add</button>
- </tr>
- </table>
- </td>
- </tr>
- <tr ng-class="{ 'hidden' : ! ctrl.collapeProject[index] }">
- <td class="podsTableTd">
- Scores:
- </td>
- <td class="podsTableLeftTd" style="width:90%">
- <a ng-click="ctrl.expandScore(index)">
- <p ng-if="ctrl.collapeScore[index]">Hide</p>
- <p ng-if="!ctrl.collapeScore[index]">Show</p>
- </a>
- <table class="table" ng-class="{ 'hidden' : ! ctrl.collapeScore[index] } " ng-data="project.scores">
- <tbody ng-repeat="(index, score) in project.scores" >
- <tr style="padding:9px">
- <td class="podsTableTd">
- Score:&nbsp;
- </td>
- <td width="90%" class="podsTableLeftTd">
- {{score.score}}
- </td>
- </tr>
- <tr style="padding:9px">
- <td class="podsTableTd">
- Date:&nbsp;
- </td>
- <td width="90%" class="podsTableLeftTd">
- {{score.date}}
- </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]}"><i class="fa fa-plus"></i>Add</button>
- </tr>
- </table>
- </td>
- </tr>
- <tr ng-class="{ 'hidden' : ! ctrl.collapeProject[index] }">
- <td class="podsTableTd">
- Customs:
- </td>
- <td class="podsTableLeftTd" style="width:90%">
- <a ng-click="ctrl.expandCustom(index)">
- <p ng-if="ctrl.collapeCustom[index]">Hide</p>
- <p ng-if="!ctrl.collapeCustom[index]">Show</p>
- </a>
- <table class="table" ng-class="{ 'hidden' : ! ctrl.collapeCustom[index] } " ng-data="project.customs">
- <tbody>
- <tr ng-repeat-start="(index, custom) in project.customs" style="padding:9px">
- <td class="podsTableTd" style="float: none!important;">
- {{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)" ><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[index]}"><i class="fa fa-plus"></i>Add</button>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
- <!-- </div> -->
- <tr ng-repeat-end=>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
</div>
+</div>
<div class="row" style="margin-bottom:24px;"></div>
-<div ng-show="ctrl.showError" class="alert alert-danger col-md-8" role="alert" style="margin-top:0px">
- <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
- <span class="sr-only">Error:</span>
- {{ctrl.error}}
+<div class='clo-md-12'>
+ <div ng-show="ctrl.showError" class="alert alert-danger" role="alert">
+ <span class="pull-right">&nbsp;{{ctrl.error}}</span>
+ <span class="glyphicon glyphicon-exclamation-sign pull-right" aria-hidden="true" >Error:</span>
+ </div>
+ <div ng-show="ctrl.showSuccess" class="alert alert-success" role="alert">
+ <span class="pull-right">&nbsp;{{ctrl.success}}</span>
+ <span class="glyphicon glyphicon-ok pull-right" aria-hidden="true"></span>
+ </div>
</div>
<div class="row" style="margin-bottom:24px;"></div> \ No newline at end of file
diff --git a/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenarioController.js b/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenarioController.js
index eff1930..53eb13a 100644
--- a/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenarioController.js
+++ b/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenarioController.js
@@ -45,20 +45,16 @@
ctrl.expandTrustIndicator = expandTrustIndicator;
ctrl.expandScore = expandScore;
ctrl.expandCustom = expandCustom;
- ctrl.collapeVersion = {};
- ctrl.collapeVersions = {};
- ctrl.collapeProjects = {};
- ctrl.collapeProject = {};
- ctrl.collapeTrustIndicator = {};
- ctrl.collapeScore = {};
- ctrl.collapeCustom = {};
- ctrl.collapeInstaller = {};
+ ctrl.collapeVersion = [];
+ ctrl.collapeVersions = [];
+ ctrl.collapeProjects = [];
+ ctrl.collapeProject = [];
+ ctrl.collapeTrustIndicator = [];
+ ctrl.collapeScore = [];
+ ctrl.collapeCustom = [];
+ ctrl.collapeInstaller = [];
ctrl.addCustom = addCustom;
ctrl.openAddCustomModal = openAddCustomModal;
- ctrl.openAddTrustIndicatorModal = openAddTrustIndicatorModal;
- ctrl.addTrustindicator = addTrustindicator;
- ctrl.addScore = addScore;
- ctrl.openAddScoreModal = openAddScoreModal;
ctrl.openDeleteCustomModal = openDeleteCustomModal;
ctrl.deleteCustom = deleteCustom;
ctrl.addProject = addProject
@@ -71,6 +67,12 @@
ctrl.addInstaller = addInstaller
ctrl.openDeleteInstallerModal = openDeleteInstallerModal
ctrl.deleteInstaller = deleteInstaller
+ ctrl.openDeleteProjectModal = openDeleteProjectModal
+ ctrl.deleteProject = deleteProject
+
+ ctrl.buttonInstaller = true
+ ctrl.buttonVersion = true
+ ctrl.buttonProject = true
/**
* This will contact the TestAPI to get a listing of declared projects.
@@ -87,61 +89,97 @@
});
}
- function expandTrustIndicator(index){
- if(ctrl.collapeTrustIndicator[index]){
- ctrl.collapeTrustIndicator[index] = false;
+ function expandTrustIndicator(indexI, indexV, indexP){
+ if(ctrl.collapeTrustIndicator[indexI]==undefined){
+ ctrl.collapeTrustIndicator[indexI] = []
+ if(ctrl.collapeTrustIndicator[indexI][indexV]==undefined){
+ ctrl.collapeTrustIndicator[indexI][indexV] = []
+ }
+ }
+ if(ctrl.collapeTrustIndicator[indexI][indexV][indexP]){
+ ctrl.collapeTrustIndicator[indexI][indexV][indexP] = false;
}else{
- ctrl.collapeTrustIndicator[index] = true;
+ ctrl.collapeTrustIndicator[indexI][indexV][indexP] = true;
}
}
- function expandScore(index){
- if(ctrl.collapeScore[index]){
- ctrl.collapeScore[index] = false;
+ function expandScore(indexI, indexV, indexP){
+ if(ctrl.collapeScore[indexI]==undefined){
+ ctrl.collapeScore[indexI] = []
+ if(ctrl.collapeScore[indexI][indexV]==undefined){
+ ctrl.collapeScore[indexI][indexV] = []
+ }
+ }
+ if(ctrl.collapeScore[indexI][indexV][indexP]){
+ ctrl.collapeScore[indexI][indexV][indexP] = false;
}else{
- ctrl.collapeScore[index] = true;
+ ctrl.collapeScore[indexI][indexV][indexP] = true;
}
}
- function expandCustom(index){
- if(ctrl.collapeCustom[index]){
- ctrl.collapeCustom[index] = false;
+ function expandCustom(indexI, indexV, indexP){
+ if(ctrl.collapeCustom[indexI]==undefined){
+ ctrl.collapeCustom[indexI] = []
+ if(ctrl.collapeCustom[indexI][indexV]==undefined){
+ ctrl.collapeCustom[indexI][indexV] = []
+ }
+ }
+ if(ctrl.collapeCustom[indexI][indexV][indexP]){
+ ctrl.collapeCustom[indexI][indexV][indexP] = false;
+ ctrl.buttonProject = true
}else{
- ctrl.collapeCustom[index] = true;
+ ctrl.collapeCustom[indexI][indexV][indexP] = true;
+ ctrl.buttonProject = false
}
}
- function expandVersion(index){
- if(ctrl.collapeVersion[index]){
- ctrl.collapeVersion[index] = false;
+ function expandVersion(indexI, indexV){
+ if(ctrl.collapeVersion[indexI]==undefined){
+ ctrl.collapeVersion[indexI] = []
+ }
+ if(ctrl.collapeVersion[indexI][indexV]){
+ ctrl.collapeVersion[indexI][indexV] = false;
}else{
- ctrl.collapeVersion[index] = true;
+ ctrl.collapeVersion[indexI][indexV] = true;
}
}
function expandVersions(index){
if(ctrl.collapeVersions[index]){
ctrl.collapeVersions[index] = false;
+ ctrl.buttonInstaller = true
}else{
ctrl.collapeVersions[index] = true;
+ ctrl.buttonInstaller = false
}
}
- function expandProjects(index){
- if(ctrl.collapeProjects[index]){
- ctrl.collapeProjects[index] = false;
+ function expandProjects(indexI, indexV){
+ if(ctrl.collapeProjects[indexI]==undefined){
+ ctrl.collapeProjects[indexI] = []
+ }
+ if(ctrl.collapeProjects[indexI][indexV]){
+ ctrl.collapeProjects[indexI][indexV] = false;
+ ctrl.buttonVersion = true
}
else{
- ctrl.collapeProjects[index]= true;
+ ctrl.collapeProjects[indexI][indexV]= true;
+ ctrl.buttonVersion = false
}
}
- function expandProject(index){
- if(ctrl.collapeProject[index]){
- ctrl.collapeProject[index] = false;
+ function expandProject(indexI, indexV, indexP){
+ if(ctrl.collapeProject[indexI]==undefined){
+ ctrl.collapeProject[indexI] = []
+ if(ctrl.collapeProject[indexI][indexV]==undefined){
+ ctrl.collapeProject[indexI][indexV] = []
+ }
+ }
+ if(ctrl.collapeProject[indexI][indexV][indexP]){
+ ctrl.collapeProject[indexI][indexV][indexP] = false;
}
else{
- ctrl.collapeProject[index]= true;
+ ctrl.collapeProject[indexI][indexV][indexP]= true;
}
}
@@ -356,62 +394,22 @@
});
}
- function openAddTrustIndicatorModal(project, version, installer){
- $uibModal.open({
- templateUrl: 'testapi-ui/components/scenarios/modals/trustIndicatorModal.html',
- controller: 'trustIndicatorAddModalCtrl as trustIndicatorModalCtrl',
- size: 'md',
- resolve: {
- data: function () {
- return {
- text: "Add Trust Indicator",
- successHandler: ctrl.addTrustindicator,
- project: project,
- version: version,
- installer: installer
- };
- }
- }
- });
- }
-
- function openAddScoreModal(project, version, installer){
- $uibModal.open({
- templateUrl: 'testapi-ui/components/scenarios/modals/scoreModal.html',
- controller: 'scoreAddModalCtrl as scoreModalCtrl',
- size: 'md',
- resolve: {
- data: function () {
- return {
- text: "Add Score",
- successHandler: ctrl.addScore,
- project: project,
- version: version,
- installer: installer
- };
- }
- }
- });
- }
-
- function addTrustindicator(trust_indicator, project, version, installer){
- ctrl.customReqest = testapiApiUrl+ "/scenarios/"+ ctrl.name + "/trust_indicators?installer="+installer+"&version="+version+"&project="+ project
- $http.post(ctrl.customReqest,trust_indicator ).success(function (data){
- ctrl.showSuccess = true ;
- ctrl.success = "Trust indicators are successfully updated."
- ctrl.loadDetails();
- })
- .catch(function (data) {
- ctrl.showError = true;
- ctrl.error = data.statusText;
- });
+ function openDeleteProjectModal(project, version, installer){
+ var projects = []
+ projects.push(project.project)
+ var data = {
+ "projects": projects,
+ "version": version,
+ "installer": installer
+ }
+ confirmModal("Delete",ctrl.deleteProject,data);
}
- function addScore(score, project, version, installer){
- ctrl.customReqest = testapiApiUrl+ "/scenarios/"+ ctrl.name + "/scores?installer="+installer+"&version="+version+"&project="+ project
- $http.post(ctrl.customReqest,score ).success(function (data){
+ function deleteProject(data){
+ ctrl.projectReqest = testapiApiUrl+ "/scenarios/"+ ctrl.name + "/projects?installer="+data.installer+"&version="+data.version
+ $http.delete(ctrl.projectReqest, {data: data.projects, headers: {'Content-Type': 'application/json'}}).success(function (data){
ctrl.showSuccess = true ;
- ctrl.success = "Scores are successfully updated."
+ ctrl.success = "Projects are successfully Deleted."
ctrl.loadDetails();
})
.catch(function (data) {
@@ -459,107 +457,8 @@
}
}
- /**
- * TestAPI Project Modal Controller
- * This controller is for the create modal where a user can create
- * the project information and for the edit modal where user can
- * edit the project's details
- */
- angular.module('testapiApp').controller('trustIndicatorAddModalCtrl', trustIndicatorAddModalCtrl);
- trustIndicatorAddModalCtrl.$inject = ['$scope', '$uibModalInstance', 'data'];
- function trustIndicatorAddModalCtrl($scope, $uibModalInstance, data) {
- var ctrl = this;
- ctrl.confirm = confirm;
- ctrl.cancel = cancel;
- ctrl.data = angular.copy(data);
- ctrl.open = open;
-
-
- /**
- * Initiate confirmation and call the success handler with the
- * inputs.
- */
- function confirm() {
- ctrl.data.successHandler(ctrl.ti, ctrl.data.project, ctrl.data.version, ctrl.data.installer);
- $uibModalInstance.dismiss('cancel');
- }
-
- /**
- * Close the confirm modal without initiating changes.
- */
- function cancel() {
- $uibModalInstance.dismiss('cancel');
- }
-
- function handleModalData(){
-
- }
-
- /**
- * This is called when the date filter calendar is opened. It
- * does some event handling, and sets a scope variable so the UI
- * knows which calendar was opened.
- * @param {Object} $event - The Event object
- * @param {String} openVar - Tells which calendar was opened
- */
- function open($event, openVar) {
- $event.preventDefault();
- $event.stopPropagation();
- ctrl[openVar] = true;
- }
- }
-
- /**
- * TestAPI Project Modal Controller
- * This controller is for the create modal where a user can create
- * the project information and for the edit modal where user can
- * edit the project's details
- */
- angular.module('testapiApp').controller('scoreAddModalCtrl', scoreAddModalCtrl);
- scoreAddModalCtrl.$inject = ['$scope', '$uibModalInstance', 'data'];
- function scoreAddModalCtrl($scope, $uibModalInstance, data) {
- var ctrl = this;
- ctrl.confirm = confirm;
- ctrl.cancel = cancel;
- ctrl.data = angular.copy(data);
- ctrl.open = open;
-
- /**
- * Initiate confirmation and call the success handler with the
- * inputs.
- */
- function confirm() {
- ctrl.data.successHandler(ctrl.score, ctrl.data.project, ctrl.data.version, ctrl.data.installer);
- $uibModalInstance.dismiss('cancel');
- }
-
- /**
- * Close the confirm modal without initiating changes.
- */
- function cancel() {
- $uibModalInstance.dismiss('cancel');
- }
-
- function handleModalData(){
-
- }
-
- /**
- * This is called when the date filter calendar is opened. It
- * does some event handling, and sets a scope variable so the UI
- * knows which calendar was opened.
- * @param {Object} $event - The Event object
- * @param {String} openVar - Tells which calendar was opened
- */
- function open($event, openVar) {
- $event.preventDefault();
- $event.stopPropagation();
- ctrl[openVar] = true;
- }
- }
-
- /**
+ /**
* TestAPI Project Modal Controller
* This controller is for the create modal where a user can create
* the project information and for the edit modal where user can
@@ -572,11 +471,7 @@
ctrl.confirm = confirm;
ctrl.cancel = cancel;
ctrl.data = angular.copy(data);
- ctrl.openScoreModal = openScoreModal;
- ctrl.openTrustIndicatorModal = openTrustIndicatorModal;
ctrl.openCustomModal = openCustomModal;
- ctrl.handleScore = handleScore;
- ctrl.handleModalTrustIndicator = handleModalTrustIndicator;
ctrl.handleModalCustom = handleModalCustom;
ctrl.projects = []
ctrl.project = {
@@ -604,48 +499,10 @@
$uibModalInstance.dismiss('cancel');
}
- function handleModalTrustIndicator(trustIndicator){
- ctrl.project.trust_indicators.push(trustIndicator)
- }
-
- function handleScore(score){
- ctrl.project.scores.push(score);
- }
-
function handleModalCustom(custom){
ctrl.project.customs.push(custom);
}
- function openScoreModal(){
- $uibModal.open({
- templateUrl: 'testapi-ui/components/scenarios/modals/scoreModal.html',
- controller: 'scoreModalCtrl as scoreModalCtrl',
- size: 'md',
- resolve: {
- data: function () {
- return {
- text: "Score",
- successHandler: ctrl.handleScore,
- };
- }
- }
- });
- }
- function openTrustIndicatorModal(){
- $uibModal.open({
- templateUrl: 'testapi-ui/components/scenarios/modals/trustIndicatorModal.html',
- controller: 'trustIndicatorModalCtrl as trustIndicatorModalCtrl',
- size: 'md',
- resolve: {
- data: function () {
- return {
- text: "Trust Indicator",
- successHandler: ctrl.handleModalTrustIndicator
- };
- }
- }
- });
- }
function openCustomModal(){
$uibModal.open({
templateUrl: 'testapi-ui/components/scenarios/modals/customModal.html',
diff --git a/testapi/opnfv_testapi/ui/components/scenarios/scenarios.html b/testapi/opnfv_testapi/ui/components/scenarios/scenarios.html
index 75a21b7..9057b0f 100644
--- a/testapi/opnfv_testapi/ui/components/scenarios/scenarios.html
+++ b/testapi/opnfv_testapi/ui/components/scenarios/scenarios.html
@@ -7,7 +7,7 @@
</div>
<div class="col-sm-2 pull-right" ng-class="{ 'hidden': !auth.isAuthenticated}">
<button type="button" class="btn btn-success" ng-click="ctrl.openScenarioModal()">
- <i class="fa fa-plus"></i>Create&nbsp;Scenario</button>
+ <i class="fa fa-plus"></i>Create</button>
</div>
</div>
<div class='clo-md-12'>
@@ -45,7 +45,7 @@
</td>
<td ng-class="{'hidden': !auth.isAuthenticated}">
<span class="podsTable-col">
- <a class="text-warning" ng-click="ctrl.openUpdateModal(scenario.name)" title="Edit Name">
+ <a class="text-warning" ng-click="ctrl.openUpdateModal(scenario.name)" title="Edit">
<i class="fa fa-pencil-square-o"></i></a>
<a class="text-danger" ng-click="ctrl.openDeleteModal(scenario.name)" title="Delete">
<i class="fa fa-trash-o"></i></a>
diff --git a/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js b/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js
index 4243e21..fd137e5 100644
--- a/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js
+++ b/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js
@@ -348,11 +348,7 @@
ctrl.confirm = confirm;
ctrl.cancel = cancel;
ctrl.data = angular.copy(data);
- ctrl.openScoreModal = openScoreModal;
- ctrl.openTrustIndicatorModal = openTrustIndicatorModal;
ctrl.openCustomModal = openCustomModal;
- ctrl.handleScore = handleScore;
- ctrl.handleModalTrustIndicator = handleModalTrustIndicator;
ctrl.handleModalCustom = handleModalCustom;
ctrl.project = {
"scores": [],
@@ -379,48 +375,10 @@
$uibModalInstance.dismiss('cancel');
}
- function handleModalTrustIndicator(trustIndicator){
- ctrl.project.trust_indicators.push(trustIndicator)
- }
-
- function handleScore(score){
- ctrl.project.scores.push(score);
- }
-
function handleModalCustom(custom){
ctrl.project.customs.push(custom);
}
- function openScoreModal(){
- $uibModal.open({
- templateUrl: 'testapi-ui/components/scenarios/modals/scoreModal.html',
- controller: 'scoreModalCtrl as scoreModalCtrl',
- size: 'md',
- resolve: {
- data: function () {
- return {
- text: "Score",
- successHandler: ctrl.handleScore,
- };
- }
- }
- });
- }
- function openTrustIndicatorModal(){
- $uibModal.open({
- templateUrl: 'testapi-ui/components/scenarios/modals/trustIndicatorModal.html',
- controller: 'trustIndicatorModalCtrl as trustIndicatorModalCtrl',
- size: 'md',
- resolve: {
- data: function () {
- return {
- text: "Trust Indicator",
- successHandler: ctrl.handleModalTrustIndicator
- };
- }
- }
- });
- }
function openCustomModal(){
$uibModal.open({
templateUrl: 'testapi-ui/components/scenarios/modals/customModal.html',
@@ -444,106 +402,6 @@
* the project information and for the edit modal where user can
* edit the project's details
*/
- angular.module('testapiApp').controller('scoreModalCtrl', scoreModalCtrl);
- scoreModalCtrl.$inject = ['$scope', '$uibModalInstance', 'data'];
- function scoreModalCtrl($scope, $uibModalInstance, data) {
- var ctrl = this;
- ctrl.confirm = confirm;
- ctrl.cancel = cancel;
- ctrl.data = angular.copy(data);
- ctrl.open = open;
-
- /**
- * Initiate confirmation and call the success handler with the
- * inputs.
- */
- function confirm() {
- ctrl.data.successHandler(ctrl.score);
- $uibModalInstance.dismiss('cancel');
- }
-
- /**
- * Close the confirm modal without initiating changes.
- */
- function cancel() {
- $uibModalInstance.dismiss('cancel');
- }
-
- function handleModalData(){
-
- }
-
- /**
- * This is called when the date filter calendar is opened. It
- * does some event handling, and sets a scope variable so the UI
- * knows which calendar was opened.
- * @param {Object} $event - The Event object
- * @param {String} openVar - Tells which calendar was opened
- */
- function open($event, openVar) {
- $event.preventDefault();
- $event.stopPropagation();
- ctrl[openVar] = true;
- }
- }
-
- /**
- * TestAPI Project Modal Controller
- * This controller is for the create modal where a user can create
- * the project information and for the edit modal where user can
- * edit the project's details
- */
- angular.module('testapiApp').controller('trustIndicatorModalCtrl', trustIndicatorModalCtrl);
- trustIndicatorModalCtrl.$inject = ['$scope', '$uibModalInstance', 'data'];
- function trustIndicatorModalCtrl($scope, $uibModalInstance, data) {
- var ctrl = this;
- ctrl.confirm = confirm;
- ctrl.cancel = cancel;
- ctrl.data = angular.copy(data);
- ctrl.open = open;
-
-
- /**
- * Initiate confirmation and call the success handler with the
- * inputs.
- */
- function confirm() {
- ctrl.data.successHandler(ctrl.ti);
- $uibModalInstance.dismiss('cancel');
-
- }
-
- /**
- * Close the confirm modal without initiating changes.
- */
- function cancel() {
- $uibModalInstance.dismiss('cancel');
- }
-
- function handleModalData(){
-
- }
-
- /**
- * This is called when the date filter calendar is opened. It
- * does some event handling, and sets a scope variable so the UI
- * knows which calendar was opened.
- * @param {Object} $event - The Event object
- * @param {String} openVar - Tells which calendar was opened
- */
- function open($event, openVar) {
- $event.preventDefault();
- $event.stopPropagation();
- ctrl[openVar] = true;
- }
- }
-
- /**
- * TestAPI Project Modal Controller
- * This controller is for the create modal where a user can create
- * the project information and for the edit modal where user can
- * edit the project's details
- */
angular.module('testapiApp').controller('customModalCtrl', customModalCtrl);
customModalCtrl.$inject = ['$scope', '$uibModalInstance', 'data'];
function customModalCtrl($scope, $uibModalInstance, data) {