diff options
Diffstat (limited to 'testapi/opnfv_testapi')
27 files changed, 1365 insertions, 453 deletions
diff --git a/testapi/opnfv_testapi/common/check.py b/testapi/opnfv_testapi/common/check.py index 9b3ab01..1a66dd7 100644 --- a/testapi/opnfv_testapi/common/check.py +++ b/testapi/opnfv_testapi/common/check.py @@ -29,7 +29,7 @@ def is_authorized(method): if not user_info: raises.Unauthorized(message.not_lfid()) if method.__name__ == "_create": - kwargs['owner'] = testapi_id + kwargs['creator'] = testapi_id if self.table in ['projects']: query = kwargs.get('query') if type(query) is not dict: diff --git a/testapi/opnfv_testapi/handlers/deploy_result_handlers.py b/testapi/opnfv_testapi/handlers/deploy_result_handlers.py index 973bfef..a8fcd88 100644 --- a/testapi/opnfv_testapi/handlers/deploy_result_handlers.py +++ b/testapi/opnfv_testapi/handlers/deploy_result_handlers.py @@ -1,6 +1,7 @@ from opnfv_testapi.handlers import result_handlers from opnfv_testapi.models import deploy_result_models from opnfv_testapi.tornado_swagger import swagger +from bson import objectid class GenericDeployResultHandler(result_handlers.GenericResultHandler): @@ -113,3 +114,17 @@ class DeployResultsHandler(GenericDeployResultHandler): self._create(miss_fields=miss_fields, carriers=carriers, values_check=values_check) + + +class DeployResultHandler(GenericDeployResultHandler): + @swagger.operation(nickname='getTestDeployResultById') + def get(self, result_id): + """ + @description: get a single deploy result by result_id + @rtype: L{DeployResult} + @return 200: Deploy result exist + @raise 404: Deploy result not exist + """ + query = dict() + query["_id"] = objectid.ObjectId(result_id) + self._get_one(query=query) diff --git a/testapi/opnfv_testapi/models/pod_models.py b/testapi/opnfv_testapi/models/pod_models.py index 0eddfcc..8af5297 100644 --- a/testapi/opnfv_testapi/models/pod_models.py +++ b/testapi/opnfv_testapi/models/pod_models.py @@ -30,7 +30,7 @@ class Pod(PodCreateRequest): def __init__(self, **kwargs): self._id = kwargs.pop('_id', '') self.creation_date = kwargs.pop('creation_date', '') - self.owner = kwargs.pop('owner', '') + self.creator = kwargs.pop('creator', '') super(Pod, self).__init__(**kwargs) diff --git a/testapi/opnfv_testapi/models/project_models.py b/testapi/opnfv_testapi/models/project_models.py index 5f280f1..eac2fd3 100644 --- a/testapi/opnfv_testapi/models/project_models.py +++ b/testapi/opnfv_testapi/models/project_models.py @@ -27,11 +27,12 @@ class ProjectUpdateRequest(base_models.ModelBase): @swagger.model() class Project(base_models.ModelBase): def __init__(self, - name=None, _id=None, description=None, create_date=None): + name=None, creator='', _id=None, description=None, creation_date=None): + self.creator = creator self._id = _id self.name = name self.description = description - self.creation_date = create_date + self.creation_date = creation_date @swagger.model() diff --git a/testapi/opnfv_testapi/models/scenario_models.py b/testapi/opnfv_testapi/models/scenario_models.py index 0610c6b..01b5c2b 100644 --- a/testapi/opnfv_testapi/models/scenario_models.py +++ b/testapi/opnfv_testapi/models/scenario_models.py @@ -178,8 +178,9 @@ class Scenario(base_models.ModelBase): @property installers: @ptype installers: C{list} of L{ScenarioInstaller} """ - def __init__(self, name='', create_date='', _id='', installers=None): + def __init__(self, name='', create_date='', _id='', creator='', installers=None): self.name = name + self.creator = creator self._id = _id self.creation_date = create_date self.installers = list_default(installers) diff --git a/testapi/opnfv_testapi/router/url_mappings.py b/testapi/opnfv_testapi/router/url_mappings.py index a857725..b9dd231 100644 --- a/testapi/opnfv_testapi/router/url_mappings.py +++ b/testapi/opnfv_testapi/router/url_mappings.py @@ -52,6 +52,7 @@ mappings = [ (r'/api/v1/results/upload', result_handlers.ResultsUploadHandler), (r"/api/v1/results/([^/]+)", result_handlers.ResultsGURHandler), (r"/api/v1/deployresults", deploy_handlers.DeployResultsHandler), + (r"/api/v1/deployresults/([^/]+)", deploy_handlers.DeployResultHandler), # scenarios (r"/api/v1/scenarios", scenario_handlers.ScenariosCLHandler), diff --git a/testapi/opnfv_testapi/tests/UI/e2e/deployResultsControllerSpec.js b/testapi/opnfv_testapi/tests/UI/e2e/deployResultsControllerSpec.js new file mode 100644 index 0000000..e00243b --- /dev/null +++ b/testapi/opnfv_testapi/tests/UI/e2e/deployResultsControllerSpec.js @@ -0,0 +1,397 @@ +'use strict'; + +var mock = require('protractor-http-mock'); +var baseURL = "http://localhost:8000/" + +describe('testing the result page for anonymous user', function () { + beforeEach(function(){ + mock([ + { + request: { + path: '/api/v1/pods', + method: 'GET' + }, + response: { + data: { + pods: [{role: "community-ci", name: "test", owner: "testUser", + details: "DemoDetails", mode: "metal", _id: "59f02f099a07c84bfc5c7aed", + creation_date: "2017-10-25 11:58:25.926168"}] + } + } + }, + { + request: { + path: '/api/v1/deployresults', + method: 'GET', + queryString: { + page: '1' + } + }, + response: { + data: { + "pagination": { + "current_page": 1, + "total_pages": 1 + }, + "deployresults": [ + { + "build_id": 411, + "upstream_build_id": 184, + "scenario": "os-nosdn-nofeature-ha", + "stop_date": "2018-01-2723:21:31.3N", + "start_date": "2018-01-2723:21:28.3N", + "upstream_job_name": "daisy-os-nosdn-nofeature-ha-baremetal-daily-master", + "version": "master", + "pod_name": "zte-pod", + "criteria": "PASS", + "installer": "daisy", + "_id": "5a6dc1089a07c80f3c9f8d62", + "job_name": "daisy-deploy-baremetal-daily-master", + "details": null + } + ] + } + } + }, + { + request: { + path: '/api/v1/deployresults', + method: 'GET', + queryString: { + page: '1', + installer: 'daisy' + } + }, + response: { + data: { + "pagination": { + "current_page": 1, + "total_pages": 1 + }, + "deployresults": [ + { + "build_id": 411, + "upstream_build_id": 184, + "scenario": "os-nosdn-nofeature-ha", + "stop_date": "2018-01-2723:21:31.3N", + "start_date": "2018-01-2723:21:28.3N", + "upstream_job_name": "daisy-os-nosdn-nofeature-ha-baremetal-daily-master", + "version": "master", + "pod_name": "zte-pod", + "criteria": "PASS", + "installer": "daisy", + "_id": "5a6dc1089a07c80f3c9f8d63", + "job_name": "daisy-deploy-baremetal-daily-master", + "details": null + } + ] + } + } + }, + { + request: { + path: '/api/v1/deployresults', + method: 'GET', + queryString: { + page: '1', + installer: 'daisy', + job_name: 'daisy-deploy-baremetal-daily-master' + } + }, + response: { + data: { + "pagination": { + "current_page": 1, + "total_pages": 1 + }, + "deployresults": [ + { + "build_id": 411, + "upstream_build_id": 184, + "scenario": "os-nosdn-nofeature-ha", + "stop_date": "2018-01-2723:21:31.3N", + "start_date": "2018-01-2723:21:28.3N", + "upstream_job_name": "daisy-os-nosdn-nofeature-ha-baremetal-daily-master", + "version": "master", + "pod_name": "zte-pod", + "criteria": "PASS", + "installer": "daisy", + "_id": "5a6dc1089a07c80f3c9f8d64", + "job_name": "daisy-deploy-baremetal-daily-master", + "details": null + } + ] + } + } + } + ]); + }); + + afterEach(function(){ + mock.teardown(); + }); + + it( 'should show the deploy results page for anonymous user', function() { + browser.get(baseURL+"#/deployresults"); + expect(element(by.cssContainingText(".ng-binding.ng-scope","Deploy Results")).isDisplayed()).toBe(true); + }); + + it( 'navigate anonymous user to results page', function() { + browser.get(baseURL); + var resultLink = element(by.linkText('Deploy Results')).click(); + var EC = browser.ExpectedConditions; + browser.wait(EC.urlContains(baseURL+ '#/deployresults'), 10000); + }); + + it('Should show the results in results page for anonymous user ', function () { + browser.get(baseURL+"#/deployresults"); + var row = element.all(by.repeater('(index, result) in ctrl.data.deployresults')).first(); + var cells = row.all(by.tagName('td')); + expect(cells.get(0).getText()).toContain("3c9f8d62"); + }); + + it('Should show the results in results page related to the filters for anonymous user ', function () { + browser.get(baseURL+"#/deployresults"); + var filter = element(by.model('ctrl.filter')); + var filterText = element(by.model('ctrl.filterText')); + filter.sendKeys('installer'); + filterText.sendKeys('daisy'); + var buttonFilter = element(by.buttonText('Filter')); + buttonFilter.click(); + var row = element.all(by.repeater('(index, result) in ctrl.data.deployresults')).first(); + var cells = row.all(by.tagName('td')); + expect(cells.get(0).getText()).toContain("3c9f8d63"); + filter.sendKeys('job_name'); + filterText.sendKeys('daisy-deploy-baremetal-daily-master') + buttonFilter.click(); + expect(cells.get(0).getText()).toContain("3c9f8d64"); + }); + it('Should not show the results in results page related to the filters for anonymous user ', function () { + browser.get(baseURL+"#/deployresults"); + var filter = element(by.model('ctrl.filter')); + var filterText = element(by.model('ctrl.filterText')); + filter.sendKeys('installer'); + filterText.sendKeys('daisyl'); + var buttonFilter = element(by.buttonText('Filter')); + buttonFilter.click(); + expect(element(by.css('.alert.alert-danger.ng-binding.ng-scope')) + .isDisplayed()).toBe(true); + }); + +}); + +describe('testing the result 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"], + "email": "testuser@test.com" + } + } + }, + { + request: { + path: '/api/v1/deployresults', + method: 'GET', + queryString: { + page: '1' + } + }, + response: { + data: { + "pagination": { + "current_page": 1, + "total_pages": 1 + }, + "deployresults": [ + { + "build_id": 411, + "upstream_build_id": 184, + "scenario": "os-nosdn-nofeature-ha", + "stop_date": "2018-01-2723:21:31.3N", + "start_date": "2018-01-2723:21:28.3N", + "upstream_job_name": "daisy-os-nosdn-nofeature-ha-baremetal-daily-master", + "version": "master", + "pod_name": "zte-pod", + "criteria": "PASS", + "installer": "daisy", + "_id": "5a6dc1089a07c80f3c9f8d62", + "job_name": "daisy-deploy-baremetal-daily-master", + "details": null + } + ] + } + } + }, + { + request: { + path: '/api/v1/deployresults', + method: 'GET', + queryString: { + page: '1', + installer: 'daisy' + } + }, + response: { + data: { + "pagination": { + "current_page": 1, + "total_pages": 1 + }, + "deployresults": [ + { + "build_id": 411, + "upstream_build_id": 184, + "scenario": "os-nosdn-nofeature-ha", + "stop_date": "2018-01-2723:21:31.3N", + "start_date": "2018-01-2723:21:28.3N", + "upstream_job_name": "daisy-os-nosdn-nofeature-ha-baremetal-daily-master", + "version": "master", + "pod_name": "zte-pod", + "criteria": "PASS", + "installer": "daisy", + "_id": "5a6dc1089a07c80f3c9f8d63", + "job_name": "daisy-deploy-baremetal-daily-master", + "details": null + } + ] + } + } + }, + { + request: { + path: '/api/v1/deployresults', + method: 'GET', + queryString: { + page: '1', + installer: 'daisy', + job_name : 'daisy-deploy-baremetal-daily-master' + } + }, + response: { + data: { + "pagination": { + "current_page": 1, + "total_pages": 1 + }, + "deployresults": [ + { + "build_id": 411, + "upstream_build_id": 184, + "scenario": "os-nosdn-nofeature-ha", + "stop_date": "2018-01-2723:21:31.3N", + "start_date": "2018-01-2723:21:28.3N", + "upstream_job_name": "daisy-os-nosdn-nofeature-ha-baremetal-daily-master", + "version": "master", + "pod_name": "zte-pod", + "criteria": "PASS", + "installer": "daisy", + "_id": "5a6dc1089a07c80f3c9f8d64", + "job_name": "daisy-deploy-baremetal-daily-master", + "details": null + } + ] + } + } + } + ]); + }); + + afterEach(function(){ + mock.teardown(); + }); + + it( 'should show the deploy results page for user', function() { + browser.get(baseURL+"#/deployresults"); + expect(element(by.cssContainingText(".ng-binding.ng-scope","Deploy Results")).isDisplayed()).toBe(true); + }); + + it( 'navigate user to results page', function() { + browser.get(baseURL); + var resultLink = element(by.linkText('Deploy Results')).click(); + var EC = browser.ExpectedConditions; + browser.wait(EC.urlContains(baseURL+ '#/deployresults'), 10000); + }); + + it('Should show the results in results page for user ', function () { + browser.get(baseURL+"#/deployresults"); + var row = element.all(by.repeater('(index, result) in ctrl.data.deployresults')).first(); + var cells = row.all(by.tagName('td')); + expect(cells.get(0).getText()).toContain("3c9f8d62"); + }); + + it('Should show the results in results page related to the filters for user ', function () { + browser.get(baseURL+"#/deployresults"); + var filter = element(by.model('ctrl.filter')); + var filterText = element(by.model('ctrl.filterText')); + filter.sendKeys('installer'); + filterText.sendKeys('daisy'); + var buttonFilter = element(by.buttonText('Filter')); + buttonFilter.click(); + var row = element.all(by.repeater('(index, result) in ctrl.data.deployresults')).first(); + var cells = row.all(by.tagName('td')); + expect(cells.get(0).getText()).toContain("3c9f8d63"); + filter.sendKeys('job_name'); + filterText.sendKeys('daisy-deploy-baremetal-daily-master') + buttonFilter.click(); + expect(cells.get(0).getText()).toContain("3c9f8d64"); + }); + it('Should not show the results in results page related to the filters for user ', function () { + browser.get(baseURL+"#/deployresults"); + var filter = element(by.model('ctrl.filter')); + var filterText = element(by.model('ctrl.filterText')); + filter.sendKeys('installer'); + filterText.sendKeys('daisy1'); + var buttonFilter = element(by.buttonText('Filter')); + buttonFilter.click(); + expect(element(by.css('.alert.alert-danger.ng-binding.ng-scope')) + .isDisplayed()).toBe(true); + }); + + it('Clear the filter', function () { + browser.get(baseURL+"#/deployresults"); + var filter = element(by.model('ctrl.filter')); + var filterText = element(by.model('ctrl.filterText')); + filter.sendKeys('installer'); + filterText.sendKeys('daisy'); + var buttonFilter = element(by.buttonText('Filter')); + buttonFilter.click(); + var row = element.all(by.repeater('(index, result) in ctrl.data.deployresults')).first(); + var cells = row.all(by.tagName('td')); + expect(cells.get(0).getText()).toContain("3c9f8d63"); + var buttonClear = element(by.buttonText('Clear')); + buttonClear.click(); + var row = element.all(by.repeater('(index, result) in ctrl.data.deployresults')).first(); + var cells = row.all(by.tagName('td')); + expect(cells.get(0).getText()).toContain("3c9f8d62"); + }); + + it('view the deploy results ', function () { + browser.get(baseURL+"#/deployresults"); + var viewOperation = element(by.linkText('3c9f8d62')) + viewOperation.click(); + var EC = browser.ExpectedConditions; + browser.wait(EC.urlContains('#/deployresults/5a6dc1089a07c80f3c9f8d62'), 10000); + }); + +});
\ No newline at end of file diff --git a/testapi/opnfv_testapi/tests/UI/e2e/homeControllerSpec.js b/testapi/opnfv_testapi/tests/UI/e2e/homeControllerSpec.js index 57794a6..013527d 100644 --- a/testapi/opnfv_testapi/tests/UI/e2e/homeControllerSpec.js +++ b/testapi/opnfv_testapi/tests/UI/e2e/homeControllerSpec.js @@ -20,7 +20,7 @@ describe('testing the home page for user', function () { }, response: { data: { - pods: [{role: "community-ci", name: "test", owner: "testUser", + pods: [{role: "community-ci", name: "test", creator: "testUser", details: "DemoDetails", mode: "metal", _id: "59f02f099a07c84bfc5c7aed", creation_date: "2017-10-25 11:58:25.926168"}] } @@ -53,4 +53,4 @@ describe('testing the home page for user', function () { var EC = browser.ExpectedConditions; browser.wait(EC.urlContains(baseURL+ '/#/profile'), 10000); }); -}); +});
\ No newline at end of file diff --git a/testapi/opnfv_testapi/tests/UI/e2e/podsControllerSpec.js b/testapi/opnfv_testapi/tests/UI/e2e/podsControllerSpec.js index 97e61ad..3505a84 100644 --- a/testapi/opnfv_testapi/tests/UI/e2e/podsControllerSpec.js +++ b/testapi/opnfv_testapi/tests/UI/e2e/podsControllerSpec.js @@ -4,243 +4,243 @@ var mock = require('protractor-http-mock'); var baseURL = "http://localhost:8000" describe('testing the Pods page for anonymous user', function () { - beforeEach(function(){ - mock([{ - request: { - path: '/api/v1/pods', - method: 'GET' - }, - response: { - data: { - pods: [{role: "community-ci", name: "test", owner: "testUser", - details: "DemoDetails", mode: "metal", _id: "59f02f099a07c84bfc5c7aed", - creation_date: "2017-10-25 11:58:25.926168"}] - } - } - }, - { - 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"}] - } - } - } - ]); - }); + beforeEach(function(){ + mock([{ + request: { + path: '/api/v1/pods', + method: 'GET' + }, + response: { + data: { + pods: [{role: "community-ci", name: "test", creator: "testUser", + details: "DemoDetails", mode: "metal", _id: "59f02f099a07c84bfc5c7aed", + 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", creator: "testUser", + details: "DemoDetails", mode: "metal", _id: "59f02f099a07c84bfc5c7aed", + creation_date: "2017-10-25 11:58:25.926168"}] + } + } + } + ]); + }); - afterEach(function(){ - mock.teardown(); - }); + 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( '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 anonymous user', function () { - browser.get(baseURL+'#/pods'); - var buttonCreate = element(by.buttonText('Create')); - expect(buttonCreate.isDisplayed()).toBeFalsy(); - }); + it('create button is not visible for anonymous user', function () { + browser.get(baseURL+'#/pods'); + var buttonCreate = element(by.buttonText('Create')); + expect(buttonCreate.isDisplayed()).toBeFalsy(); + }); - it('filter button is visible for anonymous user', function () { - var buttonFilter = element(by.buttonText('Filter')); - expect(buttonFilter.isDisplayed()).toBe(true) - }); + it('filter button is visible for anonymous user', function () { + var buttonFilter = element(by.buttonText('Filter')); + expect(buttonFilter.isDisplayed()).toBe(true) + }); - it('Delete button is visible for anonymous user', function () { - var buttonDelete = element(by.buttonText('Delete')); - expect(buttonDelete.isDisplayed()).toBeFalsy(); - }); + it('Delete button is visible for anonymous user', function () { + var buttonDelete = element(by.buttonText('Delete')); + expect(buttonDelete.isDisplayed()).toBeFalsy(); + }); - it('Show results', function () { - var row = element.all(by.repeater('(index, pod) in ctrl.data.pods')).first(); + 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')); - var row = element.all(by.repeater('(index, pod) in ctrl.data.pods')).first(); + 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 not visible for user ', function () { - browser.get(baseURL+'#/pods'); - var deleteOperation = element(by.css('a[title=Delete]')); - expect(deleteOperation.isDisplayed()).toBeFalsy(); - }); + it('delete Operation is not visible for user ', function () { + browser.get(baseURL+'#/pods'); + var deleteOperation = element(by.css('a[title=Delete]')); + expect(deleteOperation.isDisplayed()).toBeFalsy(); + }); }); 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"} - } - } - ]); - }); + beforeEach(function(){ + mock([{ + request: { + path: '/api/v1/pods', + method: 'GET' + }, + response: { + data: { + pods: [{role: "community-ci", name: "test", creator: "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", creator: "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", creator: "testUser", + details: "DemoDetails", mode: "metal", _id: "59f02f099a07c84bfc5c7aed", + creation_date: "2017-10-25 11:58:25.926168"} + } + } + ]); + }); - afterEach(function(){ - mock.teardown(); - }); + 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( '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('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')); - expect(buttonFilter.isDisplayed()).toBe(true) - }); + it('filter button is visible for user', function () { + var buttonFilter = element(by.buttonText('Filter')); + expect(buttonFilter.isDisplayed()).toBe(true) + }); - it('Delete button is visible for user', function () { - var buttonDelete = element(by.buttonText('Delete')); - expect(buttonDelete.isDisplayed()).toBe(true) - }); + it('Delete button is visible for user', function () { + var buttonDelete = element(by.buttonText('Delete')); + expect(buttonDelete.isDisplayed()).toBe(true) + }); - it('Show results', function () { - var row = element.all(by.repeater('(index, pod) in ctrl.data.pods')).first(); + 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')); - var row = element.all(by.repeater('(index, pod) in ctrl.data.pods')).first(); + 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('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 () { + 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(); + buttonOK.click(); expect(element(by.cssContainingText(".alert","Delete Success")) .isDisplayed()).toBe(true); - }); + }); - it('Delete the pods ', function () { + it('Delete the pods ', function () { browser.get(baseURL+"#/pods"); var deleteOperation = element(by.css('a[title=Delete]')); deleteOperation.click(); @@ -248,9 +248,9 @@ describe('testing the Pods page for authorized user', function () { buttonOK.click(); expect(element(by.cssContainingText(".alert","Delete Success")) .isDisplayed()).toBe(true); - }); + }); - it('Create the pod', function () { + it('Create the pod', function () { browser.get(baseURL+"#/pods"); var buttonCreate = element(by.buttonText('Create')); buttonCreate.click(); @@ -259,7 +259,7 @@ describe('testing the Pods page for authorized user', function () { browser.wait(EC.visibilityOf(name), 5000); name.sendKeys('test1'); var buttonOK = element(by.buttonText('Ok')); - buttonOK.click(); + buttonOK.click(); expect(element(by.cssContainingText(".alert","Create Success")) .isDisplayed()).toBe(true); }); @@ -271,8 +271,8 @@ describe('testing the Pods page for authorized user', function () { 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() + var buttonOK = element(by.buttonText('Ok')); + buttonOK.click() expect(element(by.cssContainingText(".alert","Name is missing.")) .isDisplayed()).toBe(true); }); @@ -284,92 +284,92 @@ describe('testing the Pods page for authorized user', function () { 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: 'GET' - }, - response: { - data: { - 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/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/test1', - method: 'DELETE' - }, - response: { - status : 403, - data : 'pods do not exist' - } - } - ]); + it('Delete the pods which do not exist ', function () { + mock.teardown(); + mock([{ + request: { + path: '/api/v1/pods', + method: 'GET' + }, + response: { + data: { + pods: [{role: "community-ci", name: "test1", creator: "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/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(); + buttonOK.click(); expect(element(by.css(".alert.alert-danger")) .isDisplayed()).toBe(true); - }); + }); - it('view the test case ', function () { - browser.get(baseURL+"#/pods"); - var viewOperation = element(by.css('a[class=text-info]')); + it('view the test case ', function () { + browser.get(baseURL+"#/pods"); + var viewOperation = element(by.linkText('test')); viewOperation.click(); var EC = browser.ExpectedConditions; browser.wait(EC.urlContains('#/pods/test'), 10000); - }); + }); - it('Show error if server is not responding', function () { - mock.teardown(); - mock([{ - request: { - path: '/api/v1/pods', - method: 'GET' - }, - response: { - status : 404 - } - }, - { - 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" - } - } - }, - ]); + it('Show error if server is not responding', function () { + mock.teardown(); + mock([{ + request: { + path: '/api/v1/pods', + method: 'GET' + }, + response: { + status : 404 + } + }, + { + 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" + } + } + }, + ]); 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/projectsControllerSpec.js b/testapi/opnfv_testapi/tests/UI/e2e/projectsControllerSpec.js index 8b908c9..015dcbb 100644 --- a/testapi/opnfv_testapi/tests/UI/e2e/projectsControllerSpec.js +++ b/testapi/opnfv_testapi/tests/UI/e2e/projectsControllerSpec.js @@ -15,7 +15,7 @@ describe('testing the Projects Link for anonymous user', function () { data: { "projects": [ { - "owner": "thuva4", + "creator": "thuva4", "_id": "5a0c022f9a07c846d3c2cc94", "creation_date": "2017-11-15 14:30:31.200259", "description": "dsfsd", @@ -28,13 +28,13 @@ describe('testing the Projects Link for anonymous user', function () { ]); }); - afterEach(function(){ - mock.teardown(); - }); + afterEach(function(){ + mock.teardown(); + }); - it( 'should show the Projects Link for anonymous user', function() { + it( 'should show the Projects Link for anonymous user', function() { mock.teardown(); - browser.get(baseURL); + browser.get(baseURL); var projectslink = element(by.linkText('Projects')); expect(projectslink.isPresent()).toBe(true); }); @@ -70,10 +70,10 @@ describe('testing the Projects Link for anonymous user', function () { // }); 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(); - }); + browser.get(baseURL+'#/projects'); + var deleteOperation = element(by.css('a[title=Delete]')); + expect(deleteOperation.isDisplayed()).toBeFalsy(); + }); }); @@ -122,7 +122,7 @@ describe('testing the Project Link for user who is not in submitter group', func data: { "projects": [ { - "owner": "thuva4", + "creator": "thuva4", "_id": "5a0c022f9a07c846d3c2cc94", "creation_date": "2017-11-15 14:30:31.200259", "description": "dsfsd", @@ -136,8 +136,8 @@ describe('testing the Project Link for user who is not in submitter group', func }); afterEach(function(){ - mock.teardown(); - }); + mock.teardown(); + }); it( 'should show the Project Link for user', function() { browser.get(baseURL); @@ -280,8 +280,8 @@ describe('testing the Project Link for user who is in submitter group', function }); afterEach(function(){ - mock.teardown(); - }); + mock.teardown(); + }); it( 'should show the Project Link for user', function() { browser.get(baseURL); @@ -363,7 +363,7 @@ describe('testing the Project Link for user who is in submitter group', function }); it('Show error when user click the create button with an already existing name', function () { - browser.get(baseURL+"#/projects"); + browser.get(baseURL+"#/projects"); var buttonCreate = element(by.buttonText('Create')); buttonCreate.click(); var name = element(by.model('ProjectModalCtrl.project.name')); @@ -371,7 +371,7 @@ describe('testing the Project Link for user who is in submitter group', function browser.wait(EC.visibilityOf(name), 5000); var description = element(by.model('ProjectModalCtrl.project.description')); name.sendKeys('testProject3'); - description.sendKeys('demoDescription'); + description.sendKeys('demoDescription'); var buttonOK = element(by.buttonText('Ok')); buttonOK.click(); expect(element(by.css(".alert.alert-danger")).isDisplayed()).toBe(true); @@ -545,9 +545,9 @@ describe('testing the Project Link for user who is in submitter group', function .isDisplayed()).toBe(true); }); - it('If backend is not responding then show error when user click the create button',function(){ - mock.teardown(); - mock([ + it('If backend is not responding then show error when user click the create button',function(){ + mock.teardown(); + mock([ { request: { path: '/api/v1/profile', @@ -563,8 +563,8 @@ describe('testing the Project Link for user who is in submitter group', function } } } - ]); - browser.get(baseURL+"#/projects"); + ]); + browser.get(baseURL+"#/projects"); var buttonCreate = element(by.buttonText('Create')); buttonCreate.click(); var name = element(by.model('ProjectModalCtrl.project.name')); @@ -572,10 +572,10 @@ describe('testing the Project Link for user who is in submitter group', function browser.wait(EC.visibilityOf(name), 5000); var details = element(by.model('ProjectModalCtrl.project.description')); name.sendKeys('testproject'); - details.sendKeys('demoDescription'); - var buttonOK = element(by.buttonText('Ok')); - buttonOK.click().then(function(){ - expect(element(by.css(".alert.alert-danger")).isDisplayed()).toBe(true); + details.sendKeys('demoDescription'); + 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/scenarioControllerSpec.js b/testapi/opnfv_testapi/tests/UI/e2e/scenarioControllerSpec.js index f97a621..60d4949 100644 --- a/testapi/opnfv_testapi/tests/UI/e2e/scenarioControllerSpec.js +++ b/testapi/opnfv_testapi/tests/UI/e2e/scenarioControllerSpec.js @@ -224,7 +224,7 @@ describe('testing the scenarios page 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')) + var buttonAdd = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[2]/button')) expect(buttonAdd.isDisplayed()).toBe(false); }); @@ -232,7 +232,7 @@ describe('testing the scenarios page for 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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[1]/a')) installerShow.click(); var row = element.all(by.repeater('(indexI, installer) in ctrl.data.scenarios[0].installers')).first(); var cells = row.all(by.tagName('td')); @@ -243,9 +243,9 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[1]/a')) 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')) + var installerDelete = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[3]/div/table/tbody/tr[1]/td[3]/button')) expect(installerDelete.isDisplayed()).toBe(false); }); @@ -253,11 +253,11 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[1]/a/p')) expect(versionsShow.isDisplayed()).toBe(true) }); @@ -265,13 +265,13 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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); }); @@ -279,15 +279,15 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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); }); @@ -295,17 +295,17 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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) }); @@ -313,23 +313,23 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var customsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var trustIndicatorsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var scoresShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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) }); @@ -666,7 +666,7 @@ describe('testing the scenarios page 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')) + var buttonAdd = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[2]/button')) expect(buttonAdd.isDisplayed()).toBe(true); }); @@ -674,7 +674,7 @@ describe('testing the scenarios page 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')) + var buttonAdd = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[2]/button')) buttonAdd.click(); var name = element(by.model('installerModalCtrl.installer.installer')); var EC = browser.ExpectedConditions; @@ -691,7 +691,7 @@ describe('testing the scenarios page for 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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')); @@ -702,9 +702,9 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerDelete = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[3]/div/table/tbody/tr[1]/td[3]/button')) expect(installerDelete.isDisplayed()).toBe(true); }); @@ -712,9 +712,9 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerDelete = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[3]/div/table/tbody/tr[1]/td[3]/button')) installerDelete.click() var buttonOK = element(by.buttonText('Ok')); buttonOK.click(); @@ -726,11 +726,11 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[1]/a/p')) expect(versionsShow.isDisplayed()).toBe(true) }); @@ -738,11 +738,11 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionAdd = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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); @@ -759,16 +759,16 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerAdd = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[2]/button')) + var installerDelete = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[3]/div/table/tbody/tr[1]/td[3]/button')) expect(installerAdd.isDisplayed()).toBe(false); expect(installerDelete.isDisplayed()).toBe(false) }); @@ -777,15 +777,15 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionDelete = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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(); @@ -797,15 +797,15 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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); }); @@ -813,15 +813,15 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectAdd = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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); @@ -836,20 +836,20 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionAdd = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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[5]/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) }); @@ -858,17 +858,17 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectDelete = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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(); @@ -880,23 +880,23 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var customsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var trustIndicatorsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var scoresShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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) }); @@ -904,19 +904,19 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var trustIndicatorsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')); @@ -927,19 +927,19 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var scoresShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')); @@ -950,29 +950,29 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var customsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectAdd = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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[5]/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')) + var buttonAdd = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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[5]/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) }); @@ -981,24 +981,24 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var customsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var buttonAdd = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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); @@ -1013,24 +1013,24 @@ describe('testing the scenarios page 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')) + var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var projectShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var customsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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')) + var buttonAdd = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/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() diff --git a/testapi/opnfv_testapi/tests/UI/e2e/testCasesControllerSpec.js b/testapi/opnfv_testapi/tests/UI/e2e/testCasesControllerSpec.js index d509c57..4f21fd1 100644 --- a/testapi/opnfv_testapi/tests/UI/e2e/testCasesControllerSpec.js +++ b/testapi/opnfv_testapi/tests/UI/e2e/testCasesControllerSpec.js @@ -15,7 +15,7 @@ describe('testing the testCases page for anonymous user', function () { data: { "projects": [ { - "owner": "thuva4", + "creator": "thuva4", "_id": "5a0c022f9a07c846d3c2cc94", "creation_date": "2017-11-15 14:30:31.200259", "description": "dsfsd", @@ -32,7 +32,7 @@ describe('testing the testCases page for anonymous user', function () { }, response: { data: { - "owner": "thuva4", + "creator": "thuva4", "_id": "5a0c022f9a07c846d3c2cc94", "creation_date": "2017-11-15 14:30:31.200259", "description": "dsfsd", @@ -182,7 +182,7 @@ describe('testing the testcaese page for user who is not in submitter group', fu data: { "projects": [ { - "owner": "thuva4", + "creator": "thuva4", "_id": "5a0c022f9a07c846d3c2cc94", "creation_date": "2017-11-15 14:30:31.200259", "description": "dsfsd", @@ -199,7 +199,7 @@ describe('testing the testcaese page for user who is not in submitter group', fu }, response: { data: { - "owner": "thuva4", + "creator": "thuva4", "_id": "5a0c022f9a07c846d3c2cc94", "creation_date": "2017-11-15 14:30:31.200259", "description": "dsfsd", @@ -397,7 +397,7 @@ describe('testing the test cases page for user who is in submitter group', funct data: { "projects": [ { - "owner": "thuva4", + "creator": "thuva4", "_id": "5a0c022f9a07c846d3c2cc94", "creation_date": "2017-11-15 14:30:31.200259", "description": "dsfsd", @@ -414,7 +414,7 @@ describe('testing the test cases page for user who is in submitter group', funct }, response: { data: { - "owner": "thuva4", + "creator": "thuva4", "_id": "5a0c022f9a07c846d3c2cc94", "creation_date": "2017-11-15 14:30:31.200259", "description": "dsfsd", diff --git a/testapi/opnfv_testapi/tests/unit/handlers/test_base.py b/testapi/opnfv_testapi/tests/unit/handlers/test_base.py index 6436b8b..9a7bc5c 100644 --- a/testapi/opnfv_testapi/tests/unit/handlers/test_base.py +++ b/testapi/opnfv_testapi/tests/unit/handlers/test_base.py @@ -35,20 +35,21 @@ class TestBase(testing.AsyncHTTPTestCase): details='zte pod 1', role='community-ci', _id=str(ObjectId()), - owner='ValidUser', + creator='ValidUser', creation_date=str(datetime.now())) self.pod_e = pod_models.Pod(name='zte-pod2', mode='metal', details='zte pod 2', role='production-ci', _id=str(ObjectId()), - owner='ValidUser', + creator='ValidUser', creation_date=str(datetime.now())) self.project_e = project_models.Project( name='functest', description='functest test', + creator='ValidUser', _id=str(ObjectId()), - create_date=str(datetime.now())) + creation_date=str(datetime.now())) self.req_d = None self.req_e = None diff --git a/testapi/opnfv_testapi/tests/unit/handlers/test_pod.py b/testapi/opnfv_testapi/tests/unit/handlers/test_pod.py index 2818513..d1eedc0 100644 --- a/testapi/opnfv_testapi/tests/unit/handlers/test_pod.py +++ b/testapi/opnfv_testapi/tests/unit/handlers/test_pod.py @@ -27,7 +27,7 @@ class TestPodBase(base.TestBase): def assert_get_body(self, pod, req=None): if not req: req = self.req_d - self.assertEqual(pod, pm.Pod(owner='ValidUser', **req.format())) + self.assertEqual(pod, pm.Pod(creator='ValidUser', **req.format())) self.assertIsNotNone(pod.creation_date) self.assertIsNotNone(pod._id) diff --git a/testapi/opnfv_testapi/ui/Gruntfile.js b/testapi/opnfv_testapi/ui/Gruntfile.js index 1be08b5..41a2ec5 100644 --- a/testapi/opnfv_testapi/ui/Gruntfile.js +++ b/testapi/opnfv_testapi/ui/Gruntfile.js @@ -122,13 +122,14 @@ module.exports = function (grunt) { '../tests/UI/e2e/testCasesControllerSpec.js', '../tests/UI/e2e/resultsControllerSpec.js', '../tests/UI/e2e/scenariosControllerSpec.js', - '../tests/UI/e2e/scenarioControllerSpec.js' + '../tests/UI/e2e/scenarioControllerSpec.js', + '../tests/UI/e2e/deployResultsControllerSpec.js' ] } }, local: { options: { - configFile: '../tests/UI/protractor-conf.js' + configFile: 'protractor-conf.js' } } }, diff --git a/testapi/opnfv_testapi/ui/app.js b/testapi/opnfv_testapi/ui/app.js index c2fa774..ae50166 100644 --- a/testapi/opnfv_testapi/ui/app.js +++ b/testapi/opnfv_testapi/ui/app.js @@ -104,6 +104,16 @@ templateUrl: 'testapi-ui/components/results/result/result.html', controller: 'ResultController as ctrl' }). + state('deployresults', { + url: '/deployresults', + templateUrl: 'testapi-ui/components/deploy-results/deployResults.html', + controller: 'DeployResultsController as ctrl' + }). + state('deployresult', { + url: '/deployresults/:_id', + templateUrl: 'testapi-ui/components/deploy-results/deploy-result/deployResult.html', + controller: 'DeployResultController as ctrl' + }). state('profile', { url: '/profile', templateUrl: 'testapi-ui/components/profile/profile.html', diff --git a/testapi/opnfv_testapi/ui/components/deploy-results/deploy-result/deployResult.html b/testapi/opnfv_testapi/ui/components/deploy-results/deploy-result/deployResult.html new file mode 100644 index 0000000..ba9bee7 --- /dev/null +++ b/testapi/opnfv_testapi/ui/components/deploy-results/deploy-result/deployResult.html @@ -0,0 +1,93 @@ +<legend>Result</legend> +<div style="padding-right:0px"> + <div class="table-responsive"> + <table class="table" ng-data="ctrl.data.pods"> + <tbody> + <tr style="padding:9px"> + <td class="podsTableTd">Id :</td> + <td class="podsTableLeftTd">{{ctrl.data._id}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Installer :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.installer}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Scenario :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.scenario}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Pod Name :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.pod_name}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Criteria :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.criteria}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Start Date :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.start_date}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Stop Date :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.stop_date}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Job Name :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.job_name}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Build ID :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data['build_id']}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Upstream Job Name :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.upstream_job_name}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Upstream Build ID :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.upstream_build_id}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Details :</td> + <td width="90%" class="podsTableLeftTd"> + <a ng-click="ctrl.showDetails()"> + <p ng-if="ctrl.details">Hide</p> + <p ng-if="!ctrl.details">Show</p> + </a> + <table class="table" ng-class="{'hidden' : !ctrl.details}" style="margin:10px"> + <tbody> + <tr style="padding:9px"></tr> + <tr style="padding:9px"> + <td class="podsTableTd">Failures :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.details.failures}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Details :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.details.errors}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Stream :</td> + <td width="90%" class="podsTableLeftTd"><p>{{ctrl.data.details.stream}}</p></td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">TestsRun :</td> + <td width="90%" class="podsTableLeftTd"><p>{{ctrl.data.details.testsRun}}</p></td> + </tr> + </tbody> + </table> + </td> + </tr> + </tbody> + </table> + </div> +</div> +<div class="col-md-12"> + <div ng-show="ctrl.showError" class="col-md-12 alert alert-danger" role="alert"> + <span class="pull-right"> {{ctrl.error}}</span> + <span class="glyphicon glyphicon-exclamation-sign pull-right" aria-hidden="true" >Error:</span> + </div> + <div ng-show="ctrl.showSuccess" class="col-md-12 alert alert-success" role="alert"> + <span class="pull-right"> {{ctrl.success}}</span> + <span class="glyphicon glyphicon-ok pull-right" aria-hidden="true"></span> + </div> + </div>
\ No newline at end of file diff --git a/testapi/opnfv_testapi/ui/components/deploy-results/deploy-result/deployResultController.js b/testapi/opnfv_testapi/ui/components/deploy-results/deploy-result/deployResultController.js new file mode 100644 index 0000000..40cf1cb --- /dev/null +++ b/testapi/opnfv_testapi/ui/components/deploy-results/deploy-result/deployResultController.js @@ -0,0 +1,65 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +(function () { + 'use strict'; + + angular + .module('testapiApp') + .controller('DeployResultController', DeployResultController); + + DeployResultController.$inject = [ + '$scope', '$http', '$filter', '$state', '$window', '$uibModal', 'testapiApiUrl','raiseAlert', + 'confirmModal' + ]; + + /** + * TestAPI DeployResultController + * This controller is for the '/result/:_id' page where a user can browse + * through result declared in TestAPI. + */ + function DeployResultController($scope, $http, $filter, $state, $window, $uibModal, testapiApiUrl, + raiseAlert, confirmModal) { + var ctrl = this; + ctrl.url = testapiApiUrl + '/deployresults'; + ctrl._id = $state.params['_id']; + ctrl.loadDetails = loadDetails + ctrl.showDetails = showDetails + + /** + *Contact the testapi and retrevie the result details + */ + function loadDetails(){ + var resultUrl = ctrl.url + '/' + ctrl._id; + ctrl.showError = false; + ctrl.podsRequest = + $http.get(resultUrl).success(function (data) { + ctrl.data = data; + }).catch(function (error) { + ctrl.data = null; + ctrl.showError = true; + ctrl.error = error.statusText; + }); + } + + function showDetails(){ + if(ctrl.details){ + ctrl.details = false + }else{ + ctrl.details = true + } + } + ctrl.loadDetails(); + } +})();
\ No newline at end of file diff --git a/testapi/opnfv_testapi/ui/components/deploy-results/deployResults.html b/testapi/opnfv_testapi/ui/components/deploy-results/deployResults.html new file mode 100644 index 0000000..6fbaaea --- /dev/null +++ b/testapi/opnfv_testapi/ui/components/deploy-results/deployResults.html @@ -0,0 +1,126 @@ +<h3>{{ctrl.pageHeader}}</h3> +<p>{{ctrl.pageParagraph}}</p> +<div class="row" style="margin-bottom:24px;"></div> +<div class="result-filters" style="border-top: none;"> + <div class="row podTable" style="vertical-align:middle"> + <div class="col-sm-1 pull-right"> + <button type="button" class="btn btn-danger" ng-click="ctrl.clearFilters()"> + <i class="fa fa-search"></i> Clear + </button> + </div> + <div class="col-sm-1 pull-right"> + <button type="button" class="btn btn-success" ng-click="ctrl.filterList()"> + <i class="fa fa-search"></i> Filter</button> + </div> + <div class="col-sm-2 pull-right" ng-class="{'hidden': ctrl.filter=='start_date' || ctrl.filter=='end_date'}"> + <span style="margin-top:6px">Search: </span> + <input list="filter" name="filter" class="form-control search" style="display:inline;width:105px;padding-left:6px;" + ng-Model="ctrl.filterText" placeholder="Search String"> + <datalist id="filter" ng-class="{ 'hidden' : ctrl.filterOption.length<0}"> + <option ng-repeat="(index, filterValue) in ctrl.filterOption " value="{{filterValue}}">{{filterValue}}</option> + </datalist> + </div> + <div class="col-sm-3 pull-right" style="width:20%" ng-class="{'hidden': ctrl.filter!='start_date'}"> + <span style="margin-top:6px">Start Date: </span> + <p class="input-group" style="width:48%;display:inline-flex;"> + <input type="text" class="form-control" + uib-datepicker-popup="{{ctrl.format}}" + ng-model="ctrl.filterText" is-open="ctrl.startOpen" + close-text="Close" /> + <span class="input-group-btn"> + <button type="button" class="btn btn-default" ng-click="ctrl.open($event, 'startOpen')"> + <i class="glyphicon glyphicon-calendar"></i> + </button> + </span> + </p> + </div> + <div class="col-sm-3 pull-right" style="width:20%" ng-class="{'hidden': ctrl.filter!='end_date'}"> + <span style="margin-top:6px">End Date: </span> + <p class="input-group" style="width:48%;display:inline-flex;"> + <input type="text" class="form-control" + uib-datepicker-popup="{{ctrl.format}}" + ng-model="ctrl.filterText" is-open="ctrl.endOpen" + close-text="Close" /> + <span class="input-group-btn"> + <button type="button" class="btn btn-default" ng-click="ctrl.open($event, 'endOpen')"> + <i class="glyphicon glyphicon-calendar"></i> + </button> + </span> + </p> + </div> + <div class="col-md-2 row pull-right" style="width: 20%;"> + <span style="margin-top:6px">Filter: </span> + <select ng-model="ctrl.filter" ng-change="ctrl.encodeFilter()" class="form-control" style="display:inline; width:150px;"> + <option value="pod" ng-disabled="ctrl.testFilter('pod')" >Pod Name</option> + <option value="job_name" ng-disabled="ctrl.testFilter('job_name')" >Job Name</option> + <option value="installer" ng-disabled="ctrl.testFilter('installer')">Installer</option> + <option value="version" ng-disabled="ctrl.testFilter('version')">Version</option> + <option value="scenario" ng-disabled="ctrl.testFilter('scenario')">Scenario</option> + <option value="build_id" ng-disabled="ctrl.testFilter('build_id')">Build ID</option> + <option value="criteria" ng-disabled="ctrl.testFilter('criteria')">Criteria</option> + <option value="start_date" ng-disabled="ctrl.testFilter('start_date')">Start Date</option> + <option value="end_date" ng-disabled="ctrl.testFilter('end_date')">End Date</option> + </select> + </div> + <div class='filter-box'> + <div class='filter-tag col-md-1' ng-repeat="(key, tag) in ctrl.tagArray" style="background-color: #f5f5f5;border: 1px solid #e3e3e3;/* border: 1px; */margin-top: 3px;padding: 4px;margin-left: 15px;width: 13%;"> + {{key}} : {{tag}} + <div class='delete-tag btn btn-danger btn-xs' ng-click='ctrl.deleteTag(key)'> + × + </div> + </div> + </div> + </div> +</div> + +<div cg-busy="{promise:ctrl.authRequest,message:'Loading'}"></div> +<div cg-busy="{promise:ctrl.resultsRequest,message:'Loading'}"></div> +<div ng-show="ctrl.data" class="results-table"> + <table ng-data="ctrl.data.deployresults" ng-show="ctrl.data" class="table table-striped table-hover"> + <thead> + <tr> + <th>ID</th> + <th>Installer</th> + <th>Scenario</th> + <th>Pod</th> + <th>Criteria</th> + <th>Start Date</th> + <th>Stop Date</th> + </tr> + </thead> + + <tbody> + <tr ng-repeat-start="(index, result) in ctrl.data.deployresults"> + <td><a ng-click="ctrl.viewDeployResult(result._id)">{{ result._id.substr(-8) }}</a></td> + <td>{{ result.installer }}</td> + <td>{{ result.scenario }}</td> + <td>{{ result.pod_name }}</td> + <td>{{ result.criteria }}</td> + <td>{{ result.start_date }}</td> + <td>{{ result.stop_date }}</td> + </tr> + <tr ng-repeat-end=> + </tr> + </tbody> + </table> + + <div class="pages"> + <uib-pagination + total-items="ctrl.totalItems" + ng-model="ctrl.currentPage" + items-per-page="ctrl.itemsPerPage" + max-size="ctrl.maxSize" + class="pagination-sm" + boundary-links="true" + rotate="false" + num-pages="ctrl.numPages" + ng-change="ctrl.filterList()"> + </uib-pagination> + </div> +</div> + +<div ng-show="ctrl.showError" class="alert alert-danger" role="alert"> + <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> + <span class="sr-only">Error:</span> + {{ctrl.error}} +</div> diff --git a/testapi/opnfv_testapi/ui/components/deploy-results/deployResultsController.js b/testapi/opnfv_testapi/ui/components/deploy-results/deployResultsController.js new file mode 100644 index 0000000..5230a75 --- /dev/null +++ b/testapi/opnfv_testapi/ui/components/deploy-results/deployResultsController.js @@ -0,0 +1,190 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +(function () { + 'use strict'; + + angular + .module('testapiApp') + .controller('DeployResultsController', DeployResultsController); + + DeployResultsController.$inject = [ + '$scope', '$http', '$filter', '$state', 'testapiApiUrl','raiseAlert' + ]; + + /** + * TestAPI Deploy Results Controller + * This controller is for the '/deployresults' page where a user can browse + * a listing of community uploaded results. + */ + function DeployResultsController($scope, $http, $filter, $state, testapiApiUrl, + raiseAlert) { + var ctrl = this; + + ctrl.open = open; + ctrl.clearFilters = clearFilters; + ctrl.deleteTag = deleteTag; + ctrl.filterList= filterList; + ctrl.testFilter = testFilter + ctrl.filter = "pod" + ctrl.filterValue = "pod_name" + ctrl.encodeFilter = encodeFilter + ctrl.viewDeployResult = viewDeployResult + ctrl.tagArray = {} + ctrl.filterOption=[] + + /** Initial page to be on. */ + ctrl.currentPage = 1; + + /** + * How many results should display on each page. Since pagination + * is server-side implemented, this value should match the + * 'results_per_page' configuration of the TestAPI server which + * defaults to 20. + */ + ctrl.itemsPerPage = 20; + + /** + * How many page buttons should be displayed at max before adding + * the '...' button. + */ + ctrl.maxSize = 5; + + /** The upload date lower limit to be used in filtering results. */ + ctrl.startDate = ''; + + /** The upload date upper limit to be used in filtering results. */ + ctrl.endDate = ''; + + /** The date format for the date picker. */ + ctrl.format = 'yyyy-MM-dd'; + + ctrl.pageHeader = "Deploy Results" + + ctrl.pageParagraph = 'Your most recently uploaded deploy results are listed here.' + ctrl.isPublic = false; + + function encodeFilter(){ + ctrl.filterText = '' + ctrl.filterOption=[] + if(ctrl.filter=="pod" || ctrl.filter=="scenario"){ + var reqURL = testapiApiUrl +"/" + ctrl.filter + "s" + ctrl.datasRequest = + $http.get(reqURL).success(function (data) { + ctrl.filterData = data; + for(var index in ctrl.filterData[ctrl.filter + "s"]){ + if( ctrl.filterOption.indexOf(ctrl.filterData[ctrl.filter + "s"][index]["name"]) < 0){ + ctrl.filterOption.push(ctrl.filterData[ctrl.filter + "s"][index]["name"]) + } + } + }).catch(function (data) { + ctrl.data = null; + ctrl.showError = true; + ctrl.error = data.statusText; + }); + + } + } + + function deleteTag(index){ + delete ctrl.tagArray[index]; + ctrl.filterList(); + } + + function testFilter(text){ + for (var filter in ctrl.tagArray){ + if(text==filter){ + return true; + } + } + return false; + } + + function viewDeployResult(_id){ + $state.go('deployresult', {'_id':_id}, {reload: true}); + } + + /** + * This will contact the TestAPI API to get a listing of deploy + * results. + */ + function filterList(){ + if(ctrl.filter && ctrl.filterText!="" && ctrl.filterText!=undefined){ + ctrl.tagArray[ctrl.filter] = ctrl.filterText; + } + ctrl.showError = false; + var content_url = testapiApiUrl + '/deployresults' + + '?page=' + ctrl.currentPage; + for(var key in ctrl.tagArray){ + if(key=="start_date"){ + var start = $filter('date')(ctrl.tagArray[key], 'yyyy-MM-dd'); + if (start) { + content_url = + content_url + '&from=' + start + ' 00:00:00'; + } + } + else if(key=="end_date"){ + var end = $filter('date')(ctrl.tagArray[key], 'yyyy-MM-dd'); + if (end) { + content_url = content_url + '&to=' + end + ' 23:59:59'; + } + } + else{ + content_url = content_url + "&" + key + "=" + ctrl.tagArray[key] + } + if (ctrl.isUserResults) { + content_url = content_url + '&signed'; + } + } + ctrl.resultsRequest = + $http.get(content_url).success(function (data) { + ctrl.data = data; + ctrl.totalItems = ctrl.data.pagination.total_pages * ctrl.itemsPerPage; + ctrl.currentPage = ctrl.data.pagination.current_page; + ctrl.encodeFilter(); + }).catch(function (error) { + ctrl.data = null; + ctrl.totalItems = 0; + ctrl.showError = true; + ctrl.error = error.statusText + }); + ctrl.filterText = '' + } + ctrl.filterList(); + + + /** + * 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; + } + + /** + * This function will clear all filters and update the results + * listing. + */ + function clearFilters() { + ctrl.tagArray = {} + ctrl.filter = undefined + ctrl.filterList(); + } + } +})(); diff --git a/testapi/opnfv_testapi/ui/components/pods/pod/pod.html b/testapi/opnfv_testapi/ui/components/pods/pod/pod.html index b78eb2d..6aace92 100644 --- a/testapi/opnfv_testapi/ui/components/pods/pod/pod.html +++ b/testapi/opnfv_testapi/ui/components/pods/pod/pod.html @@ -12,8 +12,8 @@ <td width="90%" class="podsTableLeftTd">{{ctrl.data.name}}</td> </tr> <tr style="padding:9px"> - <td class="podsTableTd">Owner :</td> - <td width="90%" class="podsTableLeftTd">{{ctrl.data.owner}}</td> + <td class="podsTableTd">Creator :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.creator}}</td> </tr> <tr style="padding:9px"> <td class="podsTableTd">Role :</td> diff --git a/testapi/opnfv_testapi/ui/components/projects/project/project.html b/testapi/opnfv_testapi/ui/components/projects/project/project.html index 2921bd9..b6a751c 100644 --- a/testapi/opnfv_testapi/ui/components/projects/project/project.html +++ b/testapi/opnfv_testapi/ui/components/projects/project/project.html @@ -25,8 +25,8 @@ <td width="90%" class="podsTableLeftTd">{{ctrl.data.name}}</td> </tr> <tr style="padding:9px"> - <td class="podsTableTd">Owner :</td> - <td width="90%" class="podsTableLeftTd">{{ctrl.data.owner}}</td> + <td class="podsTableTd">Creator :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.creator}}</td> </tr> <tr style="padding:9px"> <td class="podsTableTd">Created at :</td> diff --git a/testapi/opnfv_testapi/ui/components/projects/project/testCases/testCase/testCase.html b/testapi/opnfv_testapi/ui/components/projects/project/testCases/testCase/testCase.html index 70c026a..f4bae41 100644 --- a/testapi/opnfv_testapi/ui/components/projects/project/testCases/testCase/testCase.html +++ b/testapi/opnfv_testapi/ui/components/projects/project/testCases/testCase/testCase.html @@ -16,6 +16,10 @@ <td width="90%" class="podsTableLeftTd">{{ctrl.data.project_name}}</td> </tr> <tr style="padding:9px"> + <td class="podsTableTd">Creator :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.creator}}</td> + </tr> + <tr style="padding:9px"> <td class="podsTableTd">Tier :</td> <td width="90%" class="podsTableLeftTd">{{ctrl.data.tier}}</td> </tr> diff --git a/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenario.html b/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenario.html index 328a5e6..14ba42d 100644 --- a/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenario.html +++ b/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenario.html @@ -12,6 +12,10 @@ <td width="90%" class="podsTableLeftTd">{{ctrl.data.scenarios[0].name}}</td> </tr> <tr style="padding:9px"> + <td class="podsTableTd">Creator :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.scenarios[0].creator}}</td> + </tr> + <tr style="padding:9px"> <td class="podsTableTd">Created at :</td> <td width="90%" class="podsTableLeftTd">{{ctrl.data.scenarios[0].creation_date}}</td> </tr> diff --git a/testapi/opnfv_testapi/ui/index.html b/testapi/opnfv_testapi/ui/index.html index beec61d..68c6cc5 100644 --- a/testapi/opnfv_testapi/ui/index.html +++ b/testapi/opnfv_testapi/ui/index.html @@ -51,6 +51,8 @@ <script src="testapi-ui/components/projects/project/projectController.js"></script> <script src="testapi-ui/components/results/resultsController.js"></script> <script src="testapi-ui/components/results/result/resultController.js"></script> + <script src="testapi-ui/components/deploy-results/deployResultsController.js"></script> + <script src="testapi-ui/components/deploy-results/deploy-result/deployResultController.js"></script> <script src="testapi-ui/components/profile/profileController.js"></script> <script src="testapi-ui/components/auth-failure/authFailureController.js"></script> <script src="testapi-ui/components/logout/logoutController.js"></script> diff --git a/testapi/opnfv_testapi/tests/UI/protractor-conf.js b/testapi/opnfv_testapi/ui/protractor-conf.js index affbe5d..affbe5d 100644 --- a/testapi/opnfv_testapi/tests/UI/protractor-conf.js +++ b/testapi/opnfv_testapi/ui/protractor-conf.js diff --git a/testapi/opnfv_testapi/ui/shared/header/header.html b/testapi/opnfv_testapi/ui/shared/header/header.html index 3b2aba1..2b7be2f 100644 --- a/testapi/opnfv_testapi/ui/shared/header/header.html +++ b/testapi/opnfv_testapi/ui/shared/header/header.html @@ -20,6 +20,7 @@ TestAPI <li ng-class="{ active: header.isActive('/pods')}"><a ui-sref="pods">Pods</a></li> <li ng-class="{ active: header.isActive('/projects')}"><a ui-sref="projects">Projects</a></li> <li ng-class="{ active: header.isActive('/results')}"><a ui-sref="results">Results</a></li> + <li ng-class="{ active: header.isActive('/deployresults')}"><a ui-sref="deployresults">Deploy Results</a></li> <li ng-class="{ active: header.isActive('/scenarios')}"><a ui-sref="scenarios">Scenarios</a></li> </ul> <ul class="nav navbar-nav navbar-right" ng-class="{'hidden' : !authenticate}"> |