From 141e16fcbdcacc02ff30d861bf76082b51d4c287 Mon Sep 17 00:00:00 2001 From: thuva4 Date: Thu, 16 Nov 2017 14:51:29 +0530 Subject: Update and Delete functionalities for projects Implemented the update and delete functions for the projects and wrote the e2e tests for the both functions. Change-Id: I917dd9503f145b0dde61dd9970bd855f9711335e Signed-off-by: thuva4 --- testapi/3rd_party/static/testapi-ui/Gruntfile.js | 5 +- testapi/3rd_party/static/testapi-ui/app.js | 5 + testapi/3rd_party/static/testapi-ui/index.html | 1 + .../testapi-ui/shared/alerts/confirmModal.html | 10 + .../shared/alerts/confirmModalFactory.js | 2 +- testapi/opnfv_testapi/common/check.py | 11 +- testapi/opnfv_testapi/handlers/base_handlers.py | 4 +- .../tests/UI/e2e/podsControllerSpec.js | 8 + .../tests/UI/e2e/projectControllerSpec.js | 434 +++++++++++++-------- .../tests/UI/e2e/projectsControllerSpec.js | 271 +++++++++++++ .../opnfv_testapi/tests/unit/handlers/test_base.py | 3 +- .../tests/unit/handlers/test_project.py | 7 +- .../opnfv_testapi/ui/projects/project/project.html | 25 ++ .../ui/projects/project/projectController.js | 183 +++++++++ .../ui/projects/project/updateModal.html | 26 ++ testapi/opnfv_testapi/ui/projects/projects.html | 40 +- .../ui/projects/projectsController.js | 20 + 17 files changed, 883 insertions(+), 172 deletions(-) create mode 100644 testapi/opnfv_testapi/tests/UI/e2e/projectsControllerSpec.js create mode 100644 testapi/opnfv_testapi/ui/projects/project/project.html create mode 100644 testapi/opnfv_testapi/ui/projects/project/projectController.js create mode 100644 testapi/opnfv_testapi/ui/projects/project/updateModal.html diff --git a/testapi/3rd_party/static/testapi-ui/Gruntfile.js b/testapi/3rd_party/static/testapi-ui/Gruntfile.js index f82269e..13f484f 100644 --- a/testapi/3rd_party/static/testapi-ui/Gruntfile.js +++ b/testapi/3rd_party/static/testapi-ui/Gruntfile.js @@ -14,7 +14,9 @@ module.exports = function (grunt) { base: './', middleware: function(connect, options, middlewares) { middlewares.unshift(function(req, res, next) { - if (req.method.toUpperCase() == 'POST') req.method='GET'; + if (req.method.toUpperCase() == 'POST' || req.method.toUpperCase() == "PUT"){ + req.method='GET'; + } return next(); }); return middlewares; @@ -118,6 +120,7 @@ module.exports = function (grunt) { coverageDir: '../../../opnfv_testapi/tests/UI/coverage', args: { specs: ['../../../opnfv_testapi/tests/UI/e2e/podsControllerSpec.js', + '../../../opnfv_testapi/tests/UI/e2e/projectsControllerSpec.js', '../../../opnfv_testapi/tests/UI/e2e/projectControllerSpec.js'] } }, diff --git a/testapi/3rd_party/static/testapi-ui/app.js b/testapi/3rd_party/static/testapi-ui/app.js index 0b35162..dbb56a6 100644 --- a/testapi/3rd_party/static/testapi-ui/app.js +++ b/testapi/3rd_party/static/testapi-ui/app.js @@ -69,6 +69,11 @@ templateUrl: 'testapi-ui/components/projects/projects.html', controller: 'ProjectsController as ctrl' }). + state('project', { + url: '/projects/:name', + templateUrl: 'testapi-ui/components/projects/project/project.html', + controller: 'ProjectController as ctrl' + }). state('communityResults', { url: '/community_results', templateUrl: 'testapi-ui/components/results/results.html', diff --git a/testapi/3rd_party/static/testapi-ui/index.html b/testapi/3rd_party/static/testapi-ui/index.html index 45162dc..ac29aca 100644 --- a/testapi/3rd_party/static/testapi-ui/index.html +++ b/testapi/3rd_party/static/testapi-ui/index.html @@ -47,6 +47,7 @@ + diff --git a/testapi/3rd_party/static/testapi-ui/shared/alerts/confirmModal.html b/testapi/3rd_party/static/testapi-ui/shared/alerts/confirmModal.html index 82478a5..e5397e0 100644 --- a/testapi/3rd_party/static/testapi-ui/shared/alerts/confirmModal.html +++ b/testapi/3rd_party/static/testapi-ui/shared/alerts/confirmModal.html @@ -1,11 +1,21 @@