Subject: pgAdmin IV API test cases patch

From: Priyanka Shendge <[email-masked]>
Date: Sun, 5 Jun 2016 23:26:03 +0530

Hi,

PFA patch for API test cases for tree nodes/modules. This patch does not
include
api tests for following modules:

1. Type
2. Table child nodes
3. FTS modules

Kindly, review the same and let me know for any modification.

-- 
Best,
Priyanka

EnterpriseDB Corporation
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/casts/tests/__init__.py
new file mode 100644
index 0000000..bfb0263
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/tests/__init__.py
@@ -0,0 +1,16 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from pgadmin.utils.route import BaseTestGenerator
+
+
+class CastTestGenerator(BaseTestGenerator):
+
+    def runTest(self):
+       return []
diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_add.py b/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_add.py
new file mode 100644
index 0000000..3c793cd
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_add.py
@@ -0,0 +1,80 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json, pickle, os
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+
+
+class CastsAddTestCase(LoginTestCase):
+    """This class will add cast under database node. """
+
+    priority = 19
+
+    scenarios = [
+        # Fetching default URL for cast node.
+        ('Check Cast Node', dict(url='/browser/cast/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add cast under 1st server of tree node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            data =\
+                {
+                    "castcontext": config_data['test_casts_credentials']
+                                              ['test_cast_context'],
+                    "encoding": config_data['test_casts_credentials']
+                                           ['test_encoding'],
+                    "name": config_data['test_casts_credentials']
+                                       ['test_name'],
+                    "srctyp": config_data['test_casts_credentials']
+                                         ['test_source_type'],
+                    "trgtyp": config_data['test_casts_credentials']
+                                         ['test_target_type']
+
+                }
+
+            response = self.tester.post(self.url + str(srv_grp) + '/' +
+                                        str(server_id) + '/' + str(db_id) + '/',
+                                        data=json.dumps(data),
+                                        content_type='html/json')
+
+            self.assertTrue(response.status_code, 200)
+
+            respdata = json.loads(response.data.decode())
+
+            cast_id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl'):
+                exst_server_id = open('/home/edb/Downloads/pgadmin4/web'
+                                      '/regression/''parent_id.pkl', 'rb')
+                all_id = pickle.load(exst_server_id)
+                pickle_id_dict = all_id
+
+            pickle_id_dict["cid"].append(cast_id)
+
+            cast_output = open('/home/edb/Downloads/pgadmin4/web/regression/'
+                               'parent_id.pkl', 'wb')
+            pickle.dump(pickle_id_dict, cast_output)
+            cast_output.close()
+
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_delete.py b/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_delete.py
new file mode 100644
index 0000000..be76529
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_delete.py
@@ -0,0 +1,60 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+
+
+class CastsDeleteTestCase(LoginTestCase):
+    """
+    This class will delete cast node present on the object browser's
+    tree node by response code.
+    """
+    priority = 22
+
+    scenarios = [
+        # Fetching default URL for cast node.
+        ('Check Cast Node', dict(url='/browser/cast/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will delete cast under 1st server of tree node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        cast_id = all_id["cid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id) +
+                                       '/' + str(cast_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) == 0:
+                raise Exception("No roles(s) to delete!!!")
+
+            del_response = self.tester.delete(self.url + str(srv_grp) + '/' +
+                                              str(server_id) + '/' +
+                                              str(db_id) + '/' + str(cast_id),
+                                              follow_redirects=True)
+
+            del_respdata = json.loads(del_response.data.decode())
+
+            self.assertTrue(del_respdata['success'], 1)
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_get.py b/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_get.py
new file mode 100644
index 0000000..5603707
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_get.py
@@ -0,0 +1,46 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+
+
+class CastsGetTestCase(LoginTestCase):
+    """ This class will fetch the cast node added under database. """
+
+    priority = 20
+
+    scenarios = [
+        # Fetching default URL for cast node.
+        ('Check Cast Node', dict(url='/browser/cast/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will get cast under 1st server of tree node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        cast_id = all_id["cid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id) +
+                                       '/' + str(cast_id),
+                                       content_type='html/json')
+
+            self.assertEquals(response.status_code, 200)
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_put.py b/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_put.py
new file mode 100644
index 0000000..ff6735c
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_put.py
@@ -0,0 +1,66 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+
+
+class CastsUpdateTestCase(LoginTestCase):
+    """
+    This class will update cast node present on the object browser's
+    tree node by response code.
+    """
+    priority = 21
+
+    scenarios = [
+        # Fetching default URL for cast node.
+        ('Check Cast Node', dict(url='/browser/cast/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will update cast under 1st server of tree node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        cast_id = all_id["cid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id) +
+                                       '/' + str(cast_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) == 0:
+                raise Exception("No roles(s) to update!!!")
+
+            data = {
+                "description": config_data["test_cast_update_data"]
+                                   ["test_comment"],
+                "id": cast_id
+               }
+
+            put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                           str(server_id) + '/' + str(db_id) +
+                                           '/' + str(cast_id),
+                                           data=json.dumps(data),
+                                           follow_redirects=True)
+
+            self.assertEquals(put_response.status_code, 200)
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/__init__.py
new file mode 100644
index 0000000..4b8df06
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/__init__.py
@@ -0,0 +1,16 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from pgadmin.utils.route import BaseTestGenerator
+
+
+class EventTriggerGeneratorTestCase(BaseTestGenerator):
+
+    def runTest(self):
+        return []
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_add.py b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_add.py
new file mode 100644
index 0000000..a8ff5ee
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_add.py
@@ -0,0 +1,80 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+import pickle
+import os
+
+
+class EventTriggerAddTestCase(LoginTestCase):
+    """ This class will add new event trigger under schema node. """
+
+    priority = 39
+
+    scenarios = [
+        # Fetching default URL for event trigger node.
+        ('Fetch Event Trigger Node URL',
+         dict(url='/browser/event_trigger/obj/'))
+        ]
+
+    def runTest(self):
+        """ This function will add event trigger under database node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            data = \
+                {
+                    "enabled": config_data['test_event_trigger_credentials']
+                                          ['test_enable'],
+                    "eventfunname": config_data['test_event_trigger_credentials']
+                                               ['test_event_func'],
+                    "eventname": config_data['test_event_trigger_credentials']
+                                            ['test_event_name'],
+                    "eventowner": config_data['test_event_trigger_credentials']
+                                             ['test_event_owner'],
+                    "name": config_data['test_event_trigger_credentials']
+                                       ['test_name'],
+                    "providers": config_data['test_event_trigger_credentials']
+                                            ['test_provider']
+                }
+
+            response = self.tester.post(self.url + str(srv_grp) + '/' +
+                                        str(server_id) + '/' + str(db_id) +
+                                        '/', data=json.dumps(data),
+                                        content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            event_trigger_id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl'):
+                exst_server_id = open('/home/edb/Downloads/pgadmin4/web'
+                                      '/regression/''parent_id.pkl', 'rb')
+                all_id = pickle.load(exst_server_id)
+                pickle_id_dict = all_id
+
+            pickle_id_dict["etid"].append(event_trigger_id)
+
+            event_trigger_output = open('/home/edb/Downloads/pgadmin4/web/'
+                                        'regression/parent_id.pkl', 'wb')
+            pickle.dump(pickle_id_dict, event_trigger_output)
+            event_trigger_output.close()
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_delete.py b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_delete.py
new file mode 100644
index 0000000..bbcb19c
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_delete.py
@@ -0,0 +1,59 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class EventTriggerDeleteTestCase(LoginTestCase):
+    """ This class will delete added event trigger under schema node. """
+
+    priority = 42
+
+    scenarios = [
+        # Fetching default URL for event trigger  node.
+        ('Fetch Event Trigger Node URL', dict(url='/browser/event_trigger/obj/'))
+        ]
+
+    def runTest(self):
+        """ This function will delete event trigger under database node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        event_trigger_id = all_id["etid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id) +
+                                       '/' + str(event_trigger_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) == 0:
+                raise Exception("No event trigger(s) to update!!!")
+
+            del_response = self.tester.delete(self.url + str(srv_grp) + '/' +
+                                              str(server_id) + '/' +
+                                              str(db_id) + '/' +
+                                              str(event_trigger_id),
+                                              follow_redirects=True)
+
+            del_respdata = json.loads(del_response.data.decode())
+
+            self.assertTrue(del_respdata['success'], 1)
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_get.py b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_get.py
new file mode 100644
index 0000000..92b417b
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_get.py
@@ -0,0 +1,47 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+
+
+class EventTriggerGetTestCase(LoginTestCase):
+    """ This class will fetch added event trigger under schema node. """
+
+    priority = 40
+
+    scenarios = [
+        # Fetching default URL for event trigger  node.
+        ('Fetch Event Trigger Node URL',
+         dict(url='/browser/event_trigger/obj/'))
+        ]
+
+    def runTest(self):
+        """ This function will fetch event trigger under database node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        event_trigger_id = all_id["etid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id) +
+                                       '/' + str(event_trigger_id),
+                                       content_type='html/json')
+
+            self.assertEquals(response.status_code, 200)
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_put.py b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_put.py
new file mode 100644
index 0000000..b8ab8de
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_put.py
@@ -0,0 +1,65 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class EventTriggerPutTestCase(LoginTestCase):
+    """ This class will update added event trigger under schema node. """
+
+    priority = 41
+
+    scenarios = [
+        # Fetching default URL for event trigger  node.
+        ('Fetch Event Trigger Node URL',
+         dict(url='/browser/event_trigger/obj/'))
+        ]
+
+    def runTest(self):
+        """ This function will update event trigger under database node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        event_trigger_id = all_id["etid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id) +
+                                       '/' + str(event_trigger_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) == 0:
+                raise Exception("No event trigger(s) to update!!!")
+
+            data = \
+                {
+                    "comment": config_data['test_event_trigger_update_data']
+                                          ['test_comment'],
+                    "id": event_trigger_id
+                }
+
+            put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                           str(server_id) + '/' + str(db_id) +
+                                           '/' + str(event_trigger_id),
+                                           data=json.dumps(data),
+                                           follow_redirects=True)
+
+            self.assertEquals(put_response.status_code, 200)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/__init__.py
new file mode 100644
index 0000000..025b57e
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/__init__.py
@@ -0,0 +1,16 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from pgadmin.utils.route import BaseTestGenerator
+
+
+class ExtensionGeneratorTestCase(BaseTestGenerator):
+
+    def runTest(self):
+        return []
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_add.py b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_add.py
new file mode 100644
index 0000000..af02be8
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_add.py
@@ -0,0 +1,77 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+import pickle
+import os
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+
+
+class ExtensionsAddTestCase(LoginTestCase):
+    """ This class will add new extension under extension node. """
+    priority = 33
+
+    scenarios = [
+        # Fetching default URL for extension node.
+        ('Check Extension Node', dict(url='/browser/extension/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add extension under 1st server of tree node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            data =\
+                {
+                    "name": config_data['test_extension_credentials']
+                                              ['test_name'],
+                    "relocatable": config_data['test_extension_credentials']
+                                           ['test_relocate'],
+                    "schema": config_data['test_extension_credentials']
+                                       ['test_schema'],
+                    "version": config_data['test_extension_credentials']
+                                         ['test_version']
+
+                }
+
+            response = self.tester.post(self.url + str(srv_grp) + '/' +
+                                        str(server_id) + '/' + str(db_id) + '/',
+                                        data=json.dumps(data),
+                                        content_type='html/json')
+
+            self.assertTrue(response.status_code, 200)
+
+            respdata = json.loads(response.data.decode())
+
+            extension_id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl'):
+                exst_server_id = open('/home/edb/Downloads/pgadmin4/web'
+                                      '/regression/''parent_id.pkl', 'rb')
+                all_id = pickle.load(exst_server_id)
+                pickle_id_dict = all_id
+
+            pickle_id_dict["eid"].append(extension_id)
+
+            extension_output = open('/home/edb/Downloads/pgadmin4/web/regression/'
+                          'parent_id.pkl', 'wb')
+            pickle.dump(pickle_id_dict, extension_output)
+            extension_output.close()
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_delete.py b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_delete.py
new file mode 100644
index 0000000..33fc9bc
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_delete.py
@@ -0,0 +1,59 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+
+
+class ExtensionDeleteTestCase(LoginTestCase):
+    """ This class will delete extension node added under database node. """
+
+    priority = 96
+
+    scenarios = [
+        # Fetching default URL for extension node.
+        ('Check Cast Node', dict(url='/browser/extension/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will delete added extension under database node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        extension_id = all_id["eid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' +
+                                       str(db_id) + '/' + str(extension_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) == 0:
+                raise Exception("No extension(s) to delete!!!")
+
+            del_response = self.tester.delete(self.url + str(srv_grp) + '/' +
+                                              str(server_id) + '/' +
+                                              str(db_id) + '/' +
+                                              str(extension_id),
+                                              follow_redirects=True)
+
+            del_respdata = json.loads(del_response.data.decode())
+
+            self.assertTrue(del_respdata['success'], 1)
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_get.py b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_get.py
new file mode 100644
index 0000000..8778651
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_get.py
@@ -0,0 +1,45 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+
+
+class ExtensionGetTestCase(LoginTestCase):
+    """ This class will fetch the extension node added under database. """
+
+    priority = 24
+
+    scenarios = [
+        # Fetching default URL for extension node.
+        ('Check Cast Node', dict(url='/browser/extension/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will fetch cast under 1st server of tree node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        extension_id = all_id["eid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id) +
+                                       '/' + str(extension_id),
+                                       content_type='html/json')
+
+            self.assertEquals(response.status_code, 200)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_put.py b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_put.py
new file mode 100644
index 0000000..caa68de
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_put.py
@@ -0,0 +1,66 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+
+
+class ExtensionDeleteTestCase(LoginTestCase):
+    """
+    This class will update extension node present on the object browser's
+    tree node by response code.
+    """
+    priority = 25
+
+    scenarios = [
+        # Fetching default URL for extension node.
+        ('Check Cast Node', dict(url='/browser/extension/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will update extension node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        extension_id = all_id["eid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/'
+                                       + str(server_id) + '/' + str(db_id) + '/'
+                                       + str(extension_id),
+                                        content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) == 0:
+                raise Exception("No extension(s) to update!!!")
+
+            data = \
+                {
+                    "id": extension_id,
+                    "schema": config_data["test_extension_update_data"]
+                                   ["test_schema"]
+                }
+
+            put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                           str(server_id) + '/' + str(db_id) +
+                                           '/' + str(extension_id),
+                                           data=json.dumps(data),
+                                           follow_redirects=True)
+
+            self.assertEquals(put_response.status_code, 200)
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/__init__.py
new file mode 100644
index 0000000..8fd1422
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/__init__.py
@@ -0,0 +1,16 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from pgadmin.utils.route import BaseTestGenerator
+
+
+class ForeignServersGeneratorTestCase(BaseTestGenerator):
+
+    def runTest(self):
+        return []
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_add.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_add.py
new file mode 100644
index 0000000..a3e69f0
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_add.py
@@ -0,0 +1,92 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+import os
+import pickle
+
+
+class ForeignServerAddTestCase(LoginTestCase):
+    """
+    This class will add foreign server under database node.
+    """
+    priority = 71
+
+    scenarios = [
+        # Fetching default URL for foreign server node.
+        ('Check FDW Node', dict(url='/browser/foreign_server/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add foreign server under database node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        fdw_id = all_id["fid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get FDW
+            fdw_response = self.tester.get('/browser/foreign_data_wrapper/obj/'
+                                           '{0}/{1}/{2}/{3}'.format
+                                           (srv_grp, server_id, db_id, fdw_id),
+                                           content_type='html/json')
+
+            fdw_respdata = json.loads(fdw_response.data.decode())
+
+            if len(fdw_respdata) == 0:
+                raise Exception("No FDW(s) to update!")
+
+            data = \
+                {
+                    "fsrvacl": config_data['test_foreign_server_credentials']
+                                          ['test_fsr_acl'],
+                    "fsrvoptions": config_data['test_foreign_server_credentials']
+                                              ['test_fsr_optns'],
+                    "fsrvowner": config_data['test_foreign_server_credentials']
+                                            ['test_fsr_owner'],
+                    "name": config_data['test_foreign_server_credentials']
+                                       ['test_name']
+                }
+
+            response = self.tester.post(self.url + str(srv_grp) + '/' +
+                                        str(server_id) + '/' + str(db_id) +
+                                        '/' + str(fdw_id) + '/',
+                                        data=json.dumps(data),
+                                        content_type='html/json')
+
+            self.assertTrue(response.status_code, 200)
+
+            respdata = json.loads(response.data.decode())
+
+            frs_id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl'):
+                exst_server_id = open('/home/edb/Downloads/pgadmin4/web'
+                                       '/regression/''parent_id.pkl', 'rb')
+                all_id = pickle.load(exst_server_id)
+                pickle_id_dict = all_id
+
+            pickle_id_dict["fsid"].append(frs_id)
+
+            frs_output = open('/home/edb/Downloads/pgadmin4/web/regression/'
+                          'parent_id.pkl', 'wb')
+            pickle.dump(pickle_id_dict, frs_output)
+            frs_output.close()
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_delete.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_delete.py
new file mode 100644
index 0000000..84b8e2d
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_delete.py
@@ -0,0 +1,73 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class ForeignServerDeleteTestCase(LoginTestCase):
+    """ This class will delete foreign server under database node. """
+
+    priority = 94
+
+    scenarios = [
+        # Fetching default URL for foreign server node.
+        ('Check FDW Node', dict(url='/browser/foreign_server/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will delete foreign server under database node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        fdw_id = all_id["fid"][0]
+        frs_id = all_id['fsid'][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get FDW
+            fdw_response = self.tester.get('/browser/foreign_data_wrapper/obj/'
+                                           '{0}/{1}/{2}/{3}'.format
+                                           (srv_grp, server_id, db_id, fdw_id),
+                                           content_type='html/json')
+
+            fdw_respdata = json.loads(fdw_response.data.decode())
+
+            if len(fdw_respdata) == 0:
+                raise Exception("No FDW(s) to available!")
+
+            frs_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                           str(server_id) + '/' + str(db_id) +
+                                           '/' + str(fdw_id) + '/' +
+                                           str(frs_id),
+                                           content_type='html/json')
+
+            frs_respdata = json.loads(frs_response.data.decode())
+
+            if len(frs_respdata) == 0:
+                raise Exception("No FRS(s) to update!")
+
+            delete_response = self.tester.delete(self.url + str(srv_grp) +
+                                                 '/' + str(server_id) + '/' +
+                                                 str(db_id) + '/' +
+                                                 str(fdw_id) + '/' +
+                                                 str(frs_id),
+                                                 follow_redirects=True)
+
+            del_respdata = json.loads(delete_response.data.decode())
+
+            self.assertTrue(del_respdata['success'], 1)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_get.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_get.py
new file mode 100644
index 0000000..5bdf35a
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_get.py
@@ -0,0 +1,61 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class ForeignServerGetTestCase(LoginTestCase):
+    """
+    This class will add foreign server under FDW node.
+    """
+    priority = 72
+
+    scenarios = [
+        # Fetching default URL for foreign server node.
+        ('Check FDW Node', dict(url='/browser/foreign_server/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add foreign server under FDW node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        fdw_id = all_id["fid"][0]
+        frs_id = all_id['fsid'][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get FDW
+            fdw_response = self.tester.get('/browser/foreign_data_wrapper/obj/'
+                                           '{0}/{1}/{2}/{3}'.format
+                                           (srv_grp, server_id, db_id, fdw_id),
+                                           content_type='html/json')
+
+            fdw_respdata = json.loads(fdw_response.data.decode())
+
+            if len(fdw_respdata) == 0:
+                raise Exception("No FDW(s) to available!")
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id) +
+                                       '/' + str(fdw_id) + '/' + str(frs_id),
+                                       content_type='html/json')
+
+            self.assertEquals(response.status_code, 200)
+
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_put.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_put.py
new file mode 100644
index 0000000..2d170b3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_put.py
@@ -0,0 +1,79 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class ForeignServerPutTestCase(LoginTestCase):
+    """
+    This class will update foreign server under database node.
+    """
+    priority = 73
+
+    scenarios = [
+        # Fetching default URL for foreign server node.
+        ('Check FDW Node', dict(url='/browser/foreign_server/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add foreign server under database node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        fdw_id = all_id["fid"][0]
+        frs_id = all_id['fsid'][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get FDW
+            fdw_response = self.tester.get('/browser/foreign_data_wrapper/obj/'
+                                           '{0}/{1}/{2}/{3}'.format
+                                           (srv_grp, server_id, db_id, fdw_id),
+                                           content_type='html/json')
+
+            fdw_respdata = json.loads(fdw_response.data.decode())
+
+            if len(fdw_respdata) == 0:
+                raise Exception("No FDW(s) to available!")
+
+            # Get FRS
+            frs_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                           str(server_id) + '/' + str(db_id) +
+                                           '/' + str(fdw_id) + '/' +
+                                           str(frs_id),
+                                           content_type='html/json')
+
+            frs_respdata = json.loads(frs_response.data.decode())
+
+            if len(frs_respdata) == 0:
+                raise Exception("No FRS(s) to update!")
+
+            data = \
+                {
+                    "description": config_data['test_FRS_update_data']
+                                          ['test_comment'],
+                    "id": frs_id
+                }
+
+            put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                           str(server_id) + '/' + str(db_id) +
+                                           '/' + str(fdw_id) + '/' +
+                                           str(frs_id), data=json.dumps(data),
+                                           follow_redirects=True)
+
+            self.assertEquals(put_response.status_code, 200)
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/__init__.py
new file mode 100644
index 0000000..0b87db2
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/__init__.py
@@ -0,0 +1,16 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from pgadmin.utils.route import BaseTestGenerator
+
+
+class UserMappingGeneratorTestCase(BaseTestGenerator):
+
+    def runTest(self):
+        return []
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_add.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_add.py
new file mode 100644
index 0000000..395ff06
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_add.py
@@ -0,0 +1,104 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+import os
+import pickle
+
+
+class UserMappingAddTestCase(LoginTestCase):
+    """
+    This class will add user mapping under foreign server node.
+    """
+    priority = 74
+
+    scenarios = [
+        # Fetching default URL for user mapping node.
+        ('Check user mapping Node', dict(url='/browser/user_mapping/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add user mapping under foreign server node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        fdw_id = all_id["fid"][0]
+        frs_id = all_id['fsid'][0]
+        srv_grp = config_data['test_server_group']
+
+        #print("in fs:::::", fdw_id)
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get FDW
+            fdw_response = self.tester.get('/browser/foreign_data_wrapper/obj/'
+                                           '{0}/{1}/{2}/{3}'.format
+                                           (srv_grp, server_id, db_id, fdw_id),
+                                           content_type='html/json')
+
+            fdw_respdata = json.loads(fdw_response.data.decode())
+
+            if len(fdw_respdata) == 0:
+                raise Exception("No FDW(s) available!")
+
+            # Get FRS
+            frs_response = self.tester.get('/browser/foreign_server/obj/'
+                                           '{0}/{1}/{2}/{3}/{4}'.format
+                                           (srv_grp, server_id, db_id, fdw_id,
+                                            frs_id), content_type='html/json')
+
+            frs_respdata = json.loads(frs_response.data.decode())
+
+            if len(frs_respdata) == 0:
+                raise Exception("No FRS(s) available!")
+
+            data = \
+                {
+                    "name": config_data['test_user_mapping_credentials']
+                                       ['test_name'],
+                    "um_options": config_data['test_user_mapping_credentials']
+                                             ['test_option'],
+                    "umoptions": config_data['test_user_mapping_credentials']
+                                            ['test_options']
+                }
+
+            response = self.tester.post(self.url + str(srv_grp) + '/' +
+                                        str(server_id) + '/' + str(db_id) +
+                                        '/' + str(fdw_id) + '/' +
+                                        str(frs_id) + '/',
+                                        data=json.dumps(data),
+                                        content_type='html/json')
+
+            self.assertTrue(response.status_code, 200)
+
+            respdata = json.loads(response.data.decode())
+
+            um_id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl'):
+                exst_server_id = open('/home/edb/Downloads/pgadmin4/web'
+                                      '/regression/''parent_id.pkl', 'rb')
+                all_id = pickle.load(exst_server_id)
+                pickle_id_dict = all_id
+
+            pickle_id_dict["umid"].append(um_id)
+
+            um_output = open('/home/edb/Downloads/pgadmin4/web/regression/'
+                             'parent_id.pkl', 'wb')
+            pickle.dump(pickle_id_dict, um_output)
+            um_output.close()
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_delete.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_delete.py
new file mode 100644
index 0000000..0bd644a
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_delete.py
@@ -0,0 +1,84 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class UserMappingDeleteTestCase(LoginTestCase):
+    """
+    This class will delete user mapping under foreign server node.
+    """
+    priority = 77
+
+    scenarios = [
+        # Fetching default URL for user mapping node.
+        ('Check user mapping Node', dict(url='/browser/user_mapping/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function delete user mapping under foreign server node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        fdw_id = all_id["fid"][0]
+        frs_id = all_id['fsid'][0]
+        um_id = all_id['umid'][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get FDW
+            fdw_response = self.tester.get('/browser/foreign_data_wrapper/obj/'
+                                           '{0}/{1}/{2}/{3}'.format
+                                           (srv_grp, server_id, db_id, fdw_id),
+                                           content_type='html/json')
+
+            fdw_respdata = json.loads(fdw_response.data.decode())
+
+            if len(fdw_respdata) == 0:
+                raise Exception("No FDW(s) available!")
+
+            # Get FRS
+            frs_response = self.tester.get('/browser/foreign_server/obj/'
+                                           '{0}/{1}/{2}/{3}/{4}'.format
+                                           (srv_grp, server_id, db_id, fdw_id,
+                                            frs_id), content_type='html/json')
+
+            frs_respdata = json.loads(frs_response.data.decode())
+
+            if len(frs_respdata) == 0:
+                raise Exception("No FRS(s) available!")
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id) +
+                                       '/' + str(fdw_id) + '/' + str(frs_id) +
+                                       '/' + str(um_id),
+                                       content_type='html/json')
+
+            um_respdata = json.loads(fdw_response.data.decode())
+
+            if len(um_respdata) == 0:
+                raise Exception("No user mapping(s) to delete!")
+
+            put_response = self.tester.delete(self.url + str(srv_grp) + '/' +
+                                              str(server_id) + '/' +
+                                              str(db_id) + '/' + str(fdw_id) +
+                                              '/' + str(frs_id) + '/' +
+                                              str(um_id), follow_redirects=True)
+
+            self.assertEquals(put_response.status_code, 200)
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_get.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_get.py
new file mode 100644
index 0000000..541f371
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_get.py
@@ -0,0 +1,72 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class UserMappingGetTestCase(LoginTestCase):
+    """
+    This class will add user mapping under foreign server node.
+    """
+    priority = 75
+
+    scenarios = [
+        # Fetching default URL for user mapping node.
+        ('Check user mapping Node', dict(url='/browser/user_mapping/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will fetch user mapping under foreign server node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        fdw_id = all_id["fid"][0]
+        frs_id = all_id['fsid'][0]
+        um_id = all_id['umid'][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get FDW
+            fdw_response = self.tester.get('/browser/foreign_data_wrapper/obj/'
+                                           '{0}/{1}/{2}/{3}'.format
+                                           (srv_grp, server_id, db_id, fdw_id),
+                                           content_type='html/json')
+
+            fdw_respdata = json.loads(fdw_response.data.decode())
+
+            if len(fdw_respdata) == 0:
+                raise Exception("No FDW(s) available!")
+
+            # Get FRS
+            frs_response = self.tester.get('/browser/foreign_server/obj/'
+                                           '{0}/{1}/{2}/{3}/{4}'.format
+                                           (srv_grp, server_id, db_id, fdw_id,
+                                            frs_id), content_type='html/json')
+
+            frs_respdata = json.loads(frs_response.data.decode())
+
+            if len(frs_respdata) == 0:
+                raise Exception("No FRS(s) available!")
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id) +
+                                       '/' + str(fdw_id) + '/' + str(frs_id) +
+                                       '/' + str(um_id),
+                                       content_type='html/json')
+
+            self.assertTrue(response.status_code, 200)
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_put.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_put.py
new file mode 100644
index 0000000..f5e5dbb
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_put.py
@@ -0,0 +1,92 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class UserMappingPutTestCase(LoginTestCase):
+    """
+    This class will update user mapping under foreign server node.
+    """
+    priority = 76
+
+    scenarios = [
+        # Fetching default URL for user mapping node.
+        ('Check user mapping Node', dict(url='/browser/user_mapping/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function update user mapping under foreign server node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        fdw_id = all_id["fid"][0]
+        frs_id = all_id['fsid'][0]
+        um_id = all_id['umid'][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get FDW
+            fdw_response = self.tester.get('/browser/foreign_data_wrapper/obj/'
+                                           '{0}/{1}/{2}/{3}'.format
+                                           (srv_grp, server_id, db_id, fdw_id),
+                                           content_type='html/json')
+
+            fdw_respdata = json.loads(fdw_response.data.decode())
+
+            if len(fdw_respdata) == 0:
+                raise Exception("No FDW(s) available!")
+
+            # Get FRS
+            frs_response = self.tester.get('/browser/foreign_server/obj/'
+                                           '{0}/{1}/{2}/{3}/{4}'.format
+                                           (srv_grp, server_id, db_id, fdw_id,
+                                            frs_id), content_type='html/json')
+
+            frs_respdata = json.loads(frs_response.data.decode())
+
+            if len(frs_respdata) == 0:
+                raise Exception("No FRS(s) available!")
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id) +
+                                       '/' + str(fdw_id) + '/' + str(frs_id) +
+                                       '/' + str(um_id),
+                                       content_type='html/json')
+
+            um_respdata = json.loads(fdw_response.data.decode())
+
+            if len(um_respdata) == 0:
+                raise Exception("No user mapping(s) to update!")
+
+            data = \
+                {
+                    "id": um_id,
+                    "umoptions": config_data['test_user_mapping_update_data']
+                                            ['test_options']
+                }
+
+            put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                           str(server_id) + '/' + str(db_id) +
+                                           '/' + str(fdw_id) + '/' +
+                                           str(frs_id) + '/' + str(um_id),
+                                           data=json.dumps(data),
+                                           follow_redirects=True)
+
+            self.assertEquals(put_response.status_code, 200)
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/__init__.py
new file mode 100644
index 0000000..6f9f064
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/__init__.py
@@ -0,0 +1,16 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from pgadmin.utils.route import BaseTestGenerator
+
+
+class FDWGeneratorTestCase(BaseTestGenerator):
+
+    def runTest(self):
+        return []
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_FDW_add.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_FDW_add.py
new file mode 100644
index 0000000..cf68fcd
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_FDW_add.py
@@ -0,0 +1,81 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json, os, pickle
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+
+
+class FDWDAddTestCase(LoginTestCase):
+    """
+    This class will add foreign data wrappers under database node.
+    """
+    priority = 44
+
+    scenarios = [
+        # Fetching default URL for foreign data wrapper node.
+        ('Check FDW Node', dict(url='/browser/foreign_data_wrapper/obj/'))
+
+    ]
+
+    def runTest(self):
+        """ This function will add foreign data wrapper under database node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            data = \
+                {
+                    "fdwacl": config_data['test_FDW_credentials']
+                                         ['test_acl'],
+                    "fdwhan": config_data['test_FDW_credentials']
+                                         ['test_handler'],
+                    "fdwoptions": config_data['test_FDW_credentials']
+                                             ['test_options'],
+                    "fdwowner": config_data['test_FDW_credentials']
+                                           ['test_owner'],
+                    "fdwvalue": config_data['test_FDW_credentials']
+                                           ['test_validator'],
+                    "name": config_data['test_FDW_credentials']
+                                       ['test_name']
+                }
+
+            response = self.tester.post(self.url + str(srv_grp) + '/' +
+                                        str(server_id) + '/' + str(db_id) + '/',
+                                        data=json.dumps(data),
+                                        content_type='html/json')
+
+            self.assertTrue(response.status_code, 200)
+
+            respdata = json.loads(response.data.decode())
+
+            fdw_id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl'):
+                exst_server_id = open('/home/edb/Downloads/pgadmin4/web'
+                                       '/regression/''parent_id.pkl', 'rb')
+                all_id = pickle.load(exst_server_id)
+                pickle_id_dict = all_id
+
+            pickle_id_dict["fid"].append(fdw_id)
+
+            fdw_output = open('/home/edb/Downloads/pgadmin4/web/regression/'
+                          'parent_id.pkl', 'wb')
+            pickle.dump(pickle_id_dict, fdw_output)
+            fdw_output.close()
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_FDW_delete.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_FDW_delete.py
new file mode 100644
index 0000000..f30004d
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_FDW_delete.py
@@ -0,0 +1,60 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+
+
+class FDWDeleteTestCase(LoginTestCase):
+    """ This class will delete foreign data wrappers under database node. """
+
+    priority = 95
+
+    scenarios = [
+        # Fetching default URL for foreign data wrapper node.
+        ('Check FDW Node', dict(url='/browser/foreign_data_wrapper/obj/'))
+    ]
+
+    def runTest(self):
+        """
+        This function will delete foreign data wrapper under database node.
+        """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        fdw_id = all_id["fid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id) +
+                                       '/' + str(fdw_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) == 0:
+                raise Exception("No FDW(s) to delete!!!")
+
+            del_response = self.tester.delete(self.url + str(srv_grp) + '/' +
+                                              str(server_id) + '/' +
+                                              str(db_id) + '/' + str(fdw_id),
+                                              follow_redirects=True)
+
+            del_respdata = json.loads(del_response.data.decode())
+
+            self.assertTrue(del_respdata['success'], 1)
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_FDW_get.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_FDW_get.py
new file mode 100644
index 0000000..588c0fb
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_FDW_get.py
@@ -0,0 +1,48 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+
+
+class FDWDGetTestCase(LoginTestCase):
+    """ This class will fetch foreign data wrappers under database node. """
+
+    priority = 45
+
+    scenarios = [
+        # Fetching default URL for foreign data wrapper node.
+        ('Check FDW Node', dict(url='/browser/foreign_data_wrapper/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will fetch foreign data wrapper added
+            under database node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        fdw_id = all_id["fid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id) +
+                                       '/' + str(fdw_id),
+                                       content_type='html/json')
+
+            self.assertEquals(response.status_code, 200)
+
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_FDW_put.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_FDW_put.py
new file mode 100644
index 0000000..f8914f5
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_FDW_put.py
@@ -0,0 +1,68 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+
+
+class FDWDPutTestCase(LoginTestCase):
+    """
+    This class will update foreign data wrappers under database node.
+    """
+    priority = 46
+
+    scenarios = [
+        # Fetching default URL for foreign data wrapper node.
+        ('Check FDW Node', dict(url='/browser/foreign_data_wrapper/obj/'))
+
+    ]
+
+    def runTest(self):
+        """ This function will update foreign data wrapper under
+            database node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        fdw_id = all_id["fid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id) +
+                                       '/' + str(fdw_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) == 0:
+                raise Exception("No FDW(s) to update!!!")
+
+            data = \
+                {
+                    "description": config_data['test_FDW_update_data']
+                                          ['test_comment'],
+                    "id": fdw_id
+                }
+
+            put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                           str(server_id) + '/' +
+                                           str(db_id) + '/' + str(fdw_id),
+                                           data=json.dumps(data),
+                                           follow_redirects=True)
+
+            self.assertEquals(put_response.status_code, 200)
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/languages/tests/__init__.py
new file mode 100644
index 0000000..f5a240e
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/languages/tests/__init__.py
@@ -0,0 +1,16 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from pgadmin.utils.route import BaseTestGenerator
+
+
+class LanguageTestGenerator(BaseTestGenerator):
+
+   def generate_tests(self):
+       return []
diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/tests/test_language_get.py b/web/pgadmin/browser/server_groups/servers/databases/languages/tests/test_language_get.py
new file mode 100644
index 0000000..2fc54a8
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/languages/tests/test_language_get.py
@@ -0,0 +1,46 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_nodes import test_getnodes
+from regression.test_utils import get_ids
+
+
+class LanguageGetTestCase(LoginTestCase):
+    """
+    This class will fetch language node available under database node.
+    """
+    priority = 31
+
+    scenarios = [
+        # Fetching default URL for language node.
+        ('Check Cast Node', dict(url='/browser/language/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will fetch language under 1st server of tree node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        lang_id = all_id["lid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' +
+                                       str(db_id) + '/' + str(lang_id),
+                                       content_type='html/json')
+
+            self.assertEquals(response.status_code, 200)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/tests/test_language_put.py b/web/pgadmin/browser/server_groups/servers/databases/languages/tests/test_language_put.py
new file mode 100644
index 0000000..df0a2e2
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/languages/tests/test_language_put.py
@@ -0,0 +1,63 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+
+
+class LanguageUpdateTestCase(LoginTestCase):
+    """ This class will update available language node under database node. """
+
+    priority = 32
+
+    scenarios = [
+        # Fetching default URL for cast node.
+        ('Check Language Node URL', dict(url='/browser/language/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will update language node's comments field. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        lang_id = all_id["lid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id) +
+                                       '/' + str(lang_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) == 0:
+                raise Exception("No language(s) to update!!!")
+
+            data = {
+                "description": config_data["test_language_update_data"]
+                                   ["test_comment"],
+                "id": lang_id
+               }
+
+            put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                           str(server_id) + '/' + str(db_id) +
+                                           '/' + str(lang_id),
+                                           data=json.dumps(data),
+                                           follow_redirects=True)
+
+            self.assertEquals(put_response.status_code, 200)
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/__init__.py
new file mode 100644
index 0000000..ba78cb1
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/__init__.py
@@ -0,0 +1,16 @@
+##########################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##########################################################################
+
+from pgadmin.utils.route import BaseTestGenerator
+
+
+class CollationTestGenerator(BaseTestGenerator):
+
+   def generate_tests(self):
+       return []
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_add.py
new file mode 100644
index 0000000..49ca0ef
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_add.py
@@ -0,0 +1,82 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+import pickle
+import os
+
+
+class CollationAddTestCase(LoginTestCase):
+    """ This class will add new collation under schema node. """
+
+    priority = 48
+
+    scenarios = [
+        # Fetching default URL for collation node.
+        ('Default Node URL', dict(url='/browser/collation/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add collation under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            response = self.tester.get('/browser/schema/obj/' + str(srv_grp) + '/'
+                                       + str(server_id) + '/' + str(db_id) + '/'
+                                       + str(schema_id),
+                                        content_type='html/json')
+
+            data = \
+                {
+                    "copy_collation": config_data['test_collation_credentials']
+                                                 ['test_copy_collation'],
+                    "name": config_data['test_collation_credentials']
+                                       ['test_name'],
+                    "owner": config_data['test_collation_credentials']
+                                        ['test_owner'],
+                    "schema": config_data['test_collation_credentials']
+                                         ['test_schema']
+                }
+
+            response = self.tester.post(self.url + str(srv_grp) + '/' +
+                                        str(server_id) + '/' + str(db_id) +
+                                        '/' + str(schema_id) + '/',
+                                        data=json.dumps(data),
+                                        content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            collation_id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl'):
+                exst_server_id = open('/home/edb/Downloads/pgadmin4/web'
+                                      '/regression/''parent_id.pkl', 'rb')
+                all_id = pickle.load(exst_server_id)
+                pickle_id_dict = all_id
+
+            pickle_id_dict["coid"].append(collation_id)
+
+            collation_output = open('/home/edb/Downloads/pgadmin4/web/'
+                                    'regression/parent_id.pkl', 'wb')
+            pickle.dump(pickle_id_dict, collation_output)
+            collation_output.close()
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_delete.py
new file mode 100644
index 0000000..96d95fe
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_delete.py
@@ -0,0 +1,62 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class CollationDeleteTestCase(LoginTestCase):
+    """ This class will delete added collation under schema node. """
+
+    priority = 51
+
+    scenarios = [
+        # Fetching default URL for collation node.
+        ('Fetch collation Node URL', dict(url='/browser/collation/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will delete collation under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        collation_id = all_id["coid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+              # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) == 0:
+                  raise Exception("No schema(s) to delete!!!")
+
+            del_response = self.tester.delete(self.url + str(srv_grp) + '/' +
+                                              str(server_id) + '/' +
+                                              str(db_id) + '/' +
+                                              str(schema_id) + '/' +
+                                              str(collation_id),
+                                              follow_redirects=True)
+
+            del_respdata = json.loads(del_response.data.decode())
+
+            self.assertTrue(del_respdata['success'], 1)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_get.py
new file mode 100644
index 0000000..c411d70
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_get.py
@@ -0,0 +1,59 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class CollationGetTestCase(LoginTestCase):
+    """ This class will fetch new collation under schema node. """
+
+    priority = 49
+
+    scenarios = [
+        # Fetching default URL for collation node.
+        ('Fecth collation Node URL', dict(url='/browser/collation/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will fetch collation under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        collation_id = all_id["coid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) != 0:
+
+                get_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(collation_id),
+                                               content_type='html/json')
+
+                self.assertEquals(get_response.status_code, 200)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_put.py
new file mode 100644
index 0000000..b17cdd7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_put.py
@@ -0,0 +1,68 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class CollationPutTestCase(LoginTestCase):
+    """ This class will update added collation under schema node. """
+
+    priority = 50
+
+    scenarios = [
+        # Fetching default URL for collation node.
+        ('Fetch collation Node URL', dict(url='/browser/collation/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will update collation under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        collation_id = all_id["coid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) == 0:
+                raise Exception("No schema(s) available!!!")
+
+            data = \
+              {
+                  "description": config_data['test_collation_update_data']
+                                            ['test_comment'],
+                  "id": collation_id,
+              }
+
+            put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                           str(server_id) + '/' +
+                                           str(db_id) + '/' +
+                                           str(schema_id) + '/' +
+                                           str(collation_id),
+                                           data=json.dumps(data),
+                                           follow_redirects=True)
+
+            self.assertEquals(put_response.status_code, 200)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/__init__.py
new file mode 100644
index 0000000..7dca204
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/__init__.py
@@ -0,0 +1,16 @@
+##########################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##########################################################################
+
+from pgadmin.utils.route import BaseTestGenerator
+
+
+class DomainTestGenerator(BaseTestGenerator):
+
+   def generate_tests(self):
+       return []
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_add.py
new file mode 100644
index 0000000..6b09c42
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_add.py
@@ -0,0 +1,99 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+import pickle
+import os
+
+
+class DomainAddTestCase(LoginTestCase):
+    """ This class will add new domain under schema node. """
+
+    priority = 52
+
+    scenarios = [
+        # Fetching default URL for domain node.
+        ('Fecth domain Node URL', dict(url='/browser/domain/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add domain under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            data = \
+                {
+                    "basensp": config_data['test_domain_data']
+                                          ['test_schema'],
+                    "basetype": config_data['test_domain_data']
+                                           ['test_basetype'],
+                    "collname": config_data['test_domain_data']
+                                           ['test_collation'],
+                    "constraints": config_data['test_domain_data']
+                                              ['test_constraints'],
+                    "is_tlength": config_data['test_domain_data']
+                                             ['test_lenght'],
+                    "max_val": config_data['test_domain_data']
+                                          ['test_max_value'],
+                    "min_val": config_data['test_domain_data']
+                                          ['test_min_value'],
+                    "name": config_data['test_domain_data']
+                                       ['test_name'],
+                    "owner": config_data['test_domain_data']
+                                        ['test_owner'],
+                    "seclabels": config_data['test_domain_data']
+                                            ['test_security'],
+                    "typdefault": config_data['test_domain_data']
+                                             ['test_defalt_type'],
+                    "typlen": config_data['test_domain_data']
+                                         ['test_type_len'],
+                }
+
+            response = self.tester.post(self.url + str(srv_grp) + '/' +
+                                        str(server_id) + '/' + str(db_id) +
+                                        '/' + str(schema_id) + '/',
+                                        data=json.dumps(data),
+                                        content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            domain_id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl'):
+                exst_server_id = open('/home/edb/Downloads/pgadmin4/web/'
+                                      'regression/''parent_id.pkl', 'rb')
+                all_id = pickle.load(exst_server_id)
+                pickle_id_dict = all_id
+
+            pickle_id_dict["doid"].append(domain_id)
+
+            domain_output = open('/home/edb/Downloads/pgadmin4/web/regression/'
+                                 'parent_id.pkl', 'wb')
+            pickle.dump(pickle_id_dict, domain_output)
+            domain_output.close()
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_delete.py
new file mode 100644
index 0000000..f19a270
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_delete.py
@@ -0,0 +1,62 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class DomainDeleteTestCase(LoginTestCase):
+    """ This class will delete new domain under schema node. """
+
+    priority = 55
+
+    scenarios = [
+        # Fetching default URL for domain node.
+        ('Fecth domain Node URL', dict(url='/browser/domain/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will delete domain under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        domain_id= all_id["doid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) == 0:
+                  raise Exception("No schema(s) to delete!!!")
+
+            del_response = self.tester.delete(self.url + str(srv_grp) + '/' +
+                                              str(server_id) + '/' +
+                                              str(db_id) + '/' +
+                                              str(schema_id) + '/' +
+                                              str(domain_id),
+                                              follow_redirects=True)
+
+            del_respdata = json.loads(del_response.data.decode())
+
+            self.assertTrue(del_respdata['success'], 1)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_get.py
new file mode 100644
index 0000000..82b55d0
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_get.py
@@ -0,0 +1,59 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class DomainGetTestCase(LoginTestCase):
+    """ This class will fetch new collation under schema node. """
+
+    priority = 53
+
+    scenarios = [
+        # Fetching default URL for domain node.
+        ('Fecth domain Node URL', dict(url='/browser/domain/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add domain under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        domain_id= all_id["doid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) != 0:
+
+                get_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(domain_id),
+                                               content_type='html/json')
+
+                self.assertEquals(response.status_code, 200)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_put.py
new file mode 100644
index 0000000..0d7deea
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_put.py
@@ -0,0 +1,66 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class DomainPutTestCase(LoginTestCase):
+    """ This class will fetch new collation under schema node. """
+
+    priority = 54
+
+    scenarios = [
+        # Fetching default URL for domain node.
+        ('Fecth domain Node URL', dict(url='/browser/domain/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will update domain under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        domain_id= all_id["doid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) != 0:
+                data = \
+                      {
+                          "description": config_data['test_domain_update_data']
+                                                    ['test_comment'],
+                          "id": domain_id,
+                      }
+
+            put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                           str(server_id) + '/' +
+                                           str(db_id) + '/' +
+                                           str(schema_id) + '/' +
+                                           str(domain_id),
+                                           data=json.dumps(data),
+                                           follow_redirects=True)
+
+            self.assertEquals(put_response.status_code, 200)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/__init__.py
new file mode 100644
index 0000000..22a4063
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/__init__.py
@@ -0,0 +1,16 @@
+##########################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##########################################################################
+
+from pgadmin.utils.route import BaseTestGenerator
+
+
+class ForeignTableTestGenerator(BaseTestGenerator):
+
+    def generate_tests(self):
+        return []
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_add.py
new file mode 100644
index 0000000..fff47ab
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_add.py
@@ -0,0 +1,102 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+import pickle
+import os
+
+
+class ForeignTableAddTestCase(LoginTestCase):
+    """ This class will add new foreign table under schema node. """
+
+    priority = 78
+
+    scenarios = [
+        # Fetching default URL for table node.
+        ('Fecth table Node URL', dict(url='/browser/foreign-table/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add table under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema
+            response = self.tester.get('/browser/schema/obj/{0}/{1}/{2}/'
+                                       '{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) == 0:
+                raise Exception("No schema(s) available!!!")
+
+            data = \
+                {
+                    "acl": config_data['test_foreign_table_credentials']
+                                      ['test_acl'],
+                    "basensp": config_data['test_foreign_table_credentials']
+                                          ['test_schema_name'],
+                    "columns": config_data['test_foreign_table_credentials']
+                                          ['test_column'],
+                    "constraints": config_data['test_foreign_table_credentials']
+                                              ['test_constraints'],
+                    "ftoptions": config_data['test_foreign_table_credentials']
+                                            ['test_options'],
+                    "ftsrvname": config_data['test_foreign_table_credentials']
+                                            ['test_frs_name'],
+                    "name": config_data['test_foreign_table_credentials']
+                                       ['test_name'],
+                    "owner": config_data['test_foreign_table_credentials']
+                                        ['test_owner'],
+                    "relacl": config_data['test_foreign_table_credentials']
+                                         ['test_rel_acl'],
+                    "seclabels": config_data['test_foreign_table_credentials']
+                                            ['test_sec_lable'],
+                    "stracl": config_data['test_foreign_table_credentials']
+                                         ['test_str_acl']
+                }
+
+            response = self.tester.post(self.url + str(srv_grp) + '/' +
+                                        str(server_id) + '/' + str(db_id) +
+                                        '/' + str(schema_id) + '/',
+                                        data=json.dumps(data),
+                                        content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            ft_id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl'):
+                exst_server_id = open('/home/edb/Downloads/pgadmin4/web'
+                                      '/regression/''parent_id.pkl', 'rb')
+                all_id = pickle.load(exst_server_id)
+                pickle_id_dict = all_id
+
+            pickle_id_dict["foid"].append(ft_id)
+
+            ft_output = open('/home/edb/Downloads/pgadmin4/web/regression/'
+                             'parent_id.pkl', 'wb')
+            pickle.dump(pickle_id_dict, ft_output)
+            ft_output.close()
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_delete.py
new file mode 100644
index 0000000..c9f28e9
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_delete.py
@@ -0,0 +1,76 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+import pickle
+import os
+
+
+class ForeignTableDeleteTestCase(LoginTestCase):
+    """ This class will delete the added foreign table under schema node. """
+
+    priority = 81
+
+    scenarios = [
+        # Fetching default URL for table node.
+        ('Fecth table Node URL', dict(url='/browser/foreign-table/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will delete table under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        ft_id = all_id["foid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) == 0:
+                raise Exception("No schema(s) available!!!")
+
+            get_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                           str(server_id) + '/' + str(db_id) +
+                                           '/' + str(schema_id) + '/' +
+                                           str(ft_id),
+                                           content_type='html/json')
+
+            respdata = json.loads(get_response.data.decode())
+
+            if len(respdata) == 0:
+                raise Exception("No foreign table(s) available!!!")
+
+            delete_response = self.tester.delete(self.url + str(srv_grp) +
+                                                 '/' + str(server_id) + '/' +
+                                                 str(db_id) + '/' +
+                                                 str(schema_id) + '/' +
+                                                 str(ft_id),
+                                                 follow_redirects=True)
+
+            self.assertEquals(delete_response.status_code, 200)
+
+
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_get.py
new file mode 100644
index 0000000..2fe269e
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_get.py
@@ -0,0 +1,61 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+import pickle
+import os
+
+
+class ForeignTableGetTestCase(LoginTestCase):
+    """ This class will add new foreign table under schema node. """
+
+    priority = 79
+
+    scenarios = [
+        # Fetching default URL for table node.
+        ('Fecth table Node URL', dict(url='/browser/foreign-table/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add table under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        ft_id = all_id["foid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) == 0:
+                raise Exception("No schema(s) available!!!")
+
+            get_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                           str(server_id) + '/' + str(db_id) +
+                                           '/' + str(schema_id) + '/' +
+                                           str(ft_id), content_type='html/json')
+
+            self.assertEquals(get_response.status_code, 200)
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_put.py
new file mode 100644
index 0000000..77df464
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_put.py
@@ -0,0 +1,81 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class ForeignTablePutTestCase(LoginTestCase):
+    """ This class will update added foreign table under schema node. """
+
+    priority = 80
+
+    scenarios = [
+        # Fetching default URL for foreign table node.
+        ('Fecth table Node URL', dict(url='/browser/foreign-table/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will update foreign  under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        ft_id = all_id["foid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) == 0:
+                raise Exception("No schema(s) available!!!")
+
+            get_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                           str(server_id) + '/' + str(db_id) +
+                                           '/' + str(schema_id) + '/' +
+                                           str(ft_id), content_type='html/json')
+
+            respdata = json.loads(get_response.data.decode())
+
+            if len(respdata) == 0:
+                raise Exception("No foreign table(s) available!!!")
+
+            data = \
+                {
+                    "description": config_data['test_FT_update_data']
+                                    ['test_comment'],
+                    "id": ft_id,
+                }
+
+            put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                           str(server_id) + '/' +
+                                           str(db_id) + '/' +
+                                           str(schema_id) + '/' +
+                                           str(ft_id),
+                                           data=json.dumps(data),
+                                           follow_redirects=True)
+
+            self.assertEquals(put_response.status_code, 200)
+
+
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/__init__.py
new file mode 100644
index 0000000..03bf3f6
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/__init__.py
@@ -0,0 +1,16 @@
+##########################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##########################################################################
+
+from pgadmin.utils.route import BaseTestGenerator
+
+
+class TriggerFunctionTestGenerator(BaseTestGenerator):
+
+   def generate_tests(self):
+       return []
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_add.py
new file mode 100644
index 0000000..713bd23
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_add.py
@@ -0,0 +1,112 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+import pickle
+import os
+
+
+class TriggerFuncAddTestCase(LoginTestCase):
+    """ This class will add new trigger function under schema node. """
+
+    priority = 36
+
+    scenarios = [
+        # Fetching default URL for trigger function node.
+        ('Fecth Trigger Function Node URL',
+         dict(url='/browser/trigger_function/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add trigger function under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            response = self.tester.get('/browser/schema/obj/' + str(srv_grp) +
+                                       '/' + str(server_id) + '/' +
+                                       str(db_id) + '/' + str(schema_id),
+                                       content_type='html/json')
+
+            data = \
+                {
+                    "acl": config_data
+                    ['test_trigger_function_credentials']['test_acl'],
+                    "arguments": config_data
+                    ['test_trigger_function_credentials']['test_args'],
+                    "funcowner": config_data
+                    ['test_trigger_function_credentials']['test_fun_owner'],
+                    "lanname": config_data
+                    ['test_trigger_function_credentials']['test_language'],
+                    "name": config_data
+                    ['test_trigger_function_credentials']['test_name'],
+                    "options": config_data
+                    ['test_trigger_function_credentials']['test_options'],
+                    "probin": config_data
+                    ['test_trigger_function_credentials']['test_probe'],
+                    "proleakproof": config_data
+                    ['test_trigger_function_credentials']['test_leak_proof'],
+                    "pronamespace": config_data
+                    ['test_trigger_function_credentials']['test_namespace'],
+                    "prorettypename": config_data
+                    ['test_trigger_function_credentials']['test_type'],
+                    "prosecdef": config_data
+                    ['test_trigger_function_credentials']['test_sec_def'],
+                    "prosrc": config_data
+                    ['test_trigger_function_credentials']['test_code'],
+                    "provolatile": config_data
+                    ['test_trigger_function_credentials']['test_volitile'],
+                    "seclabels": config_data
+                    ['test_trigger_function_credentials']['test_sec_label'],
+                    "variables": config_data
+                    ['test_trigger_function_credentials']['test_Variable']
+                }
+
+            if schema_id:
+                data['pronamespace'] = schema_id
+            else:
+                schema_id = data['pronamespace']
+
+            response = self.tester.post(self.url + str(srv_grp) + '/' +
+                                        str(server_id) + '/' + str(db_id) +
+                                        '/' + str(schema_id) + '/',
+                                        data=json.dumps(data),
+                                        content_type='html/json')
+
+            self.assertTrue(response.status_code, 200)
+
+            respdata = json.loads(response.data.decode())
+
+            trg_func__id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/'
+                              'regression/parent_id.pkl'):
+                exst_server_id = open('/home/edb/Downloads/pgadmin4/web'
+                                      '/regression/''parent_id.pkl', 'rb')
+                all_id = pickle.load(exst_server_id)
+                pickle_id_dict = all_id
+
+            pickle_id_dict["tfnid"].append(trg_func__id)
+
+            extension_output = open('/home/edb/Downloads/pgadmin4/web/'
+                                    'regression/parent_id.pkl', 'wb')
+            pickle.dump(pickle_id_dict, extension_output)
+            extension_output.close()
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_delete.py
new file mode 100644
index 0000000..46d0859
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_delete.py
@@ -0,0 +1,63 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class TriggerFuncDeleteTestCase(LoginTestCase):
+    """ This class will add new trigger function under schema node. """
+
+    priority = 43
+
+    scenarios = [
+        # Fetching default URL for trigger function node.
+        ('Fetch Trigger Function Node URL',
+         dict(url='/browser/trigger_function/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will delete trigger function under database node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        trg_func__id = all_id["tfnid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) == 0:
+                 raise Exception("No schema(s) to delete!!!")
+
+            del_response = self.tester.delete(self.url + str(srv_grp) + '/' +
+                                              str(server_id) + '/' +
+                                              str(db_id) + '/' +
+                                              str(schema_id) + '/' +
+                                              str(trg_func__id),
+                                              follow_redirects=True)
+
+            del_respdata = json.loads(del_response.data.decode())
+
+            self.assertTrue(del_respdata['success'], 1)
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_get.py
new file mode 100644
index 0000000..ab05fe0
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_get.py
@@ -0,0 +1,61 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class TriggerFuncGetTestCase(LoginTestCase):
+    """ This class will fetch added trigger function under schema node. """
+
+    priority = 37
+
+    scenarios = [
+        # Fetching default URL for trigger function node.
+        ('Fetch Trigger Function Node URL',
+         dict(url='/browser/trigger_function/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will fetch trigger function under database node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        trg_func__id = all_id["tfnid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) != 0:
+
+                get_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(trg_func__id),
+                                               content_type='html/json')
+
+                self.assertEquals(response.status_code, 200)
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_put.py
new file mode 100644
index 0000000..a6431d7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_put.py
@@ -0,0 +1,69 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class TriggerFuncPutTestCase(LoginTestCase):
+    """ This class will update new trigger function under schema node. """
+
+    priority = 38
+
+    scenarios = [
+        # Fetching default URL for trigger function node.
+        ('Fecth Trigger Function Node URL',
+         dict(url='/browser/trigger_function/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will update trigger function under database node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        trg_func__id = all_id["tfnid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) != 0:
+
+                data = \
+                    {
+                        "description": config_data
+                        ['test_trigger_func_update_data']['test_comment'],
+                        "id": trg_func__id
+                    }
+
+                put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(trg_func__id),
+                                               data=json.dumps(data),
+                                               follow_redirects=True)
+
+                self.assertEquals(put_response.status_code, 200)
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/__init__.py
new file mode 100644
index 0000000..ff11e3e
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/__init__.py
@@ -0,0 +1,16 @@
+##########################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##########################################################################
+
+from pgadmin.utils.route import BaseTestGenerator
+
+
+class SequenceTestGenerator(BaseTestGenerator):
+
+   def generate_tests(self):
+       return []
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_add.py
new file mode 100644
index 0000000..5cb7413
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_add.py
@@ -0,0 +1,97 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+import pickle
+import os
+
+
+class SequenceAddTestCase(LoginTestCase):
+    """ This class will add new collation under schema node. """
+
+    priority = 56
+
+    scenarios = [
+        # Fetching default URL for sequence node.
+        ('Fetch sequence Node URL', dict(url='/browser/sequence/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add sequence under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            data = \
+                {
+                    "cache": config_data['test_sequence_credentials']
+                                        ['test_cache'],
+                    "cycled": config_data['test_sequence_credentials']
+                                         ['test_cycled'],
+                    "increment": config_data['test_sequence_credentials']
+                                            ['test_increment'],
+                    "maximum": config_data['test_sequence_credentials']
+                                          ['test_max_value'],
+                    "minimum": config_data['test_sequence_credentials']
+                                          ['test_min_value'],
+                    "name": config_data['test_sequence_credentials']
+                                       ['test_name'],
+                    "relacl": config_data['test_sequence_credentials']
+                                         ['test_acl'],
+                    "schema": config_data['test_sequence_credentials']
+                                         ['test_schema_name'],
+                    "securities": config_data['test_sequence_credentials']
+                                             ['test_security'],
+                    "seqowner": config_data['test_sequence_credentials']
+                                           ['test_owner'],
+                    "start": config_data['test_sequence_credentials']
+                                        ['test_start_val']
+                }
+
+            response = self.tester.post(self.url + str(srv_grp) + '/' +
+                                        str(server_id) + '/' + str(db_id) +
+                                        '/' + str(schema_id) + '/',
+                                        data=json.dumps(data),
+                                        content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            sequence_id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl'):
+                exst_server_id = open('/home/edb/Downloads/pgadmin4/web'
+                                      '/regression/''parent_id.pkl', 'rb')
+                all_id = pickle.load(exst_server_id)
+                pickle_id_dict = all_id
+
+            pickle_id_dict["seid"].append(sequence_id)
+
+            sequence_output = open('/home/edb/Downloads/pgadmin4/web/'
+                                   'regression/parent_id.pkl', 'wb')
+            pickle.dump(pickle_id_dict, sequence_output)
+            sequence_output.close()
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_delete.py
new file mode 100644
index 0000000..f708a2b
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_delete.py
@@ -0,0 +1,73 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class SequenceDeleteTestCase(LoginTestCase):
+    """ This class will delete added sequence node under schema node. """
+
+    priority = 59
+
+    scenarios = [
+        # Fetching default URL for sequence node.
+        ('Fecth sequence Node URL', dict(url='/browser/sequence/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will delete added sequence under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        sequence_id = all_id["seid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) != 0:
+
+                get_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(sequence_id),
+                                               content_type='html/json')
+
+                get_respdata = json.loads(get_response.data.decode())
+
+                if len(get_respdata) == 0:
+                    raise Exception("No sequence node to delete!")
+
+                del_response = self.tester.delete(self.url + str(srv_grp) +
+                                                  '/' + str(server_id) + '/' +
+                                                  str(db_id) + '/' +
+                                                  str(schema_id) + '/' +
+                                                  str(sequence_id),
+                                                  follow_redirects=True)
+
+                del_respdata = json.loads(del_response.data.decode())
+
+                self.assertTrue(del_respdata['success'], 1)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_get.py
new file mode 100644
index 0000000..15c064e
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_get.py
@@ -0,0 +1,59 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class SequenceGetTestCase(LoginTestCase):
+    """ This class will add new collation under schema node. """
+
+    priority = 57
+
+    scenarios = [
+        # Fetching default URL for sequence node.
+        ('Fetch sequence Node URL', dict(url='/browser/sequence/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will fetch added sequence under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        sequence_id = all_id["seid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) != 0:
+
+                get_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(sequence_id),
+                                               content_type='html/json')
+
+                self.assertEquals(response.status_code, 200)
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_put.py
new file mode 100644
index 0000000..e786130
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_put.py
@@ -0,0 +1,80 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class SequenceUpdateTestCase(LoginTestCase):
+    """ This class will update new sequence node under schema node. """
+
+    priority = 58
+
+    scenarios = [
+        # Fetching default URL for sequence node.
+        ('Fetch sequence Node URL', dict(url='/browser/sequence/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will update added sequence under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        sequence_id = all_id["seid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) != 0:
+
+                get_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(sequence_id),
+                                               content_type='html/json')
+
+                get_respdata = json.loads(get_response.data.decode())
+
+                if len(get_respdata) == 0:
+                    raise Exception("No sequence node to update!")
+
+                data =\
+                    {
+                        "comment": config_data['test_sequnce_update_data']
+                                              ['test_comment'],
+                        "id": sequence_id
+                    }
+
+                put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(sequence_id),
+                                               data=json.dumps(data),
+                                               follow_redirects=True)
+
+                self.assertEquals(put_response.status_code, 200)
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/__init__.py
new file mode 100644
index 0000000..2450edb
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/__init__.py
@@ -0,0 +1,16 @@
+##########################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##########################################################################
+
+from pgadmin.utils.route import BaseTestGenerator
+
+
+class TableTestGenerator(BaseTestGenerator):
+
+   def generate_tests(self):
+       return []
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_add.py
new file mode 100644
index 0000000..2f1c375
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_add.py
@@ -0,0 +1,116 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+import pickle
+import os
+
+
+class TableAddTestCase(LoginTestCase):
+    """ This class will add new collation under schema node. """
+
+    priority = 60
+
+    scenarios = [
+        # Fetching default URL for table node.
+        ('Fecth table Node URL', dict(url='/browser/table/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add table under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+            data = \
+                {
+                    "check_constraint": config_data
+                    ['test_table_credentials']['test_constraint'],
+                    "coll_inherits": config_data
+                    ['test_table_credentials']['test_col_inherit'],
+                    "columns": config_data
+                    ['test_table_credentials']['test_columns'],
+                    "exclude_constraint": config_data
+                    ['test_table_credentials']['test_has_constraint'],
+                    "fillfactor": config_data
+                    ['test_table_credentials']['test_fillfactor'],
+                    "foreign_key": config_data
+                    ['test_table_credentials']['test_has_FK'],
+                    "hastoasttable": config_data
+                    ['test_table_credentials']['test_has_toast_tbl'],
+                    "like_constraints": config_data
+                    ['test_table_credentials']['test_like_constraint'],
+                    "like_default_value": config_data
+                    ['test_table_credentials']['test_like_default_value'],
+                    "like_relation": config_data
+                    ['test_table_credentials']['test_like_relation'],
+                    "name": config_data
+                    ['test_table_credentials']['test_name'],
+                    "primary_key": config_data
+                    ['test_table_credentials']['test_PK'],
+                    "relacl": config_data
+                    ['test_table_credentials']['test_acl'],
+                    "relhasoids": config_data
+                    ['test_table_credentials']['test_has_oid'],
+                    "relowner": config_data
+                    ['test_table_credentials']['test_owner'],
+                    "schema": config_data
+                    ['test_table_credentials']['test_schema'],
+                    "seclabels": config_data
+                    ['test_table_credentials']['test_sec_acl'],
+                    "spcname": config_data
+                    ['test_table_credentials']['test_tbscp'],
+                    "unique_constraint": config_data
+                    ['test_table_credentials']['test_unique_constraint'],
+                    "vacuum_table": config_data
+                    ['test_table_credentials']['test_vacuum_tbl'],
+                    "vacuum_toast": config_data
+                    ['test_table_credentials']['test_vacuum_toast']
+                }
+
+            response = self.tester.post(self.url + str(srv_grp) + '/' +
+                                        str(server_id) + '/' + str(db_id) +
+                                        '/' + str(schema_id) + '/',
+                                        data=json.dumps(data),
+                                        content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            table_id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl'):
+                exst_server_id = open('/home/edb/Downloads/pgadmin4/web'
+                                      '/regression/''parent_id.pkl', 'rb')
+                all_id = pickle.load(exst_server_id)
+                pickle_id_dict = all_id
+
+            pickle_id_dict["tid"].append(table_id)
+
+            table_output = open('/home/edb/Downloads/pgadmin4/web/regression/'
+                                'parent_id.pkl', 'wb')
+            pickle.dump(pickle_id_dict, table_output)
+            table_output.close()
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_delete.py
new file mode 100644
index 0000000..4b8f345
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_delete.py
@@ -0,0 +1,73 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class TableDeleteTestCase(LoginTestCase):
+    """ This class will delete new table under schema node. """
+
+    priority = 97
+
+    scenarios = [
+        # Fetching default URL for table node.
+        ('Fecth table Node URL', dict(url='/browser/table/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will delete added table under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        table_id = all_id["tid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) != 0:
+
+                get_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(table_id),
+                                               content_type='html/json')
+
+                get_respdata = json.loads(get_response.data.decode())
+
+                if len(get_respdata) == 0:
+                    raise Exception("No Table to delete!")
+
+                del_response = self.tester.delete(self.url + str(srv_grp) +
+                                                  '/' + str(server_id) + '/' +
+                                                  str(db_id) + '/' +
+                                                  str(schema_id) + '/' +
+                                                  str(table_id),
+                                                  follow_redirects=True)
+
+                del_respdata = json.loads(del_response.data.decode())
+
+                self.assertTrue(del_respdata['success'], 1)
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_get.py
new file mode 100644
index 0000000..a98a3d3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_get.py
@@ -0,0 +1,59 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class TableGetTestCase(LoginTestCase):
+    """ This class will add new collation under schema node. """
+
+    priority = 61
+
+    scenarios = [
+        # Fetching default URL for table node.
+        ('Fecth table Node URL', dict(url='/browser/table/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will fetch added table under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        table_id = all_id["tid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) != 0:
+
+                get_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(table_id),
+                                               content_type='html/json')
+
+                self.assertEquals(response.status_code, 200)
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_put.py
new file mode 100644
index 0000000..867bb52
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_put.py
@@ -0,0 +1,79 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class TableUpdateTestCase(LoginTestCase):
+    """ This class will add new collation under schema node. """
+
+    priority = 62
+
+    scenarios = [
+        # Fetching default URL for table node.
+        ('Fecth table Node URL', dict(url='/browser/table/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will fetch added table under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        table_id = all_id["tid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) != 0:
+
+                get_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(table_id),
+                                               content_type='html/json')
+
+                get_respdata = json.loads(get_response.data.decode())
+
+                if len(get_respdata) == 0:
+                    raise Exception ("No Table to update!")
+
+                data =\
+                    {
+                        "description": config_data['test_table_update_data']
+                                              ['test_comment'],
+                        "id": table_id
+                    }
+
+                put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(table_id),
+                                               data=json.dumps(data),
+                                               follow_redirects=True)
+
+                self.assertEquals(put_response.status_code, 200)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/__init__.py
new file mode 100644
index 0000000..3403f4f
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/__init__.py
@@ -0,0 +1,16 @@
+##########################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##########################################################################
+
+from pgadmin.utils.route import BaseTestGenerator
+
+
+class SchemaTestGenerator(BaseTestGenerator):
+
+   def generate_tests(self):
+       return []
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_add.py
new file mode 100644
index 0000000..703983b
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_add.py
@@ -0,0 +1,90 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+import pickle
+import os
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+
+
+class SchemaAddTestCase(LoginTestCase):
+    """ This class will add new schema under database node. """
+
+    priority = 23
+
+    scenarios = [
+        # Fetching default URL for schema node.
+        ('Check Schema Node URL', dict(url='/browser/schema/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add schema under database node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            data =\
+            {
+                "deffuncacl": config_data['test_schema_credentials']
+                                              ['test_func_acl'],
+                "defseqacl": config_data['test_schema_credentials']
+                                              ['test_seq_acl'],
+                "deftblacl": config_data['test_schema_credentials']
+                                              ['test_tbl_acl'],
+                "deftypeacl": config_data['test_schema_credentials']
+                                              ['test_type_acl'],
+                "name": config_data['test_schema_credentials']
+                                              ['test_name'],
+                "namespaceowner": config_data['test_schema_credentials']
+                                              ['test_owner'],
+                "nspacl": config_data['test_schema_credentials']
+                                              ['test_privilege'],
+                "seclabels": config_data['test_schema_credentials']
+                                              ['test_sec_label']
+            }
+
+            response = self.tester.post(self.url + str(srv_grp) + '/' +
+                                        str(server_id) + '/' + str(db_id) +
+                                        '/', data=json.dumps(data),
+                                        content_type='html/json')
+
+            self.assertTrue(response.status_code, 200)
+
+            respdata = json.loads(response.data.decode())
+
+            schema_id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl'):
+                exst_server_id = open('/home/edb/Downloads/pgadmin4/web'
+                                      '/regression/''parent_id.pkl', 'rb')
+                all_id = pickle.load(exst_server_id)
+                pickle_id_dict = all_id
+
+            pickle_id_dict["scid"].append(schema_id)
+
+            schema_output = open('/home/edb/Downloads/pgadmin4/web/regression/'
+                                 'parent_id.pkl', 'wb')
+            pickle.dump(pickle_id_dict, schema_output)
+            schema_output.close()
+
+
+
+
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_delete.py
new file mode 100644
index 0000000..7f6cd73
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_delete.py
@@ -0,0 +1,59 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class SchemaDeleteTestCase(LoginTestCase):
+    """ This class will add new schema under database node. """
+
+    priority = 98
+
+    scenarios = [
+        # Fetching default URL for extension node.
+        ('Check Schema Node URL', dict(url='/browser/schema/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will delete schema under database node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id) +
+                                       '/' + str(schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) == 0:
+                raise Exception("No schema(s) to delete!!!")
+
+            del_response = self.tester.delete(self.url + str(srv_grp) + '/' +
+                                              str(server_id) + '/' +
+                                              str(db_id) + '/' +
+                                              str(schema_id),
+                                              follow_redirects=True)
+
+            del_respdata = json.loads(del_response.data.decode())
+
+            self.assertTrue(del_respdata['success'], 1)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_get.py
new file mode 100644
index 0000000..f712f50
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_get.py
@@ -0,0 +1,44 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+
+
+class SchemaGetTestCase(LoginTestCase):
+    """ This class will add new schema under database node. """
+
+    priority = 34
+
+    scenarios = [
+        # Fetching default URL for extension node.
+        ('Check Schema Node URL', dict(url='/browser/schema/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will fetch schema under database node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id) +
+                                       '/' + str(schema_id),
+                                       content_type='html/json')
+
+            self.assertEquals(response.status_code, 200)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_put.py
new file mode 100644
index 0000000..603c058
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_put.py
@@ -0,0 +1,60 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class SchemaPutTestCase(LoginTestCase):
+    """ This class will add new schema under database node. """
+
+    priority = 35
+
+    scenarios = [
+        # Fetching default URL for schema node.
+        ('Check Schema Node URL', dict(url='/browser/schema/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will update schema under database node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            data =\
+                {
+                    "deffuncacl": config_data["test_schema_update_data"]
+                                             ["test_func_acl"],
+                    "defseqacl": config_data["test_schema_update_data"]
+                                            ["test_seq_acl"],
+                    "deftblacl": config_data["test_schema_update_data"]
+                                            ["test_tbl_acl"],
+                    "id": schema_id
+                }
+
+            put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                           str(server_id) + '/' + str(db_id) +
+                                           '/' + str(schema_id),
+                                           data=json.dumps(data),
+                                           follow_redirects=True)
+
+            self.assertEquals(put_response.status_code, 200)
+            respdata = json.loads(put_response.data.decode())
+            self.assertTrue(respdata['success'], 1)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/__init__.py
new file mode 100644
index 0000000..138c249
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/__init__.py
@@ -0,0 +1,16 @@
+##########################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##########################################################################
+
+from pgadmin.utils.route import BaseTestGenerator
+
+
+class ViewTestGenerator(BaseTestGenerator):
+
+   def generate_tests(self):
+       return []
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_mview_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_mview_add.py
new file mode 100644
index 0000000..bee41c9
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_mview_add.py
@@ -0,0 +1,102 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+import pickle
+import os
+
+
+class MViewAddTestCase(LoginTestCase):
+    """ This class will add new view under schema node. """
+
+    priority = 67
+
+    scenarios = [
+        # Fetching default URL for materialized view node.
+        ('Fecth materialized view Node URL', dict(url='/browser/mview/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add materialized view under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            data = \
+                {
+                    "datacl": config_data
+                    ['test_mview_credentials']['test_acl'],
+                    "definition": config_data
+                    ['test_mview_credentials']['test_definition'],
+                    "fillfactor": config_data
+                    ['test_mview_credentials']['test_fillfactor'],
+                    "name": config_data
+                    ['test_mview_credentials']['test_name'],
+                    "owner": config_data
+                    ['test_mview_credentials']['test_owner'],
+                    "schema": config_data
+                    ['test_mview_credentials']['test_schema_name'],
+                    "seclabels": config_data
+                    ['test_mview_credentials']['test_sec_label'],
+                    "spcname": config_data
+                    ['test_mview_credentials']['test_tbscp'],
+                    "toast_autovacuum": config_data
+                    ['test_mview_credentials']['test_toast_autovacuum'],
+                    "toast_autovacuum_enabled": config_data
+                    ['test_mview_credentials']['test_toast_autovacuum_enabled'],
+                    "vacuum_table": config_data
+                    ['test_mview_credentials']['test_vacuum_tbl'],
+                    "vacuum_toast": config_data
+                    ['test_mview_credentials']['test_vacuum_toast'],
+                    "with_data": config_data
+                    ['test_mview_credentials']['test_with_data']
+
+                }
+
+            response = self.tester.post(self.url + str(srv_grp) + '/' +
+                                        str(server_id) + '/' + str(db_id) +
+                                        '/' + str(schema_id) + '/',
+                                        data=json.dumps(data),
+                                        content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            mview_id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl'):
+                exst_server_id = open('/home/edb/Downloads/pgadmin4/web'
+                                       '/regression/''parent_id.pkl', 'rb')
+                all_id = pickle.load(exst_server_id)
+                pickle_id_dict = all_id
+
+            pickle_id_dict["mvid"].append(mview_id)
+
+            mview_output = open('/home/edb/Downloads/pgadmin4/web/regression/'
+                                'parent_id.pkl', 'wb')
+            pickle.dump(pickle_id_dict, mview_output)
+            mview_output.close()
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_mview_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_mview_delete.py
new file mode 100644
index 0000000..96371c7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_mview_delete.py
@@ -0,0 +1,75 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+import pickle
+import os
+
+
+class MViewDeleteTestCase(LoginTestCase):
+    """ This class will delete new materialized view under schema node. """
+
+    priority = 70
+
+    scenarios = [
+        # Fetching default URL for materialized view node.
+        ('Fetch materialized view Node URL', dict(url='/browser/mview/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add materialized view under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        mview_id = all_id["mvid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) != 0:
+
+                get_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(mview_id),
+                                               content_type='html/json')
+
+                get_respdata = json.loads(get_response.data.decode())
+
+                if len(get_respdata) == 0:
+                    raise Exception("No view node to delete!")
+
+                del_response = self.tester.delete(self.url + str(srv_grp) +
+                                                  '/' + str(server_id) + '/' +
+                                                  str(db_id) + '/' +
+                                                  str(schema_id) + '/' +
+                                                  str(mview_id),
+                                                  follow_redirects=True)
+
+                del_respdata = json.loads(del_response.data.decode())
+
+                self.assertTrue(del_respdata['success'], 1)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_mview_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_mview_get.py
new file mode 100644
index 0000000..a9ee00c
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_mview_get.py
@@ -0,0 +1,60 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class MViewGetTestCase(LoginTestCase):
+    """ This class will fetch new materialized view under schema node. """
+
+    priority = 68
+
+    scenarios = [
+        # Fetching default URL for materialized view node.
+        ('Fetch materialized view Node URL', dict(url='/browser/mview/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add materialized view under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        mview_id = all_id["mvid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj'
+                                       '/{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) != 0:
+
+                get_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(mview_id),
+                                               content_type='html/json')
+
+                self.assertEquals(response.status_code, 200)
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_mview_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_mview_put.py
new file mode 100644
index 0000000..6a42037
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_mview_put.py
@@ -0,0 +1,80 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+
+
+class MViewPutTestCase(LoginTestCase):
+    """ This class will fetch new materialized view under schema node. """
+
+    priority = 69
+
+    scenarios = [
+        # Fetching default URL for materialized view node.
+        ('Fetch materialized view Node URL', dict(url='/browser/mview/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add materialized view under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        mview_id = all_id["mvid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) != 0:
+
+                get_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(mview_id),
+                                               content_type='html/json')
+
+                get_respdata = json.loads(get_response.data.decode())
+
+                if len(get_respdata) == 0:
+                    raise Exception ("No view to update!")
+
+                data =\
+                    {
+                        "comment": config_data['test_view_update_data']
+                                              ['test_comment'],
+                        "id": mview_id
+                    }
+
+                put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(mview_id),
+                                               data=json.dumps(data),
+                                               follow_redirects=True)
+
+                self.assertEquals(put_response.status_code, 200)
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_view_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_view_add.py
new file mode 100644
index 0000000..0b8da89
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_view_add.py
@@ -0,0 +1,89 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+import pickle
+import os
+
+
+class ViewAddTestCase(LoginTestCase):
+    """ This class will add new view under schema node. """
+
+    priority = 63
+
+    scenarios = [
+        # Fetching default URL for view node.
+        ('Fecth view Node URL', dict(url='/browser/view/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add view under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            data = \
+                {
+                    "check_option": config_data
+                    ['test_view_credentials']['test_check_options'],
+                    "datacl": config_data
+                    ['test_view_credentials']['test_acl'],
+                    "definition": config_data
+                    ['test_view_credentials']['test_definition'],
+                    "name": config_data
+                    ['test_view_credentials']['test_name'],
+                    "owner": config_data
+                    ['test_view_credentials']['test_owner'],
+                    "schema": config_data
+                    ['test_view_credentials']['test_schema_name'],
+                    "seclabels": config_data
+                    ['test_view_credentials']['test_sec_label']
+                }
+
+            response = self.tester.post(self.url + str(srv_grp) + '/' +
+                                        str(server_id) + '/' + str(db_id) +
+                                        '/' + str(schema_id) + '/',
+                                        data=json.dumps(data),
+                                        content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            view_id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl'):
+                exst_server_id = open('/home/edb/Downloads/pgadmin4/web/'
+                                      'regression/parent_id.pkl', 'rb')
+                all_id = pickle.load(exst_server_id)
+                pickle_id_dict = all_id
+
+            pickle_id_dict["vid"].append(view_id)
+
+            view_output = open('/home/edb/Downloads/pgadmin4/web/regression/'
+                               'parent_id.pkl', 'wb')
+            pickle.dump(pickle_id_dict, view_output)
+            view_output.close()
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_view_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_view_delete.py
new file mode 100644
index 0000000..4cf8023
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_view_delete.py
@@ -0,0 +1,77 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+import pickle
+import os
+
+
+class ViewDeleteTestCase(LoginTestCase):
+    """ This class will update new view under schema node. """
+
+    priority = 66
+
+    scenarios = [
+        # Fetching default URL for view node.
+        ('Fecth view Node URL', dict(url='/browser/view/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will delete view under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        view_id = all_id["vid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) != 0:
+
+                get_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(view_id),
+                                               content_type='html/json')
+
+                get_respdata = json.loads(get_response.data.decode())
+
+                if len(get_respdata) == 0:
+                    raise Exception("No view node to delete!")
+
+                del_response = self.tester.delete(self.url + str(srv_grp) +
+                                                  '/' + str(server_id) + '/' +
+                                                  str(db_id) + '/' +
+                                                  str(schema_id) + '/' +
+                                                  str(view_id),
+                                                  follow_redirects=True)
+
+                del_respdata = json.loads(del_response.data.decode())
+
+                self.assertTrue(del_respdata['success'], 1)
+
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_view_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_view_get.py
new file mode 100644
index 0000000..ee597ab
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_view_get.py
@@ -0,0 +1,61 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+import pickle
+import os
+
+
+class ViewGetTestCase(LoginTestCase):
+    """ This class will fetch new view under schema node. """
+
+    priority = 64
+
+    scenarios = [
+        # Fetching default URL for view node.
+        ('Fetch view Node URL', dict(url='/browser/view/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add view under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        view_id = all_id["vid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) != 0:
+
+                get_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(view_id),
+                                               content_type='html/json')
+
+                self.assertEquals(response.status_code, 200)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_view_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_view_put.py
new file mode 100644
index 0000000..a838fce
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_view_put.py
@@ -0,0 +1,81 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+import json
+import pickle
+import os
+
+
+class ViewPutTestCase(LoginTestCase):
+    """ This class will update new view under schema node. """
+
+    priority = 65
+
+    scenarios = [
+        # Fetching default URL for view node.
+        ('Fecth view Node URL', dict(url='/browser/view/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will update view under schema node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        schema_id = all_id["scid"][0]
+        view_id = all_id["vid"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            # Get schema id
+            response = self.tester.get('/browser/schema/obj/'
+                                       '{0}/{1}/{2}/{3}'.format
+                                       (srv_grp, server_id, db_id, schema_id),
+                                       content_type='html/json')
+
+            respdata = json.loads(response.data.decode())
+
+            if len(respdata) != 0:
+
+                get_response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(view_id),
+                                               content_type='html/json')
+
+                get_respdata = json.loads(get_response.data.decode())
+
+                if len(get_respdata) == 0:
+                    raise Exception ("No view to update!")
+
+                data =\
+                    {
+                        "comment": config_data['test_view_update_data']
+                                              ['test_comment'],
+                        "id": view_id
+                    }
+
+                put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                               str(server_id) + '/' +
+                                               str(db_id) + '/' +
+                                               str(schema_id) + '/' +
+                                               str(view_id),
+                                               data=json.dumps(data),
+                                               follow_redirects=True)
+
+                self.assertEquals(put_response.status_code, 200)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/tests/__init__.py
new file mode 100644
index 0000000..acada61
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/tests/__init__.py
@@ -0,0 +1,6 @@
+from pgadmin.utils.route import BaseTestGenerator
+
+class DBGeneratorTestCase(BaseTestGenerator):
+
+    def runTest(self):
+        return []
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_add.py b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_add.py
new file mode 100644
index 0000000..6e4c9ed
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_add.py
@@ -0,0 +1,101 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json, pickle, uuid, os
+from regression.test_utils import get_ids
+
+class DatabaseAddTestCase(LoginTestCase):
+    """
+    This class will check server group node present on the object browser's
+    tree node by response code.
+    """
+    priority = 8
+
+    scenarios = [
+        # Fetching default URL for database node.
+        ('Check Databases Node URL', dict(url='/browser/database/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add database under 1st server of tree node. """
+
+        srv_id = get_ids()
+
+        server_id = srv_id["sid"][0]
+        srv_grp = config_data['test_server_group']
+
+        response = self.tester.post('browser/server/connect/' + str(srv_grp) +
+                                    '/' + server_id,
+                                    data=dict(
+                                    password=config_data
+                                    ['test_server_credentials'][0]
+                                    ['test_db_password']),
+                                    follow_redirects=True)
+
+        self.assertEquals(response.status_code, 200)
+
+        srv_connect = json.loads(response.data.decode())
+
+        if srv_connect['data']['connected']:
+
+            data = {
+                     "datacl": config_data['test_add_database_data']
+                                          ['test_privileges_acl'],
+                     "datconnlimit": config_data['test_add_database_data']
+                                                ['test_conn_limit'],
+                     "datowner": config_data['test_add_database_data']
+                                            ['test_owner'],
+                     "deffuncacl": config_data['test_add_database_data']
+                                              ['test_fun_acl'],
+                     "defseqacl": config_data['test_add_database_data']
+                                             ['test_seq_acl'],
+                     "deftblacl": config_data['test_add_database_data']
+                                             ['test_tbl_acl'],
+                     "deftypeacl": config_data['test_add_database_data']
+                                              ['test_type_acl'],
+                     "encoding": config_data['test_add_database_data']
+                                            ['test_encoding'],
+                     "name": str(uuid.uuid4())[1:8],
+                     "privileges": config_data['test_add_database_data']
+                                              ['test_privileges'],
+                     "securities": config_data['test_add_database_data']
+                                              ['test_securities'],
+                     "variables": config_data['test_add_database_data']
+                                             ['test_variables']
+                    }
+
+            db_response = self.tester.post(self.url + str(srv_grp) + "/"
+                                            + server_id + "/",
+                                            data=json.dumps(data),
+                                            content_type='html/json')
+
+            self.assertTrue(db_response.status_code, 200)
+
+            respdata = json.loads(db_response.data.decode())
+
+            db_id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl'):
+
+                exst_server_id = open('/home/edb/Downloads/pgadmin4/web'
+                                      '/regression/''parent_id.pkl', 'rb')
+
+                tol_server_id = pickle.load(exst_server_id)
+                pickle_id_dict = tol_server_id
+
+                pickle_id_dict["did"].append(db_id)
+
+                db_output = open('/home/edb/Downloads/pgadmin4/web/regression/'
+                                 'parent_id.pkl', 'wb')
+                pickle.dump(pickle_id_dict, db_output)
+                db_output.close()
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_delete.py b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_delete.py
new file mode 100644
index 0000000..26c5574
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_delete.py
@@ -0,0 +1,47 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+from regression.test_nodes import test_getnodes
+from regression.test_utils import get_ids
+
+
+class DatabaseDeleteTestCase(LoginTestCase):
+    """ This class will delete the database under last added server. """
+
+    priority = 99
+
+    scenarios = [
+        # Fetching default URL for database node.
+        ('Check Databases Node URL', dict(url='/browser/database/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will delete the database."""
+
+        all_id = get_ids()
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if len(db_con) == 0:
+            raise Exception("No database(s) to delete!!!")
+
+        response = self.tester.delete(self.url + str(srv_grp) + '/' +
+                                      str(server_id) + '/' + str(db_id),
+                                      follow_redirects=True)
+
+        respdata = json.loads(response.data.decode())
+
+        self.assertTrue(respdata['success'], 1)
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_get.py b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_get.py
new file mode 100644
index 0000000..34a6778
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_get.py
@@ -0,0 +1,43 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_nodes import test_getnodes
+from regression.test_utils import get_ids
+
+
+class DatabasesGetTestCase(LoginTestCase):
+    """
+    This class will fetch database added under last added server.
+    """
+    priority = 9
+
+    scenarios = [
+        # Fetching default URL for database node.
+        ('Check Databases Node URL', dict(url='/browser/database/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will fetch added database. """
+
+        all_id = get_ids()
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con["info"] == "Database Connected.":
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id),
+                                       follow_redirects=True)
+
+            self.assertEquals(response.status_code, 200)
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_put.py b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_put.py
new file mode 100644
index 0000000..bb15e75
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_put.py
@@ -0,0 +1,49 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+
+
+class DatabasesUpdateTestCase(LoginTestCase):
+    """
+    This class will update the database under last added server.
+    """
+    priority = 10
+
+    scenarios = [
+        # Fetching default URL for database node.
+        ('Check Databases Node', dict(url='/browser/database/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will update the comments field of database."""
+
+        all_id = get_ids()
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+
+        test_getnodes(node=self)
+
+        srv_grp = config_data['test_server_group']
+
+        data = {"comments": config_data["test_db_update_data"]
+                                       ["test_comment"],
+                "id": db_id
+               }
+
+        put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id),
+                                       data=json.dumps(data),
+                                       follow_redirects=True)
+
+        self.assertEquals(put_response.status_code, 200)
diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/roles/tests/__init__.py
new file mode 100644
index 0000000..4a11bf8
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/roles/tests/__init__.py
@@ -0,0 +1,16 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from pgadmin.utils.route import BaseTestGenerator
+
+
+class RoleGeneratorTestCase(BaseTestGenerator):
+
+    def runTest(self):
+        return
diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_add.py b/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_add.py
new file mode 100644
index 0000000..6a2bb08
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_add.py
@@ -0,0 +1,92 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json, pickle, uuid, os
+from regression.test_utils import get_ids
+
+
+class LoginRoleAddTestCase(LoginTestCase):
+    """ This class will add login role node under added server. """
+
+    priority = 12
+
+    scenarios = [
+        # Fetching default URL for roles node.
+        ('Check Role Node', dict(url='/browser/role/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add new role under 1st server of tree node. """
+
+        srv_id = get_ids()
+
+        server_id = srv_id["sid"][0]
+
+        srv_grp = config_data['test_server_group']
+
+        response = self.tester.post('browser/server/connect/' + str(srv_grp) +
+                                    '/' + server_id,
+                                    data=dict(
+                                    password=config_data
+                                    ['test_server_credentials'][0]
+                                    ['test_db_password']),
+                                    follow_redirects=True)
+
+        srv_connect = json.loads(response.data.decode())
+
+        if srv_connect['data']['connected']:
+
+            data = {
+                    "rolcanlogin": config_data['test_lr_credentials']
+                                              ['test_can_login'],
+                    "rolconnlimit": config_data['test_lr_credentials']
+                                               ['test_conn_limit'],
+                    "rolcreaterole": config_data['test_lr_credentials']
+                                                ['test_create_role'],
+                    "rolinherit": config_data['test_lr_credentials']
+                                             ['test_role_inherit'],
+                    "rolmembership": config_data['test_lr_credentials']
+                                                ['test_role_membership'],
+                    "rolname": str(uuid.uuid4())[1:8],
+                    "rolpassword": config_data['test_lr_credentials']
+                                              ['test_lr_password'],
+                    "rolvaliduntil": config_data['test_lr_credentials']
+                                                ['test_lr_validity'],
+                    "seclabels": config_data['test_lr_credentials']
+                                            ['test_sec_lable'],
+                    "variables": config_data['test_lr_credentials']
+                                            ['test_variable']
+                   }
+
+            response = self.tester.post(self.url + str(srv_grp) + '/'
+                                       + server_id + '/', data=json.dumps(data),
+                                        content_type='html/json')
+
+            self.assertTrue(response.status_code, 200)
+
+            respdata = json.loads(response.data.decode())
+
+            lr_id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl'):
+                exst_server_id = open('/home/edb/Downloads/pgadmin4/web'
+                                       '/regression/''parent_id.pkl', 'rb')
+                all_id = pickle.load(exst_server_id)
+                pickle_id_dict = all_id
+
+            pickle_id_dict["lrid"].append(lr_id)
+
+            lr_output = open('/home/edb/Downloads/pgadmin4/web/regression/'
+                             'parent_id.pkl', 'wb')
+            pickle.dump(pickle_id_dict, lr_output)
+            lr_output.close()
+
diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_delete.py b/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_delete.py
new file mode 100644
index 0000000..445fd7c
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_delete.py
@@ -0,0 +1,47 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+from .test_role_func import test_getrole
+from regression.test_utils import get_ids
+
+
+class LoginRoleDeleteTestCase(LoginTestCase):
+    """ This class will delete added login role present under server node. """
+
+    priority = 14
+
+    scenarios = [
+        # Fetching default URL for roles node.
+        ('Check Role Node', dict(url='/browser/role/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will delete the role. """
+
+        all_id = get_ids()
+        server_id = all_id["sid"][0]
+        srv_grp = config_data['test_server_group']
+
+        respdata = test_getrole(node=self)
+
+        role_id = respdata['oid']
+
+        if len(respdata) == 0:
+            raise Exception("No roles(s) to delete!!!")
+
+        del_response = self.tester.delete(self.url + str(srv_grp) + '/' +
+                                          str(server_id) + '/' + str(role_id),
+                                          follow_redirects=True)
+
+        del_respdata = json.loads(del_response.data.decode())
+
+        self.assertTrue(del_respdata['success'], 1)
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_func.py b/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_func.py
new file mode 100644
index 0000000..3e06b08
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_func.py
@@ -0,0 +1,48 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+import json
+from regression.test_utils import get_ids
+
+
+def test_getrole(node=None):
+
+    if not node:
+        return None
+
+    all_id = get_ids()
+
+    server_id = all_id["sid"][0]
+    role_id = all_id["lrid"][0]
+
+    srv_grp = config_data['test_server_group']
+
+    response = node.tester.post('browser/server/connect/{0}/{1}'.format
+                                (srv_grp, server_id),
+                                data=dict(
+                                password=config_data
+                                ['test_server_credentials'][0]
+                                ['test_db_password']),
+                                follow_redirects=True)
+
+    srv_connect = json.loads(response.data.decode())
+
+    if srv_connect['data']['connected']:
+
+        response = node.tester.get('/browser/role/obj/{0}/{1}/{2}'.format
+                                   (srv_grp, server_id, role_id),
+                                   content_type='html/json')
+
+        respdata = json.loads(response.data.decode())
+
+        return respdata
+
+
+
diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_get.py b/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_get.py
new file mode 100644
index 0000000..636ce1c
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_get.py
@@ -0,0 +1,56 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+from regression.utils import get_ids
+
+
+class LoginRoleGetTestCase(LoginTestCase):
+    """
+    This class will fetch login roles node present under the object browser's
+    tree node by response code.
+    """
+
+    priority = 13
+
+    scenarios = [
+        # Fetching default URL for roles node.
+        ('Check Role Node', dict(url='/browser/role/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will fetch added login role under tree node. """
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        role_id = all_id["lrid"][0]
+        srv_grp = config_data['test_server_group']
+
+        response = self.tester.post('browser/server/connect/' + str(srv_grp) +
+                                    '/' + server_id,
+                                    data=dict(
+                                    password=config_data
+                                    ['test_server_credentials'][0]
+                                    ['test_db_password']),
+                                    follow_redirects=True)
+
+        srv_connect = json.loads(response.data.decode())
+
+        if srv_connect['data']['connected']:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(role_id),
+                                       content_type='html/json')
+
+            self.assertEquals(response.status_code, 200)
+
+
diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_put.py b/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_put.py
new file mode 100644
index 0000000..34879f4
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_put.py
@@ -0,0 +1,51 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+from .test_role_func import test_getrole
+from regression.test_utils import get_ids
+
+
+class LoginRolePutTestCase(LoginTestCase):
+    """This class update the comment field of login roles node."""
+
+    priority = 13
+
+    scenarios = [
+        # Fetching default URL for roles node.
+        ('Check Role Node', dict(url='/browser/role/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will update the role's comment field."""
+
+        all_id = get_ids()
+
+        srv_grp = config_data['test_server_group']
+
+        server_id = all_id["sid"][0]
+
+        respdata = test_getrole(node=self)
+
+        role_id = respdata['oid']
+
+        data = {
+                "description": config_data["test_lr_update_data"]
+                                          ["test_comment"],
+                "oid": role_id
+               }
+
+        put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(role_id),
+                                       data=json.dumps(data),
+                                       follow_redirects=True)
+
+        self.assertEquals(put_response.status_code, 200)
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/tablespaces/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/tablespaces/tests/__init__.py
new file mode 100644
index 0000000..28fcc16
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/tablespaces/tests/__init__.py
@@ -0,0 +1,16 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from pgadmin.utils.route import BaseTestGenerator
+
+
+class TblspaceGeneratorTestCase(BaseTestGenerator):
+
+    def runTest(self):
+        return
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_add.py b/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_add.py
new file mode 100644
index 0000000..c4d6bd6
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_add.py
@@ -0,0 +1,83 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json, pickle, uuid, os
+from regression.test_utils import get_ids
+
+class TbspcAddTestCase(LoginTestCase):
+
+    """
+    This class will check server node present on the object browser's tree node by response code.
+    """
+    priority = 15
+
+    scenarios = [
+        # Fetching default URL for tablespace node.
+        ('Check Tablespace Node', dict(url='/browser/tablespace/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add new tablespace under 1st server of tree node."""
+
+        srv_id = get_ids()
+
+        srv_grp = config_data['test_server_group']
+
+        server_id = srv_id["sid"][0]
+
+        response = self.tester.post('browser/server/connect/' + str(srv_grp) +
+                                    '/' + server_id,
+                                    data=dict(
+                                    password=config_data
+                                    ['test_server_credentials'][0]
+                                    ['test_db_password']),
+                                    follow_redirects=True)
+
+        srv_connect = json.loads(response.data.decode())
+
+        if srv_connect['data']['connected']:
+            data = \
+                {
+                    "name": str(uuid.uuid4())[1:8],
+                    "seclabels": config_data["test_tablespc_credentials"]
+                                            ["test_spc_seclable"],
+                    "spcacl": config_data["test_tablespc_credentials"]
+                                         ["test_spc_acl"],
+                    "spclocation": config_data["test_tablespc_credentials"]
+                                              ["test_spc_location"],
+                    "spcoptions": config_data["test_tablespc_credentials"]
+                                             ["test_spc_opts"],
+                    "spcuser": config_data["test_tablespc_credentials"]
+                                          ["test_spc_user"]
+                }
+#
+            response = self.tester.post(self.url + str(srv_grp) + '/'
+                                                   + server_id + '/',
+                                       data=json.dumps(data),
+                                        content_type='html/json')
+            self.assertTrue(response.status_code, 200)
+            respdata = json.loads(response.data.decode())
+            tbspc_id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl'):
+                exst_ids = open('/home/edb/Downloads/pgadmin4/web'
+                                '/regression/''parent_id.pkl', 'rb')
+                all_id = pickle.load(exst_ids)
+                pickle_id_dict = all_id
+
+            pickle_id_dict["tsid"].append(tbspc_id)
+
+            spc_output = open('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl', 'wb')
+            pickle.dump(pickle_id_dict, spc_output)
+            spc_output.close()
+
diff --git a/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_delete.py b/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_delete.py
new file mode 100644
index 0000000..8674ba4
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_delete.py
@@ -0,0 +1,51 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+from regression.test_utils import get_ids
+from .test_tbspc_func import test_gettblspc
+
+class TbspcDeleteTestCase(LoginTestCase):
+    """
+    This class will delete tablespace node present under the object browser's
+    tree node by response code.
+    """
+
+    priority = 18
+
+    scenarios = [
+        # Fetching default URL for tablespace node.
+        ('Check Tablespace Node', dict(url='/browser/tablespace/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will delete the added tablespace"""
+
+        all_id = get_ids()
+
+        srv_grp = config_data['test_server_group']
+
+        server_id = all_id["sid"][0]
+
+        respdata = test_gettblspc(node=self)
+
+        tbspc_id = respdata['oid']
+
+        if len(respdata) == 0:
+            raise Exception("No tablespace(s) to delete!!!")
+
+        del_response = self.tester.delete(self.url + str(srv_grp) + '/' +
+                                          str(server_id) + '/' + str(tbspc_id),
+                                          follow_redirects=True)
+
+        del_respdata = json.loads(del_response.data.decode())
+
+        self.assertTrue(del_respdata['success'], 1)
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_func.py b/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_func.py
new file mode 100644
index 0000000..2abcf8d
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_func.py
@@ -0,0 +1,45 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.test_utils import get_ids
+from regression.config import config_data
+import json
+
+
+def test_gettblspc(node=None):
+
+    if not node:
+        return None
+
+    all_id = get_ids()
+
+    server_id = all_id["sid"][0]
+    tbspc_id = all_id["tsid"][0]
+
+    srv_grp = config_data['test_server_group']
+
+    response = node.tester.post('browser/server/connect/{0}/{1}'.format
+                                (srv_grp, server_id),
+                                data=dict(password=config_data
+                                ['test_server_credentials'][0]
+                                ['test_db_password']), follow_redirects=True)
+
+    srv_connect = json.loads(response.data.decode())
+
+    if srv_connect['data']['connected']:
+
+        response = node.tester.get('/browser/tablespace/obj/{0}/{1}/{2}'.format
+                                   (srv_grp, server_id, tbspc_id),
+                                   content_type='html/json')
+
+        node.assertEquals(response.status_code, 200)
+
+        respdata = json.loads(response.data.decode())
+
+        return respdata
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_get.py b/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_get.py
new file mode 100644
index 0000000..0d85f46
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_get.py
@@ -0,0 +1,57 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+from regression.test_utils import get_ids
+
+
+class TbspcGetTestCase(LoginTestCase):
+    """
+    This class will fetch added tablespace under the object browser's
+    tree node by response code.
+    """
+    priority = 16
+
+    scenarios = [
+        # Fetching default URL for tablespace node.
+        ('Check Tablespace Node', dict(url='/browser/tablespace/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will get the added tablespace."""
+
+        all_id = get_ids()
+
+        srv_grp = config_data['test_server_group']
+
+        server_id = all_id["sid"][0]
+        tbspc_id = all_id["tsid"][0]
+
+        response = self.tester.post('browser/server/connect/' + str(srv_grp) +
+                                    '/' + server_id,
+                                    data=dict(
+                                    password=config_data
+                                    ['test_server_credentials'][0]
+                                    ['test_db_password']),
+                                    follow_redirects=True)
+
+        srv_connect = json.loads(response.data.decode())
+
+        if srv_connect['data']['connected']:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(tbspc_id),
+                                       content_type='html/json')
+
+            self.assertEquals(response.status_code, 200)
+
+            respdata = json.loads(response.data.decode())
+            self.assertTrue(respdata['oid'], tbspc_id)
diff --git a/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_put.py b/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_put.py
new file mode 100644
index 0000000..59a38f3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_put.py
@@ -0,0 +1,56 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+from .test_tbspc_func import test_gettblspc
+from regression.test_utils import get_ids
+
+
+class TbspcUpdateTestCase(LoginTestCase):
+    """
+    This class will update comment field of  added tablespace under the
+    object browser's tree node.
+    """
+
+    priority = 17
+
+    scenarios = [
+        # Fetching default URL for tablespace node.
+        ('Check Tablespace Node', dict(url='/browser/tablespace/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will update the added tablespace."""
+
+        all_id = get_ids()
+
+        server_id = all_id["sid"][0]
+        srv_grp = config_data['test_server_group']
+
+        respdata = test_gettblspc(node=self)
+
+        tbspc_id = respdata['oid']
+
+        data = \
+            {
+                "description": config_data["test_lr_update_data"]
+                               ["test_comment"],
+                "id": tbspc_id
+            }
+
+        put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(tbspc_id),
+                                       data=json.dumps(data),
+                                       follow_redirects=True)
+
+        self.assertEquals(put_response.status_code, 200)
+
+
diff --git a/web/pgadmin/browser/server_groups/servers/tests/test_server_add.py b/web/pgadmin/browser/server_groups/servers/tests/test_server_add.py
index 0af13d3..b722aeb 100644
--- a/web/pgadmin/browser/server_groups/servers/tests/test_server_add.py
+++ b/web/pgadmin/browser/server_groups/servers/tests/test_server_add.py
@@ -8,16 +8,14 @@
 # ##########################################################################
 
 import json
-
+import pickle
+import os
 from pgadmin.browser.tests.test_login import LoginTestCase
 from regression.config import config_data

 class ServersAddTestCase(LoginTestCase):
-    """
-    This class will add the servers under default server group and verify with
-    server's name.
-    """
+    """ This class will add the servers under default server group. """
 
     priority = 4
 
@@ -27,10 +25,31 @@ class ServersAddTestCase(LoginTestCase):
     ]
 
     def runTest(self):
-        """
-        This function will add the server under default server group.
-        Verify the added server with response code as well as server name.
-        """
+        """ This function will add the server under default server group."""
+
+        # Storing parent id's into pickle dict
+        pickle_id_dict = {
+            "sid": [],  #server
+            "did": [],  #database
+            "lrid": [], #login role
+            "tsid": [], #tablspace
+            "cid": [],  #cast
+            "eid": [],  #extention
+            "lid": [12397], #language
+            "scid": [],     #schema
+            "tfnid": [],    #trigger function
+            "etid": [],     #event trigger
+            "coid": [],     #collation
+            "fid": [],  #FDW
+            "doid": [], #Domain
+            "seid": [],  #Sequence
+            "tid": [],   #table
+            "vid": [],  #view
+            "mvid": [],  #mview
+            "fsid": [],  #foreign server
+            "umid": [],  #User mapping
+            "foid": []  #foreign table
+        }
 
         srv_grp = config_data['test_server_group']
 
@@ -48,6 +67,20 @@ class ServersAddTestCase(LoginTestCase):
 
             response = self.tester.post(url, data=json.dumps(data),
                                         content_type='html/json')
+
             self.assertTrue(response.status_code, 200)
-            respdata = json.loads(response.data)
-            self.assertTrue(respdata['node']['label'], srv['test_name'])
+            respdata = json.loads(response.data.decode())
+
+            server_id = respdata['node']['_id']
+
+            if os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
+                              'parent_id.pkl'):
+                exst_server_id = open('/home/edb/Downloads/pgadmin4/web/'
+                                      'regression/parent_id.pkl', 'rb')
+                pickle_id_dict = pickle.load(exst_server_id)
+
+            pickle_id_dict["sid"].append(server_id)
+            output = open('/home/edb/Downloads/pgadmin4/web/regression/'
+                          'parent_id.pkl', 'wb')
+            pickle.dump(pickle_id_dict, output)
+            output.close()
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/tests/test_server_delete.py b/web/pgadmin/browser/server_groups/servers/tests/test_server_delete.py
index 329d74f..a7dd101 100644
--- a/web/pgadmin/browser/server_groups/servers/tests/test_server_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/tests/test_server_delete.py
@@ -8,16 +8,13 @@
 # ##################################################################
 
 import json
-
 from pgadmin.browser.tests.test_login import LoginTestCase
 from regression.config import config_data

-class ServersDeleteTestCase(LoginTestCase):
-    """
-    This class will check server node present on the object browser's tree node
-    by response code.
-    """
+class ServerDeleteTestCase(LoginTestCase):
+    """ This class will delete the last server present under tree node."""
+
     priority = 7
 
     scenarios = [
@@ -26,32 +23,22 @@ class ServersDeleteTestCase(LoginTestCase):
     ]
 
     def runTest(self):
-        """
-        This function will get all available servers under object browser
-        and delete the servers using server id.
-        """
+        """ This function will get all available servers under object browser
+        and delete the last server using server id."""
 
         srv_grp = config_data['test_server_group']
 
-        for srv in config_data['test_server_credentials']:
-
-            data = {"name": srv['test_name'],
-                    "host": srv['test_host'],
-                    "port": srv['test_db_port'],
-                    "db": srv['test_maintenance_db'],
-                    "username": srv['test_db_username'],
-                    "role": "",
-                    "sslmode": srv['test_sslmode']}
+        url = self.url + str(srv_grp) + "/"
 
-            url = self.url + str(srv_grp) + "/"
+        response = self.tester.get(url)
+        respdata = json.loads(response.data.decode())
 
-            response = self.tester.get(url, data=json.dumps(data),
-                                       content_type='html/json')
-            self.assertTrue(response.status_code, 200)
-            respdata = json.loads(response.data)
+        if len(respdata) == 0:
+            raise Exception("No server(s) to delete!!!")
 
-            for server in respdata:
-                response = self.tester.delete(url + json.dumps(server['id']))
-                self.assertTrue(response.status_code, 200)
-                respdata = json.loads(response.data)
-                self.assertTrue(respdata['success'], 1)
+        # delete last server
+        server = respdata[-1]
+        response = self.tester.delete(url + str(server['id']))
+        self.assertTrue(response.status_code, 200)
+        respdata = json.loads(response.data.decode())
+        self.assertTrue(respdata['success'], 1)
diff --git a/web/pgadmin/browser/server_groups/servers/tests/test_server_get.py b/web/pgadmin/browser/server_groups/servers/tests/test_server_get.py
index 050843e..163fef3 100644
--- a/web/pgadmin/browser/server_groups/servers/tests/test_server_get.py
+++ b/web/pgadmin/browser/server_groups/servers/tests/test_server_get.py
@@ -7,15 +7,14 @@
 #
 # ##########################################################################
 
-import json
-
 from pgadmin.browser.tests.test_login import LoginTestCase
 from regression.config import config_data
+from regression.test_utils import get_ids

 class ServersGetTestCase(LoginTestCase):
     """
-    This class will check server node present on the object browser's tree node
+    This class will fetch added servers under default server group
     by response code.
     """
 
@@ -27,23 +26,16 @@ class ServersGetTestCase(LoginTestCase):
     ]
 
     def runTest(self):
-        """
-        This function will get all available servers present under
-        object browser.
-        """
+        """ This function will fetch the added servers to object browser. """
 
+        all_id = get_ids()
+        server_id = all_id["sid"]
         srv_grp = config_data['test_server_group']
 
-        for srv in config_data['test_server_credentials']:
-            data = {"name": srv['test_name'],
-                    "host": srv['test_host'],
-                    "port": srv['test_db_port'],
-                    "db": srv['test_maintenance_db'],
-                    "username": srv['test_db_username'],
-                    "role": "",
-                    "sslmode": srv['test_sslmode']}
-
-            url = self.url + str(srv_grp) + "/"
-            response = self.tester.get(url, data=json.dumps(data),
+        for srv in server_id:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(srv),
                                        content_type='html/json')
-            self.assertTrue(response.status_code, 200)
+
+            self.assertEquals(response.status_code, 200)
diff --git a/web/pgadmin/browser/server_groups/servers/tests/test_server_put.py b/web/pgadmin/browser/server_groups/servers/tests/test_server_put.py
index 306bb03..0daac73 100644
--- a/web/pgadmin/browser/server_groups/servers/tests/test_server_put.py
+++ b/web/pgadmin/browser/server_groups/servers/tests/test_server_put.py
@@ -8,16 +8,13 @@
 # ##########################################################################
 
 import json
-
 from pgadmin.browser.tests.test_login import LoginTestCase
 from regression.config import config_data
+from regression.test_utils import get_ids

-class ServersUpdateTestCase(LoginTestCase):
-    """
-    This class will check server node present on the object browser's tree node
-    by response code.
-    """
+class ServerUpdateTestCase(LoginTestCase):
+    """ This class will update server's comment field. """
 
     priority = 6
 
@@ -27,39 +24,40 @@ class ServersUpdateTestCase(LoginTestCase):
     ]
 
     def runTest(self):
-        """
-        This function will edit and update the server's comment field
-        by the server id.
-        """
+        """ This function will update the server's comment field. """
 
+        all_id = get_ids()
+        server_id = all_id["sid"][0]
         srv_grp = config_data['test_server_group']
 
-        for srv in config_data['test_server_credentials']:
+        response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                   str(server_id),
+                                   follow_redirects=True)
 
-            data = {"name": srv['test_name'],
-                    "host": srv['test_host'],
-                    "port": srv['test_db_port'],
-                    "db": srv['test_maintenance_db'],
-                    "username": srv['test_db_username'],
-                    "role": "",
-                    "sslmode": srv['test_sslmode']}
+        con_response = self.tester.post('browser/server/connect/{0}/{1}'.format
+                                        (srv_grp, server_id),
+                                        data=dict(password=config_data
+                                        ['test_server_credentials'][0]
+                                        ['test_db_password']),
+                                        follow_redirects=True)
 
-            url = self.url + str(srv_grp) + "/"
+        srv_con = json.loads(con_response.data.decode())
 
-            response = self.tester.get(url, data=json.dumps(data),
-                                       content_type='html/json')
+        if len(srv_con) == 0:
+            raise Exception("No Server(s) connected to update!!!")
 
-            self.assertTrue(response.status_code, 200)
-            respdata = json.loads(response.data)
+        data = \
+            {
+                "comment": config_data
+                ['test_server_update_data']['test_comment'],
+                "id": server_id
+            }
 
-            for server in respdata:
+        put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                       str(server_id), data=json.dumps(data),
+                                       content_type='html/json')
 
-                url = self.url + str(srv_grp) + "/" + json.dumps(server['id'])
+        self.assertEquals(put_response.status_code, 200)
 
-                for server in config_data['test_server_update_data']:
-                    data = {"comment": server['test_comment']}
-                    response = self.tester.put(url, data=json.dumps(data),
-                                               content_type='html/json')
-                    self.assertTrue(response.status_code, 200)
-                    respdata = json.loads(response.data)
-                    self.assertTrue(respdata['success'], 1)
+        respdata = json.loads(put_response.data.decode())
+        self.assertTrue(respdata['success'], 1)
diff --git a/web/pgadmin/browser/server_groups/tests/test_sg_get.py b/web/pgadmin/browser/server_groups/tests/test_sg_get.py
new file mode 100644
index 0000000..c552d8e
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/tests/test_sg_get.py
@@ -0,0 +1,36 @@
+###########################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+###########################################################################
+
+import json
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.config import config_data
+
+
+class SgGetTestCase(LoginTestCase):
+    """
+     This class will check available server groups in pgAdmin.
+    """
+
+    priority = 3
+
+    scenarios = [
+        # Fetching the default url for server group node
+        ('Check Server Group Node', dict(url='/browser/server-group/obj/'))
+    ]
+
+    def runTest(self):
+        """This function will check available server groups."""
+
+        srv_grp = config_data['test_server_group']
+
+        response = self.tester.get(self.url + str(srv_grp),
+                                   content_type='html/json')
+        self.assertEquals(response.status_code, 200)
+        respdata = json.loads(response.data.decode())
+        self.assertTrue(respdata['id'], srv_grp)
diff --git a/web/pgadmin/browser/tests/test_login.py b/web/pgadmin/browser/tests/test_login.py
index 7c2b796..d272a63 100644
--- a/web/pgadmin/browser/tests/test_login.py
+++ b/web/pgadmin/browser/tests/test_login.py
@@ -8,7 +8,6 @@
 ##########################################################################
 
 import uuid
-
 from pgadmin.utils.route import BaseTestGenerator
 from regression.config import config_data
 
@@ -67,7 +66,9 @@ class LoginTestCase(BaseTestGenerator):
                    ['test_login_username']),
             password=(config_data['pgAdmin4_login_credentials']
                       ['test_login_password']),
-            respdata='You are currently running version'))
+            respdata='Gravatar image for %s' %
+                     config_data['pgAdmin4_login_credentials']
+                     ['test_login_username']))
     ]
 
     def runTest(self):
@@ -76,4 +77,4 @@ class LoginTestCase(BaseTestGenerator):
         response = self.tester.post('/login', data=dict(
             email=self.email, password=self.password),
                                     follow_redirects=True)
-        self.assertIn(self.respdata, response.data)
+        self.assertIn(self.respdata, response.data.decode('utf8'))
diff --git a/web/pgadmin/utils/route.py b/web/pgadmin/utils/route.py
index 1ff41de..3d41e0f 100644
--- a/web/pgadmin/utils/route.py
+++ b/web/pgadmin/utils/route.py
@@ -9,6 +9,8 @@
 
 from abc import ABCMeta, abstractmethod
 import unittest
+from importlib import import_module
+from werkzeug.utils import find_modules

 class TestsGeneratorRegistry(ABCMeta):
@@ -48,18 +50,18 @@ class TestsGeneratorRegistry(ABCMeta):
 
         cls.registry = dict()
 
-        from importlib import import_module
-        from werkzeug.utils import find_modules
-
         for module_name in find_modules(pkg, False, True):
-            module = import_module(module_name)
-
+            try:
+                module = import_module(module_name)
+            except ImportError:
+                pass
 
 import six

 @six.add_metaclass(TestsGeneratorRegistry)
 class BaseTestGenerator(unittest.TestCase):
+
     # Defining abstract method which will override by individual testcase.
     @abstractmethod
     def runTest(self):
diff --git a/web/regression/parent_id.pkl b/web/regression/parent_id.pkl
new file mode 100644
index 0000000..7227444
Binary files /dev/null and b/web/regression/parent_id.pkl differ
diff --git a/web/regression/test_config.json b/web/regression/test_config.json
new file mode 100644
index 0000000..2f0d09f
--- /dev/null
+++ b/web/regression/test_config.json
@@ -0,0 +1,910 @@
+{
+  "pgAdmin4_login_credentials":
+  {
+    "test_new_password" : "newpass",
+    "test_login_password" : "test123",
+    "test_login_username" : "[email-masked]"
+  },
+
+
+  "test_server_group" : 1,
+
+  "test_server_credentials":
+  [{
+    "test_name" : "PG9.5",
+    "test_db_username" : "postgres",
+    "test_host" : "localhost",
+    "test_db_password" : "edb",
+    "test_db_port" : 5433,
+    "test_maintenance_db" : "postgres",
+    "test_sslmode" :"prefer"
+  },
+  {
+    "test_name" : "PPAS9.4",
+    "test_db_username" : "enterprisedb",
+    "test_host" : "localhost",
+    "test_db_password" : "edb",
+    "test_db_port" : 5444,
+    "test_maintenance_db" : "edb",
+    "test_sslmode" :"prefer"
+  }],
+
+  "test_server_update_data":
+  {
+      "test_comment": "This is test update comment"
+  },
+
+  "test_add_database_data": {
+    "test_privileges_acl": [
+      {
+        "grantee": "postgres",
+        "grantor": "postgres",
+        "privileges": [
+          {
+            "privilege_type": "C",
+            "privilege": true,
+            "with_grant": true
+          },
+          {
+            "privilege_type": "T",
+            "privilege": true,
+            "with_grant": false
+          }
+        ]
+      }
+    ],
+    "test_conn_limit": -1,
+    "test_owner": "postgres",
+    "test_fun_acl": [
+      {
+        "grantee": "postgres",
+        "grantor": "postgres",
+        "privileges": [
+          {
+            "privilege_type": "X",
+            "privilege": true,
+            "with_grant": false
+          }
+        ]
+      }
+    ],
+    "test_seq_acl": [
+      {
+        "grantee": "postgres",
+        "grantor": "postgres",
+        "privileges": [
+          {
+            "privilege_type": "r",
+            "privilege": true,
+            "with_grant": false
+          },
+          {
+            "privilege_type": "w",
+            "privilege": true,
+            "with_grant": false
+          },
+          {
+            "privilege_type": "U",
+            "privilege": true,
+            "with_grant": false
+          }
+        ]
+      }
+    ],
+    "test_tbl_acl": [
+      {
+        "grantee": "postgres",
+        "grantor": "postgres",
+        "privileges": [
+          {
+            "privilege_type": "a",
+            "privilege": true,
+            "with_grant": true
+          },
+          {
+            "privilege_type": "r",
+            "privilege": true,
+            "with_grant": false
+          }
+        ]
+      }
+    ],
+    "test_type_acl": [
+      {
+        "grantee": "postgres",
+        "grantor": "postgres",
+        "privileges": [
+          {
+            "privilege_type": "U",
+            "privilege": true,
+            "with_grant": false
+          }
+        ]
+      }
+    ],
+    "test_encoding": "UTF8",
+    "test_name": "test_db_automation",
+    "test_privileges": [],
+    "test_securities": [],
+    "test_variables": []
+  },
+
+    "test_db_update_data":
+  {
+      "test_comment": "This is db update comment"
+  },
+
+    "test_lr_credentials":
+    {
+      "test_can_login": "true",
+      "test_conn_limit": -1,
+      "test_create_role": "true",
+      "test_role_inherit": "true",
+      "test_role_membership": [],
+      "test_lr_name":  "testlrg1",
+      "test_lr_password": "edb",
+      "test_lr_validity": "12/27/2016",
+      "test_sec_lable": [],
+      "test_variable":[
+        {"name":"work_mem",
+          "database":"postgres",
+          "value":65
+        }
+      ]
+    },
+
+  "test_lr_update_data":
+  {
+    "test_comment": "This is login role update comment"
+  },
+
+  "test_tablespc_credentials":
+  {
+    "test_tblspace_name": "test_tablespace",
+    "test_spc_seclable": [],
+    "test_spc_acl": [
+      {
+        "grantee":"postgres",
+        "grantor":"postgres",
+        "privileges":[
+          {
+            "privilege_type":"C",
+            "privilege":true,
+            "with_grant":false
+          }
+        ]
+      }
+    ],
+    "test_spc_location": "/opt/PostgreSQL/9.5/data",
+    "test_spc_opts": [],
+    "test_spc_user": "postgres"
+  },
+
+    "test_tbspc_update_data":
+  {
+    "test_comment": "This is tablespace update comment"
+  },
+
+  "test_casts_credentials":
+  {
+    "test_cast_context": "IMPLICIT",
+    "test_encoding": "UTF8",
+    "test_name": "money->bigint",
+    "test_source_type": "money",
+    "test_target_type": "bigint"
+  },
+
+     "test_cast_update_data":
+  {
+    "test_comment": "This is cast update comment"
+  },
+
+    "test_extension_credentials":
+  {
+    "test_name": "postgres_fdw",
+    "test_relocate": true,
+    "test_schema": "public",
+    "test_version": "1.0"
+  },
+
+    "test_extension_update_data":
+  {
+    "test_schema": "test1"
+  },
+
+      "test_language_update_data":
+  {
+    "test_comment": "This is language update comment"
+  },
+
+  "test_schema_credentials":
+  {
+    "test_func_acl": [],
+    "test_seq_acl": [],
+    "test_tbl_acl": [],
+    "test_type_acl": [],
+    "test_name": "test_schema",
+    "test_owner": "postgres",
+    "test_privilege":
+    [
+      {
+        "grantee":"postgres",
+        "grantor":"postgres",
+        "privileges":
+        [
+          {
+            "privilege_type":"C",
+            "privilege":true,
+            "with_grant":false
+          },
+          {
+            "privilege_type":"U",
+            "privilege":true,
+            "with_grant":false
+          }
+        ]
+      }
+    ],
+    "test_sec_label": []
+  },
+
+  "test_schema_update_data":
+  {
+  "test_tbl_acl":
+  {
+    "added":
+    [
+      {
+        "grantee": "public",
+        "grantor": "postgres",
+        "privileges":
+        [
+          {
+            "privilege_type": "D",
+            "privilege": true,
+            "with_grant": false
+          },
+          {
+            "privilege_type": "x",
+            "privilege": true,
+            "with_grant": false
+          }
+        ]
+      }
+    ]
+  },
+    "test_func_acl":
+    {
+      "added":
+      [
+        {
+          "grantee":"postgres",
+          "grantor":"postgres",
+          "privileges":
+          [
+            {
+              "privilege_type":"X",
+              "privilege":true,
+              "with_grant":true
+            }
+          ]
+        }
+      ]
+    },
+    "test_seq_acl":
+    {
+      "added":
+      [
+        {
+          "grantee":"postgres",
+          "grantor":"postgres",
+          "privileges":
+          [
+            {
+              "privilege_type":"r",
+              "privilege":true,
+              "with_grant":false
+            },
+            {
+              "privilege_type":"w",
+              "privilege":true,
+              "with_grant":false
+            },
+            {
+              "privilege_type":"U",
+              "privilege":true,
+              "with_grant":false
+            }
+          ]
+        }
+      ]
+    }
+  },
+
+  "test_trigger_function_credentials":
+  {
+    "test_acl":
+    [
+      {
+        "grantee":"postgres",
+        "grantor":"postgres",
+        "privileges":
+        [
+          {
+            "privilege_type":"X",
+            "privilege":true,
+            "with_grant":true
+          }
+        ]
+      }
+    ],
+    "test_args": [],
+    "test_fun_owner": "postgres",
+    "test_language": "plpgsql",
+    "test_name": "test_abort_any_command",
+    "test_options": [],
+    "test_probe": "$libdir/",
+    "test_leak_proof": true,
+    "test_namespace": 2200,
+    "test_type": "event_trigger",
+    "test_sec_def": true,
+    "test_code": "BEGIN   RAISE EXCEPTION 'command % is disabled', tg_tag; END;",
+    "test_volitile": "s",
+    "test_sec_label": [],
+    "test_Variable":
+    [
+      {
+        "name":"enable_sort",
+        "value":true
+      }
+    ]
+  },
+
+  "test_trigger_func_update_data":
+  {
+    "test_comment": "This is trigger function update comment"
+  },
+
+  "test_event_trigger_credentials":
+  {
+    "test_enable": "O",
+    "test_event_func": "test_schema.test_abort_any_command",
+    "test_event_name":  "DDL_COMMAND_END",
+    "test_event_owner":  "postgres",
+    "test_name": "test_event_trg",
+    "test_provider": []
+  },
+
+   "test_event_trigger_update_data":
+  {
+    "test_comment": "This is event trigger update comment"
+  },
+
+  "test_FDW_credentials":
+  {
+    "test_acl":
+    [
+      {
+        "grantee":"postgres",
+        "grantor":"postgres",
+        "privileges":
+        [
+          {
+            "privilege_type":"U",
+            "privilege":true,
+            "with_grant":true
+          }
+        ]
+      }
+    ],
+
+    "test_handler": "postgres_fdw_handler",
+    "test_options": [],
+    "test_owner": "postgres",
+    "test_validator": "postgresql_fdw_validator",
+    "test_name": "test_fdw"
+  },
+
+    "test_FDW_update_data":
+  {
+    "test_comment": "This is FDW update comment"
+  },
+
+  "test_collation_credentials":
+  {
+    "test_copy_collation": "pg_catalog.\"POSIX\"",
+    "test_name": "test_collation",
+    "test_owner": "postgres",
+    "test_schema": "test_schema"
+  },
+
+   "test_collation_update_data":
+  {
+    "test_comment": "This is collation update comment"
+  },
+
+
+  "test_domain_data":
+  {
+    "test_schema": "test_schema",
+    "test_basetype": "character",
+    "test_collation": "pg_catalog.\"en_AG\"",
+    "test_constraints":
+    [
+      {
+        "conname":"num",
+        "convalidated":true
+      }
+    ],
+    "test_lenght": true,
+    "test_max_value":  2147483647,
+    "test_min_value": 1,
+    "test_name": "test_domain",
+    "test_owner": "postgres",
+    "test_security": [],
+    "test_defalt_type": "1",
+    "test_type_len": "10"
+  },
+
+  "test_domain_update_data":
+  {
+    "test_comment": "This is domain update comment"
+  },
+
+  "test_sequence_credentials":
+  {
+    "test_cache": "1",
+    "test_cycled": true,
+    "test_increment":  "1",
+    "test_max_value": "100000",
+    "test_min_value": "1",
+    "test_name": "test_empno",
+    "test_acl":
+    [
+      {
+        "grantee":"postgres",
+        "grantor":"postgres",
+        "privileges":
+        [
+          {
+            "privilege_type":"r",
+            "privilege":true,
+            "with_grant":false
+          },
+          {
+            "privilege_type":"w",
+            "privilege":true,
+            "with_grant":false
+          },
+          {
+            "privilege_type":"U",
+            "privilege":true,
+            "with_grant":false
+          }
+        ]
+      }
+    ],
+    "test_schema_name": "test_schema",
+    "test_security":  [],
+    "test_owner":  "postgres",
+    "test_start_val": "100"
+  },
+
+    "test_sequnce_update_data":
+  {
+    "test_comment": "This is sequence update comment"
+  },
+
+  "test_table_credentials":
+  {
+    "test_constraint": [],
+    "test_col_inherit": "[]",
+    "test_columns":
+    [
+      {
+        "name":"empno",
+        "cltype":"numeric",
+        "attacl":[],
+        "is_primary_key":false,
+        "attoptions":[],
+        "seclabels":[]
+      },
+      {
+        "name":"empname",
+        "cltype":"character[]",
+        "attacl":[],
+        "is_primary_key":false,
+        "attoptions":[],
+        "seclabels":[]
+      },
+      {"name":"DOJ",
+        "cltype":"date[]",
+        "attacl":[],
+        "is_primary_key":false,
+        "attoptions":[],
+        "seclabels":[]
+      }
+    ],
+    "test_has_constraint": [],
+    "test_fillfactor": "11",
+    "test_has_FK": [],
+    "test_has_toast_tbl": true,
+    "test_like_constraint":  true,
+    "test_like_default_value": true,
+    "test_like_relation": "pg_catalog.pg_tables",
+    "test_name": "test_emp",
+    "test_PK": [],
+    "test_acl":
+    [
+      {
+        "grantee":"postgres",
+        "grantor":"postgres",
+        "privileges":
+        [
+          {
+            "privilege_type":"a",
+            "privilege":true,
+            "with_grant":true
+          },
+          {
+            "privilege_type":"r",
+            "privilege":true,
+            "with_grant":false
+          },
+          {
+            "privilege_type":"w",
+            "privilege":true,
+            "with_grant":false
+          }
+        ]
+      }
+    ],
+    "test_has_oid": true,
+    "test_owner":  "postgres",
+    "test_schema": "test_schema",
+    "test_sec_acl":  [],
+    "test_tbscp": "pg_default",
+    "test_unique_constraint": [],
+    "test_vacuum_tbl":
+    [
+      {
+        "name":"autovacuum_analyze_scale_factor"
+      },
+      {
+        "name":"autovacuum_analyze_threshold"
+      },
+      {
+        "name":"autovacuum_freeze_max_age"
+      },
+      {
+        "name":"autovacuum_vacuum_cost_delay"
+      },
+      {
+        "name":"autovacuum_vacuum_cost_limit"
+      },
+      {
+        "name":"autovacuum_vacuum_scale_factor"
+      },
+      {
+        "name":"autovacuum_vacuum_threshold"
+      },
+      {
+        "name":"autovacuum_freeze_min_age"
+      },
+      {
+        "name":"autovacuum_freeze_table_age"
+      }
+    ],
+
+    "test_vacuum_toast":
+    [
+      {
+        "name":"autovacuum_freeze_max_age"
+      },
+      {
+        "name":"autovacuum_vacuum_cost_delay"
+      },
+      {
+        "name":"autovacuum_vacuum_cost_limit"
+      },
+      {
+        "name":"autovacuum_vacuum_scale_factor"
+      },
+      {
+        "name":"autovacuum_vacuum_threshold"
+      },
+      {
+        "name":"autovacuum_freeze_min_age"
+      },
+      {
+        "name":"autovacuum_freeze_table_age"
+      }
+    ]
+
+  },
+
+    "test_table_update_data":
+  {
+    "test_comment": "This is table update comment"
+  },
+
+  "test_view_credentials":
+  {
+    "test_check_options": "local",
+    "test_acl":
+    [
+      {
+        "grantee":"postgres",
+        "grantor":"postgres",
+        "privileges":
+        [
+          {
+            "privilege_type":"a",
+            "privilege":true,
+            "with_grant":true
+          },
+          {
+            "privilege_type":"r",
+            "privilege":true,
+            "with_grant":false
+          }
+        ]
+      }
+    ],
+    "test_definition":  "select test_emp.empname from test_schema.test_emp;",
+    "test_name":  "test_view",
+    "test_owner": "postgres",
+    "test_schema_name": "test_schema",
+    "test_sec_label": []
+  },
+
+  "test_view_update_data":
+  {
+    "test_comment": "This is view update comment"
+  },
+
+  "test_mview_credentials":
+  {
+    "test_acl":
+    [
+      {
+        "grantee":"postgres",
+        "grantor":"postgres",
+        "privileges":
+        [
+          {
+            "privilege_type":"a",
+            "privilege":true,
+            "with_grant":false
+          }
+        ]
+      }
+    ],
+    "test_definition": "select test_emp.empname from test_schema.test_emp where test_emp.empno = 1;",
+    "test_fillfactor":  "11",
+    "test_name": "test_mview",
+    "test_owner": "postgres",
+    "test_schema_name": "test_schema",
+    "test_sec_label": [],
+    "test_tbscp": "pg_default",
+    "test_toast_autovacuum": true,
+    "test_toast_autovacuum_enabled": false,
+    "test_vacuum_tbl":
+    [
+      {
+        "name":"autovacuum_analyze_scale_factor"
+      },
+      {
+        "name":"autovacuum_analyze_threshold"
+      },
+      {
+        "name":"autovacuum_freeze_max_age"
+      },
+      {
+        "name":"autovacuum_vacuum_cost_delay"
+      },
+      {
+        "name":"autovacuum_vacuum_cost_limit"
+      },
+      {
+        "name":"autovacuum_vacuum_scale_factor"
+      },
+      {
+        "name":"autovacuum_vacuum_threshold"
+      },
+      {
+        "name":"autovacuum_freeze_min_age"
+      },
+      {
+        "name":"autovacuum_freeze_table_age"
+      }
+    ],
+    "test_vacuum_toast":
+    [
+      {
+        "name":"autovacuum_freeze_max_age"
+      },
+      {
+        "name":"autovacuum_vacuum_cost_delay"
+      },
+      {
+        "name":"autovacuum_vacuum_cost_limit"
+      },
+      {
+        "name":"autovacuum_vacuum_scale_factor"
+      },
+      {
+        "name":"autovacuum_vacuum_threshold"
+      },
+      {
+        "name":"autovacuum_freeze_min_age"
+      },
+      {
+        "name":"autovacuum_freeze_table_age"
+      }
+    ],
+
+    "test_with_data": true
+  },
+
+    "test_mview_update_data":
+  {
+    "test_comment": "This is materialized view update comment"
+  },
+
+  "test_foreign_server_credentials":
+  {
+    "test_fsr_acl":
+    [
+      {
+        "grantee":"postgres",
+        "grantor":"postgres",
+        "privileges":
+        [
+          {
+            "privilege_type":"U",
+            "privilege":true,
+            "with_grant":false
+          }
+        ]
+      }
+    ],
+
+    "test_fsr_optns":
+    [
+      {
+        "fsrvoption":"host",
+        "fsrvvalue":"localhost"
+      },
+      {
+        "fsrvoption":"port",
+        "fsrvvalue":"5433"
+      },
+      {
+        "fsrvoption":"dbname",
+        "fsrvvalue":"postgres"
+      }
+    ],
+    "test_fsr_owner": "postgres",
+    "test_name": "test_foreign_server"
+  },
+
+  "test_FRS_update_data":
+  {
+    "test_comment": "This is foreign server update comment"
+  },
+
+  "test_user_mapping_credentials":
+  {
+    "test_name": "postgres",
+    "test_option": [],
+    "test_options":
+    [
+      {
+        "umoption":"user",
+        "umvalue":"postgres"
+      },
+      {
+        "umoption":"password",
+        "umvalue":"edb"
+      }
+    ]
+  },
+
+  "test_user_mapping_update_data":
+  {
+    "test_options":
+    {
+      "changed":
+      [
+        {"umoption":"password",
+          "umvalue":"edb1"
+        }
+      ]
+    }
+  },
+
+  "test_foreign_table_credentials":
+  {
+    "test_acl":
+    [
+      {
+        "grantee":"postgres",
+        "grantor":"postgres",
+        "privileges":
+        [
+          {
+            "privilege_type":"a",
+            "privilege":true,
+            "with_grant":false
+          },
+          {
+            "privilege_type":"r",
+            "privilege":true,
+            "with_grant":false
+          },
+          {
+            "privilege_type":"w",
+            "privilege":true,
+            "with_grant":false
+          },
+          {
+            "privilege_type":"x",
+            "privilege":true,
+            "with_grant":false
+          }
+        ]
+      }
+    ],
+    "test_schema_name": "test_schema",
+    "test_column":
+    [
+      {
+        "attname":"enme",
+        "datatype":"text",
+        "attnotnull":true,
+        "collname":"pg_catalog.\"default\"",
+        "is_tlength":false,
+        "is_precision":false
+      }
+    ],
+    "test_constraints": [],
+    "test_options": [],
+    "test_frs_name":  "test_foreign_server",
+    "test_name": "test_ft",
+    "test_owner":  "postgres",
+    "test_rel_acl":  [],
+    "test_sec_lable": [],
+    "test_str_acl": []
+  },
+
+    "test_FT_update_data":
+  {
+    "test_comment": "This is foreign table update comment"
+  }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
diff --git a/web/regression/test_nodes.py b/web/regression/test_nodes.py
new file mode 100644
index 0000000..9877a04
--- /dev/null
+++ b/web/regression/test_nodes.py
@@ -0,0 +1,40 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+import json
+from regression.test_utils import get_ids
+
+
+def test_getnodes(node=None):
+    # Connect to server and database.
+
+    if not node:
+        return None
+
+    all_id = get_ids()
+
+    server_id = all_id["sid"][0]
+    db_id = all_id["did"][0]
+    srv_grp = config_data['test_server_group']
+
+    response = node.tester.post('browser/server/connect/{0}/{1}'.format
+                                (srv_grp, server_id),
+                                data=dict(password=config_data
+                                ['test_server_credentials'][0]
+                                ['test_db_password']), follow_redirects=True)
+
+    con_response = node.tester.post('browser/database/connect/'
+                                    '{0}/{1}/{2}'.format
+                                    (srv_grp, server_id, db_id),
+                                    follow_redirects=True)
+
+    db_con = json.loads(con_response.data.decode())
+
+    return db_con
diff --git a/web/regression/test_utils.py b/web/regression/test_utils.py
new file mode 100644
index 0000000..abc06d0
--- /dev/null
+++ b/web/regression/test_utils.py
@@ -0,0 +1,19 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+import pickle
+
+
+def get_ids(url='/home/edb/Downloads/pgadmin4/web/regression/parent_id.pkl'):
+    # This function will read parent nodes id's and return it.
+
+    output = open(url, 'rb')
+    ids = pickle.load(output)
+    output.close()
+    return ids
\ No newline at end of file
diff --git a/web/regression/testsuite.py b/web/regression/testsuite.py
index 9ec7ffe..6d8e074 100644
--- a/web/regression/testsuite.py
+++ b/web/regression/testsuite.py
@@ -9,10 +9,12 @@
 
 """ This file collect all modules/files present in tests directory and add
 them to TestSuite. """
-
+from __future__ import print_function
 import os
 import sys
 import unittest
+import operator
+import logging
 from testscenarios.scenarios import generate_scenarios
 
 # We need to include the root directory in sys.path to ensure that we can
@@ -44,6 +46,21 @@ TestsGeneratorRegistry.load_generators('pgadmin')
 # application. We can trigger test request to the application.
 test_client = app.test_client()
 
+class StreamToLogger(object):
+    """
+    Fake file-like stream object that redirects writes to a logger instance.
+    """
+    def __init__(self, logger, log_level=logging.INFO):
+        self.logger = logger
+        self.log_level = log_level
+        self.linebuf = ''
+
+    def write(self, buf):
+        for line in buf.rstrip().splitlines():
+            self.logger.log(self.log_level, line.rstrip())
+
+    def flush(self):
+        pass
 
 def suite():
     """ Defining test suite which will execute all the testcases present in
@@ -58,6 +75,8 @@ def suite():
 
         modules.insert(gen.priority, gen)
 
+    modules.sort(key=operator.attrgetter('priority'))
+
     for m in modules:
         obj = m()
         obj.setTestClient(test_client)
@@ -66,7 +85,26 @@ def suite():
 
     return pgadmin_suite
 
-
 if __name__ == '__main__':
+
+    print("Please check output in file: logger.log placed at "
+          ".../pgadmin4/web/regression")
+
+    logging.basicConfig(level=logging.DEBUG,
+                        format='%(asctime)s:%(levelname)s:%(name)s:%(message)s',
+                        filename="logger.log",
+                        filemode='w'
+                        )
+
+    stdout_logger = logging.getLogger('STDOUT')
+    sl = StreamToLogger(stdout_logger, logging.INFO)
+    sys.stdout = sl
+
+    stderr_logger = logging.getLogger('STDERR')
+    sl = StreamToLogger(stderr_logger, logging.ERROR)
+    sys.stderr = sl
+
     suite = suite()
-    tests = unittest.TextTestRunner(descriptions=True, verbosity=2).run(suite)
+    tests = unittest.TextTestRunner(descriptions=True, verbosity=2,
+                                    stream=sys.stdout).run(suite)
+    os.remove("parent_id.pkl")

-- 
Sent via pgadmin-hackers mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

---

From: Dave Page <[email-masked]>
Date: Mon, 6 Jun 2016 09:33:15 +0100

Hi

> Kindly, review the same and let me know for any modification.

I took a very quick look at the patch and immediately saw a serious
problem I'm afraid - you cannot hard-code paths like this:

You need to dynamically generate such paths so this will work on any
machine. Look at line 19 of web/pgAdmin4.py to see how to get the
patch to the current file as an example.

Also; despite this not being part of the end-user interface, please
try to follow the standards for messages, e.g. instead of:

No event trigger(s) to update!!!

use

No event trigger(s) to update.

There is likely more to change of course, but please fix these issues first.

Thanks!

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

---

From: Priyanka Shendge <[email-masked]>
Date: Mon, 6 Jun 2016 14:09:13 +0530

On 6 June 2016 at 14:03, Dave Page <[email-masked]> wrote:

> +            if
> os.path.isfile('/home/edb/Downloads/pgadmin4/web/regression/'
> +                              'parent_id.pkl'):
Sure, i'll check and update accordingly.

> No event trigger(s) to update.
Noted. I will update for all applicable files.

> There is likely more to change of course, but please fix these issues
Sure.

Thank you.

-- 
Best,
Priyanka

EnterpriseDB Corporation

---

From: Priyanka Shendge <[email-masked]>
Date: Thu, 9 Jun 2016 18:07:08 +0530

Hi Dave,

PFA updated patch. I have made changes suggested by you.

Kindly, review and let me know for more changes.

On 6 June 2016 at 14:09, Priyanka Shendge <[email-masked]
> wrote:

-- 
Best,
Priyanka

EnterpriseDB Corporation

---

From: Dave Page <[email-masked]>
Date: Wed, 15 Jun 2016 09:39:03 +0100

Hi

> Kindly, review and let me know for more changes.

OK, I got a bit further this time, but not there yet.

1) The patch overwrote my test_config.json file. That should never
happen (that file shouldn't be in the source tree).
test_config.json.in should be the file that's included in the patch.

2) The updated test_config.json file is huge. I should only need to
define one or more connections, then be able to run the tests. If you
need to keep configuration info for "advanced users", let's put it in
a different file to avoid confusing/scaring everyone else. Maybe split
it into config.json for the stuff the user needs to edit
(config.json.in would go in git), and test_config.json for the test
configuration.

3) It fails on my machine, for what looks like a coding error
initially, then a lot of issues where it can't find parent_id.pkl.
I've attached the log.

Thanks.

---

From: Dave Page <[email-masked]>
Date: Wed, 15 Jun 2016 09:40:05 +0100

Ashesh - can you also look at the patch please (feel free to wait for
the update). I want more eyes on this.

Thanks.

---

From: Priyanka Shendge <[email-masked]>
Date: Wed, 15 Jun 2016 15:05:19 +0530

Thanks a lot Dave.

> test_config.json.in should be the file that's included in the patch.

OK.

> (config.json.in would go in git), and test_config.json for the test

Sure, i'll do that.

> initially, then a lot of issues where it can't find parent_id.pkl.

I'll check and send you  an updated patch.

-- 
Best,
Priyanka

EnterpriseDB Corporation

---

From: Priyanka Shendge <[email-masked]>
Date: Thu, 23 Jun 2016 19:11:55 +0530

On 15 June 2016 at 15:05, Priyanka Shendge <
[email-masked]> wrote:

>> 2) The updated test_config.json file is huge.
>
>
Current configuration file web/regression/test_config.json contains test
data(credentials) for each tree node;
which is used while adding and updating the respective node.

> I should only need to
Should i keep login and server credentials into
 web/regression/test_config.json file and
put respective node details into config.json file of respective node's
tests directory?

e.g. for database node:
I'll create config.json file into .../databases/tests/ directory
put database add and update credentials into config.json

-- 
Best,
Priyanka

EnterpriseDB Corporation

---

From: Dave Page <[email-masked]>
Date: Fri, 24 Jun 2016 11:47:21 +0100

Hi

On Thu, Jun 23, 2016 at 2:41 PM, Priyanka Shendge
<[email-masked]> wrote:
>
>
> On 15 June 2016 at 15:05, Priyanka Shendge

Why would we need that? We should have just one set of credentials for
everything.

> put respective node details into config.json file of respective node's tests
> directory?

Not if you expect users to need to edit them - and if not, why are the
values not just hard-coded?

> put database add and update credentials into config.json

The key here is to make it simple for users.

- To run the default tests, they should be able to copy/edit a simple
file, and just add database server details for the server to run
against.

- If we have configurable tests (because making them configurable adds
genuine value), then we can use an "advanced" config file to allow the
user to adjust settings as they want.

In the simple case, the user should be able to run the tests
successfully within a minute or two from starting.

In designing the layout for files etc, remember the following:

- Users should never edit a file that is in our source control. That's
why we have .in files that we expect them to copy.

- Unless they're an advanced user, they shouldn't need to copy the
config file for advanced options. That means that the tests should
have defaults that match what is in the template advanced config file
(or, the tests could read advanced.json.in if advanced.json doesn't
exist, though that does seem a little icky). Of course, those are
example filenames, not necessarily what you may choose.

---

From: Priyanka Shendge <[email-masked]>
Date: Sun, 26 Jun 2016 16:35:24 +0530

On 24 June 2016 at 16:17, Dave Page <[email-masked]> wrote:

> Why would we need that?

Each node file (e.g. test_db_add.py and test_db_put.py) uses respective
credentials  from
test_config.json while execution.

We should have just one set of credentials for
> everything.

Let me know if my understanding is clear:

Should i keep basic credentials of each node (database, schema) into
test_config.json
instead  taking care of each field?

> tests

-- 
Best,
Priyanka

EnterpriseDB Corporation

---

From: Dave Page <[email-masked]>
Date: Mon, 27 Jun 2016 08:54:03 +0100

> test_config.json while execution.

That doesn't answer my question - why do we need separate credentials
for each node?

> instead  taking care of each field?

You should have one set of credentials that's used for the entire test run.

---

From: Priyanka Shendge <[email-masked]>
Date: Mon, 27 Jun 2016 15:10:06 +0530

On 27 June 2016 at 13:24, Dave Page <[email-masked]> wrote:

> > credentials test data  from

Sorry for typo, its test data not credentials.

> You should have one set of credentials that's used for the entire test run.

Sure.  I'll separate the credentials and test data into 2 different files.
So, a normal user can run the tests into one go after some minor
credentials changes.
And an advanced user can have an option to change the test data if he wants.

-- 
Best,
Priyanka

EnterpriseDB Corporation

---

From: Priyanka Shendge <[email-masked]>
Date: Wed, 29 Jun 2016 19:22:11 +0530

Hi Dave,

As per discussion over mail i have created separate config files for
credentials
and test data.

PFA patch for same. Kindly, review and let me know for modifications.

-- 
Best,
Priyanka

EnterpriseDB Corporation

---

From: Dave Page <[email-masked]>
Date: Wed, 29 Jun 2016 20:21:03 +0100

Hi,

That's better. I tweaked a few things and fixed a bug related to
recent changes to the schema version config. Patch attached.

However, there are still issues:

1) The testsuite doesn't run to completion. See the attached
stdout.txt and logger.txt files.
2) stdout should only display the test summary - what tests are
currently running (and pass/fail), and a summary at the end - even if
there's a crash like I saw.
3) The output log file should contain the full output, including
what's sent to stdout.
4) The output advises the user to check ".../pgadmin4/web/regression".
This should be in the summary at the end, and should be corrected to
show the correct (full) path.

Thanks.

On Wed, Jun 29, 2016 at 2:52 PM, Priyanka Shendge
<[email-masked]> wrote:
> credentials and test data.
>
> On 27 June 2016 at 15:10, Priyanka Shendge

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/.gitignore b/.gitignore
index ec82803..b58ab47 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,6 +17,7 @@ runtime/ui_BrowserWindow.h
 runtime/.qmake.stash
 web/config_local.py
 web/regression/test_config.json
+web/regression/test_advanced_config.json
 pgadmin4.log
 *.swp
 *.swo
diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/tests/__init__.py
new file mode 100644
index 0000000..60ed4c7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/tests/__init__.py
@@ -0,0 +1,16 @@
+# ##########################################################################
+#
+# #pgAdmin 4 - PostgreSQL Tools
+#
+# #Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# #This software is released under the PostgreSQL Licence
+#
+# ##########################################################################
+
+from pgadmin.utils.route import BaseTestGenerator
+
+
+class DatabaseGenerateTestCase(BaseTestGenerator):
+
+    def runTest(self):
+        return
diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_add.py b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_add.py
new file mode 100644
index 0000000..4278383
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_add.py
@@ -0,0 +1,101 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data, advance_config_data, pickle_path
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+import pickle
+import uuid
+import os
+from regression.test_utils import get_ids
+
+
+class DatabaseAddTestCase(LoginTestCase):
+    """
+    This class will check server group node present on the object browser's
+    tree node by response code.
+    """
+    priority = 7
+
+    scenarios = [
+        # Fetching default URL for database node.
+        ('Check Databases Node URL', dict(url='/browser/database/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will add database under 1st server of tree node. """
+
+        srv_id = get_ids()
+
+        server_id = srv_id["sid"][0]
+        srv_grp = config_data['test_server_group']
+
+        response = self.tester.post('browser/server/connect/' + str(srv_grp) +
+                                    '/' + server_id,
+                                    data=dict(
+                                    password=config_data
+                                    ['test_server_credentials'][0]
+                                    ['test_db_password']),
+                                    follow_redirects=True)
+
+        self.assertEquals(response.status_code, 200)
+
+        srv_connect = json.loads(response.data.decode())
+
+        if srv_connect['data']['connected']:
+
+            data = {
+                     "datacl": advance_config_data['test_add_database_data'][0]
+                     ['test_privileges_acl'],
+                     "datconnlimit": advance_config_data
+                     ['test_add_database_data'][0]['test_conn_limit'],
+                     "datowner": advance_config_data
+                     ['test_add_database_data'][0]['test_owner'],
+                     "deffuncacl": advance_config_data
+                     ['test_add_database_data'][0]['test_fun_acl'],
+                     "defseqacl": advance_config_data
+                     ['test_add_database_data'][0]['test_seq_acl'],
+                     "deftblacl": advance_config_data
+                     ['test_add_database_data'][0]['test_tbl_acl'],
+                     "deftypeacl": advance_config_data
+                     ['test_add_database_data'][0]['test_type_acl'],
+                     "encoding": advance_config_data
+                     ['test_add_database_data'][0]['test_encoding'],
+                     "name": str(uuid.uuid4())[1:8],
+                     "privileges": advance_config_data
+                     ['test_add_database_data'][0]['test_privileges'],
+                     "securities": advance_config_data
+                     ['test_add_database_data'][0]['test_securities'],
+                     "variables": advance_config_data
+                     ['test_add_database_data'][0]['test_variables']
+                    }
+
+            db_response = self.tester.post(self.url + str(srv_grp) + "/" +
+                                           server_id + "/",
+                                           data=json.dumps(data),
+                                           content_type='html/json')
+
+            self.assertTrue(db_response.status_code, 200)
+
+            respdata = json.loads(db_response.data.decode())
+
+            db_id = respdata['node']['_id']
+
+            if os.path.isfile(pickle_path):
+
+                exst_server_id = open(pickle_path, 'rb')
+
+                tol_server_id = pickle.load(exst_server_id)
+                pickle_id_dict = tol_server_id
+
+                pickle_id_dict["did"].append(db_id)
+
+                db_output = open(pickle_path, 'wb')
+                pickle.dump(pickle_id_dict, db_output)
+                db_output.close()
diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_delete.py b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_delete.py
new file mode 100644
index 0000000..ca8ed9b
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_delete.py
@@ -0,0 +1,45 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+from regression.test_nodes import test_getnodes
+from regression.test_utils import get_ids
+
+
+class DatabaseDeleteTestCase(LoginTestCase):
+    """ This class will delete the database under last added server. """
+
+    priority = 98
+
+    scenarios = [
+        # Fetching default URL for database node.
+        ('Check Databases Node URL', dict(url='/browser/database/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will delete the database."""
+
+        all_id = get_ids()
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if len(db_con) == 0:
+            raise Exception("No database(s) to delete.")
+
+        response = self.tester.delete(self.url + str(srv_grp) + '/' +
+                                      str(server_id) + '/' + str(db_id),
+                                      follow_redirects=True)
+
+        respdata = json.loads(response.data.decode())
+        self.assertTrue(respdata['success'], 1)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_get.py b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_get.py
new file mode 100644
index 0000000..e931985
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_get.py
@@ -0,0 +1,43 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.test_nodes import test_getnodes
+from regression.test_utils import get_ids
+
+
+class DatabasesGetTestCase(LoginTestCase):
+    """
+    This class will fetch added database under server node.
+    """
+    priority = 8
+
+    scenarios = [
+        # Fetching default URL for database node.
+        ('Check Databases Node URL', dict(url='/browser/database/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will fetch added database. """
+
+        all_id = get_ids()
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            response = self.tester.get(self.url + str(srv_grp) + '/' +
+                                       str(server_id) + '/' + str(db_id),
+                                       follow_redirects=True)
+
+            self.assertEquals(response.status_code, 200)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_put.py b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_put.py
new file mode 100644
index 0000000..ad83603
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_put.py
@@ -0,0 +1,51 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data,  advance_config_data
+from pgadmin.browser.tests.test_login import LoginTestCase
+import json
+from regression.test_utils import get_ids
+from regression.test_nodes import test_getnodes
+
+
+class DatabasesUpdateTestCase(LoginTestCase):
+    """
+    This class will update the database under last added server.
+    """
+    priority = 9
+
+    scenarios = [
+        # Fetching default URL for database node.
+        ('Check Databases Node', dict(url='/browser/database/obj/'))
+    ]
+
+    def runTest(self):
+        """ This function will update the comments field of database."""
+
+        all_id = get_ids()
+        server_id = all_id["sid"][0]
+        db_id = all_id["did"][0]
+        srv_grp = config_data['test_server_group']
+
+        db_con = test_getnodes(node=self)
+
+        if db_con['data']["connected"]:
+
+            data = {
+                "comments": advance_config_data["test_db_update_data"][0]
+                ["test_comment"],
+                "id": db_id
+                   }
+
+            put_response = self.tester.put(self.url + str(srv_grp) + '/' +
+                                           str(server_id) + '/' + str(db_id),
+                                           data=json.dumps(data),
+                                           follow_redirects=True)
+
+            self.assertEquals(put_response.status_code, 200)
diff --git a/web/pgadmin/browser/server_groups/servers/tests/__init__.py b/web/pgadmin/browser/server_groups/servers/tests/__init__.py
index 28cdb94..4fd2066 100644
--- a/web/pgadmin/browser/server_groups/servers/tests/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/tests/__init__.py
@@ -12,4 +12,4 @@ from pgadmin.utils.route import BaseTestGenerator
 
 class ServerGenerateTestCase(BaseTestGenerator):
     def runTest(self):
-        print ("In ServerGenerateTestCase...")
+        return
diff --git a/web/pgadmin/browser/server_groups/servers/tests/test_server_add.py b/web/pgadmin/browser/server_groups/servers/tests/test_server_add.py
index 0af13d3..7499b85 100644
--- a/web/pgadmin/browser/server_groups/servers/tests/test_server_add.py
+++ b/web/pgadmin/browser/server_groups/servers/tests/test_server_add.py
@@ -8,16 +8,14 @@
 # ##########################################################################
 
 import json
-
+import pickle
+import os
 from pgadmin.browser.tests.test_login import LoginTestCase
-from regression.config import config_data
+from regression.config import config_data, pickle_path

     priority = 4
 
@@ -27,14 +25,19 @@ class ServersAddTestCase(LoginTestCase):
     ]
 
     def runTest(self):
-        """
+        pickle_id_dict = \
+            {
+                "sid": [],  # server
+                "did": []   # database
+            }

         for srv in config_data['test_server_credentials']:
+
             data = {"name": srv['test_name'],
                     "comment": "",
                     "host": srv['test_host'],
@@ -44,10 +47,20 @@ class ServersAddTestCase(LoginTestCase):
                     "role": "",
                     "sslmode": srv['test_sslmode']}
 
-            url = self.url + str(srv_grp) + "/"
-
-            response = self.tester.post(url, data=json.dumps(data),
+            response = self.tester.post(self.url + str(srv_grp) + "/",
+                                        data=json.dumps(data),
                                         content_type='html/json')
+
             self.assertTrue(response.status_code, 200)
-            respdata = json.loads(response.data)
-            self.assertTrue(respdata['node']['label'], srv['test_name'])
+            respdata = json.loads(response.data.decode())
+
+            server_id = respdata['node']['_id']
+
+            if os.path.isfile(pickle_path):
+                exst_server_id = open(pickle_path, 'rb')
+                pickle_id_dict = pickle.load(exst_server_id)
+
+            pickle_id_dict["sid"].append(server_id)
+            output = open(pickle_path, 'wb')
+            pickle.dump(pickle_id_dict, output)
+            output.close()
diff --git a/web/pgadmin/browser/server_groups/servers/tests/test_server_delete.py b/web/pgadmin/browser/server_groups/servers/tests/test_server_delete.py
index 329d74f..997308e 100644
--- a/web/pgadmin/browser/server_groups/servers/tests/test_server_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/tests/test_server_delete.py
@@ -8,17 +8,14 @@
 # ##################################################################
 
 import json
-

-    priority = 7
 
     scenarios = [
         # Fetching the default url for server node
@@ -26,32 +23,22 @@ class ServersDeleteTestCase(LoginTestCase):
     ]
 
     def runTest(self):
-        """

 
 
+            raise Exception("No server(s) to delete.")

-import json
-

 
     def runTest(self):
-        """
 
+        all_id = get_ids()
 
index 306bb03..f8cef24 100644
 
 import json
-

     priority = 6
 
@@ -27,39 +24,41 @@ class ServersUpdateTestCase(LoginTestCase):
     ]
 
     def runTest(self):
-        """
 
+        all_id = get_ids()

+                                        data=dict(password=
+                                                  config_data

-            response = self.tester.get(url, data=json.dumps(data),
-                                       content_type='html/json')
+        if len(srv_con) == 0:
+            raise Exception("No Server(s) connected to update.")

 
 
-                for server in config_data['test_server_update_data']:
-                    data = {"comment": server['test_comment']}
-                    response = self.tester.put(url, data=json.dumps(data),
-                                               content_type='html/json')
-                    self.assertTrue(response.status_code, 200)
-                    respdata = json.loads(response.data)
-                    self.assertTrue(respdata['success'], 1)
+        respdata = json.loads(put_response.data.decode())
+        self.assertTrue(respdata['success'], 1)
diff --git a/web/pgadmin/browser/server_groups/tests/test_sg_add.py b/web/pgadmin/browser/server_groups/tests/test_sg_add.py
deleted file mode 100644
index e70bb65..0000000
--- a/web/pgadmin/browser/server_groups/tests/test_sg_add.py
+++ /dev/null
@@ -1,36 +0,0 @@
-###########################################################################
-#
-# pgAdmin 4 - PostgreSQL Tools
-#
-# Copyright (C) 2013 - 2016, The pgAdmin Development Team
-# This software is released under the PostgreSQL Licence
-#
-###########################################################################
-
-import json
-
-from pgadmin.browser.tests.test_login import LoginTestCase
-from regression.config import config_data
-
-
-class SgNodeTestCase(LoginTestCase):
-    """
-     This class will check available server groups in pgAdmin.
-    """
-
-    priority = 1
-
-    scenarios = [
-        # Fetching the default url for server group node
-        ('Check Server Group Node', dict(url='/browser/server-group/obj/'))
-    ]
-
-    def runTest(self):
-        """This function will check available server groups."""
-
-        i = config_data['test_server_group']
-
-        response = self.tester.get(self.url + str(i), content_type='html/json')
-        self.assertTrue(response.status_code, 200)
-        respdata = json.loads(response.data)
-        self.assertTrue(respdata['id'], i)
diff --git a/web/pgadmin/browser/server_groups/tests/test_sg_get.py b/web/pgadmin/browser/server_groups/tests/test_sg_get.py
new file mode 100644
index 0000000..c552d8e
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/tests/test_sg_get.py
@@ -0,0 +1,36 @@
+###########################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+###########################################################################
+
+import json
+from pgadmin.browser.tests.test_login import LoginTestCase
+from regression.config import config_data
+
+
+class SgGetTestCase(LoginTestCase):
+    """
+     This class will check available server groups in pgAdmin.
+    """
+
+    priority = 3
+
+    scenarios = [
+        # Fetching the default url for server group node
+        ('Check Server Group Node', dict(url='/browser/server-group/obj/'))
+    ]
+
+    def runTest(self):
+        """This function will check available server groups."""
+
+        srv_grp = config_data['test_server_group']
+
+        response = self.tester.get(self.url + str(srv_grp),
+                                   content_type='html/json')
+        self.assertEquals(response.status_code, 200)
+        respdata = json.loads(response.data.decode())
+        self.assertTrue(respdata['id'], srv_grp)
diff --git a/web/pgadmin/browser/tests/__init__.py b/web/pgadmin/browser/tests/__init__.py
index 2381efd..4470711 100644
--- a/web/pgadmin/browser/tests/__init__.py
+++ b/web/pgadmin/browser/tests/__init__.py
@@ -11,5 +11,6 @@ from pgadmin.utils.route import BaseTestGenerator

 class BrowserGenerateTestCase(BaseTestGenerator):
+
     def runTest(self):
-        print ("In BrowserGenerateTestCase...")
+        return
diff --git a/web/pgadmin/browser/tests/test_change_password.py b/web/pgadmin/browser/tests/test_change_password.py
index dedb7d9..5c4930d 100644
--- a/web/pgadmin/browser/tests/test_change_password.py
+++ b/web/pgadmin/browser/tests/test_change_password.py
@@ -85,10 +85,10 @@ class ChangePasswordTestCase(LoginTestCase):
         """This function will check change password functionality."""
 
         response = self.tester.get('/change', follow_redirects=True)
-        self.assertIn('pgAdmin 4 Password Change', response.data)
+        self.assertIn('pgAdmin 4 Password Change', response.data.decode('utf8'))
         response = self.tester.post('/change', data=dict(
             password=self.password,
             new_password=self.new_password,
             new_password_confirm=self.new_password_confirm),
                                     follow_redirects=True)
-        self.assertIn(self.respdata, response.data)
+        self.assertIn(self.respdata, response.data.decode('utf8'))
diff --git a/web/pgadmin/browser/tests/test_login.py b/web/pgadmin/browser/tests/test_login.py
index 7c2b796..d272a63 100644
--- a/web/pgadmin/browser/tests/test_login.py
+++ b/web/pgadmin/browser/tests/test_login.py
@@ -8,7 +8,6 @@
 ##########################################################################
 
 import uuid
-

     def runTest(self):
@@ -76,4 +77,4 @@ class LoginTestCase(BaseTestGenerator):
         response = self.tester.post('/login', data=dict(
             email=self.email, password=self.password),
                                     follow_redirects=True)
-        self.assertIn(self.respdata, response.data)
+        self.assertIn(self.respdata, response.data.decode('utf8'))
diff --git a/web/pgadmin/browser/tests/test_logout.py b/web/pgadmin/browser/tests/test_logout.py
index 8971e72..d9611ae 100644
--- a/web/pgadmin/browser/tests/test_logout.py
+++ b/web/pgadmin/browser/tests/test_logout.py
@@ -14,14 +14,13 @@ from regression.config import config_data
 class LogoutTest(LoginTestCase):
     """
     This class verifies the logout functionality; provided the user is already
-    logged-in. Dictionary parameters define the scenario appended by test
-    name.
+    logged-in.
     """
 
-    priority = 3
+    priority = 100
 
     scenarios = [
-        # This test case validate the logout page
+        # This test case validate the logout page.
         ('Logging Out', dict(respdata='Redirecting...'))
     ]
 
@@ -29,7 +28,7 @@ class LogoutTest(LoginTestCase):
         """This function checks the logout functionality."""
 
         response = self.tester.get('/logout')
-        self.assertIn(self.respdata, response.data)
+        self.assertIn(self.respdata, response.data.decode('utf8'))
 
     def tearDown(self):
         """
diff --git a/web/pgadmin/browser/tests/test_reset_password.py b/web/pgadmin/browser/tests/test_reset_password.py
index 030b182..31a3992 100644
--- a/web/pgadmin/browser/tests/test_reset_password.py
+++ b/web/pgadmin/browser/tests/test_reset_password.py
@@ -41,8 +41,9 @@ class ResetPasswordTestCase(BaseTestGenerator):
         """This function checks reset password functionality."""
 
         response = self.tester.get('/reset')
-        self.assertIn('Recover pgAdmin 4 Password', response.data)
+        self.assertIn('Recover pgAdmin 4 Password',
+                      response.data.decode('utf8'))
         response = self.tester.post(
             '/reset', data=dict(email=self.email),
             follow_redirects=True)
-        self.assertIn(self.respdata, response.data)
+        self.assertIn(self.respdata, response.data.decode('utf8'))
diff --git a/web/pgadmin/utils/route.py b/web/pgadmin/utils/route.py
index fb9de69..e439965 100644
--- a/web/pgadmin/utils/route.py
+++ b/web/pgadmin/utils/route.py
@@ -52,7 +52,10 @@ class TestsGeneratorRegistry(ABCMeta):
         from werkzeug.utils import find_modules

 import six
diff --git a/web/regression/README b/web/regression/README
index e0003e4..0751661 100644
--- a/web/regression/README
+++ b/web/regression/README
@@ -40,23 +40,25 @@ General Information
     3. test_server_get.py
     4. test_server_update.py
 
-2) The pgAdmin4 source tree includes a file template for the server configuration
-   named ‘test_config.json.in' in the ‘pgAdmin4/web/regression’ directory. After
-   completing the pgAdmin4 configuration, you must make a working copy of the
-   template called test_config.json before modifying the file contents.
+2) The pgAdmin4 source tree includes 2 different configuration file templates.
+   One file template for the server configuration named ‘test_config.json.in'
+   and another for test configuration named 'test_advanced_config.json.in' in
+   the ‘pgAdmin4/web/regression’ directory. After completing the pgAdmin4
+   configuration, you must make a working copy of the templates called
+   test_config.json and test_advance_config.json before modifying the file contents.
 
 	2a) The following command copies the test_config.json.in file, creating a
-	    configuration file named test_config.json
+	    configuration file named test_config.json (same way user can copy
+	    test_advance_config.json.in file into test_advance_config.json)
 
             # cp pgadmin4/web/regression/test_config.json.in \
               pgadmin4/web/regression/test_config.json
 
-	2b) After creating the server configuration file, add (or modify)
-	    parameter values as per requirements. The configuration
-	    files are owned by root/user. The pgAdmin4 regression framework expects
-	    to find the files in the  directory '/<installation dir>/web/regression/'.
-	    If you move the file to another location, you must create a symbolic link
-	    that specifies the new location.
+	2b) After creating the server and test configuration file, add (or modify)
+	    parameter values as per requirements. The pgAdmin4 regression framework
+	    expects to find the files in the  directory
+	    '/<installation dir>/web/regression/'. If you move the file to another
+	    location, you must create a symbolic link that specifies the new location.
 
 	2c) Specifying Server Configuration file:
 
@@ -64,6 +66,13 @@ General Information
 	    server details and connection properties as per their local setup. The
 	    test_config file is in json format and property values are case-sensitive.
 
+	2d) Specifying the Test Configuration file:
+
+	    The user can add/change test data as per their need. The
+	    test_advanced_config file is in json format and property values are
+	    case-sensitive.
+
+
 Test Data Details
 -----------------
 
diff --git a/web/regression/config.py b/web/regression/config.py
index bef65fb..80686a1 100644
--- a/web/regression/config.py
+++ b/web/regression/config.py
@@ -14,3 +14,8 @@ root = os.path.dirname(os.path.realpath(__file__))
 
 with open(root + '/test_config.json') as data_file:
     config_data = json.load(data_file)
+
+with open(root + '/test_advanced_config.json') as data_file:
+    advance_config_data = json.load(data_file)
+
+pickle_path = os.path.join(root, 'parent_id.pkl')
diff --git a/web/regression/parent_id.pkl b/web/regression/parent_id.pkl
new file mode 100644
index 0000000..f4ab4ee
--- /dev/null
+++ b/web/regression/parent_id.pkl
@@ -0,0 +1,14 @@
+(dp0
+S'did'
+p1
+(lp2
+I158545
+aI158546
+asS'sid'
+p3
+(lp4
+V3
+p5
+aV5
+p6
+as.
\ No newline at end of file
diff --git a/web/regression/test_advanced_config.json.in b/web/regression/test_advanced_config.json.in
new file mode 100644
index 0000000..3729bcb
--- /dev/null
+++ b/web/regression/test_advanced_config.json.in
@@ -0,0 +1,105 @@
+{
+  "test_add_database_data": [
+   {
+    "test_privileges_acl": [
+      {
+        "grantee": "postgres",
+        "grantor": "postgres",
+        "privileges": [
+          {
+            "privilege_type": "C",
+            "privilege": true,
+            "with_grant": true
+          },
+          {
+            "privilege_type": "T",
+            "privilege": true,
+            "with_grant": false
+          }
+        ]
+      }
+    ],
+    "test_conn_limit": -1,
+    "test_owner": "postgres",
+    "test_fun_acl": [
+      {
+        "grantee": "postgres",
+        "grantor": "postgres",
+        "privileges": [
+          {
+            "privilege_type": "X",
+            "privilege": true,
+            "with_grant": false
+          }
+        ]
+      }
+    ],
+    "test_seq_acl": [
+      {
+        "grantee": "postgres",
+        "grantor": "postgres",
+        "privileges": [
+          {
+            "privilege_type": "r",
+            "privilege": true,
+            "with_grant": false
+          },
+          {
+            "privilege_type": "w",
+            "privilege": true,
+            "with_grant": false
+          },
+          {
+            "privilege_type": "U",
+            "privilege": true,
+            "with_grant": false
+          }
+        ]
+      }
+    ],
+    "test_tbl_acl": [
+      {
+        "grantee": "postgres",
+        "grantor": "postgres",
+        "privileges": [
+          {
+            "privilege_type": "a",
+            "privilege": true,
+            "with_grant": true
+          },
+          {
+            "privilege_type": "r",
+            "privilege": true,
+            "with_grant": false
+          }
+        ]
+      }
+    ],
+    "test_type_acl": [
+      {
+        "grantee": "postgres",
+        "grantor": "postgres",
+        "privileges": [
+          {
+            "privilege_type": "U",
+            "privilege": true,
+            "with_grant": false
+          }
+        ]
+      }
+    ],
+    "test_encoding": "UTF8",
+    "test_name": "test_db_automation",
+    "test_privileges": [],
+    "test_securities": [],
+    "test_variables": []
+  }
+ ],
+
+  "test_db_update_data": [
+  {
+      "test_comment": "This is db update comment"
+  }
+ ]
+
+}
diff --git a/web/regression/test_nodes.py b/web/regression/test_nodes.py
new file mode 100644
index 0000000..b3fd5ef
--- /dev/null
+++ b/web/regression/test_nodes.py
@@ -0,0 +1,42 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+from regression.config import config_data
+import json
+from regression.test_utils import get_ids
+
+
+def test_getnodes(node=None):
+    # Connect to server and database.
+
+    if not node:
+        return None
+
+    all_id = get_ids()
+
+    server_id = all_id["sid"][0]
+    db_id = all_id["did"][0]
+    srv_grp = config_data['test_server_group']
+
+    # Connect to server
+    response = node.tester.post('browser/server/connect/{0}/{1}'.format
+                                (srv_grp, server_id),
+                                data=dict(password=config_data
+                                ['test_server_credentials'][0]
+                                ['test_db_password']), follow_redirects=True)
+
+    # Connect to database
+    con_response = node.tester.post('browser/database/connect/'
+                                    '{0}/{1}/{2}'.format
+                                    (srv_grp, server_id, db_id),
+                                    follow_redirects=True)
+
+    db_con = json.loads(con_response.data.decode())
+
+    return db_con
diff --git a/web/regression/test_utils.py b/web/regression/test_utils.py
new file mode 100644
index 0000000..c68744f
--- /dev/null
+++ b/web/regression/test_utils.py
@@ -0,0 +1,20 @@
+# #################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+# ##################################################################
+
+import pickle
+from regression.config import pickle_path
+
+
+def get_ids(url=pickle_path):
+    # This function will read parent nodes id's from pickle and return it.
+
+    output = open(url, 'rb')
+    ids = pickle.load(output)
+    output.close()
+    return ids
diff --git a/web/regression/testsuite.py b/web/regression/testsuite.py
index 6e6fb0c..9f076c2 100644
--- a/web/regression/testsuite.py
+++ b/web/regression/testsuite.py
@@ -13,7 +13,8 @@ them to TestSuite. """
 import os
 import sys
 import unittest
-
+import operator
+import logging
 from testscenarios.scenarios import generate_scenarios
 
 # We need to include the root directory in sys.path to ensure that we can
@@ -24,6 +25,13 @@ root = os.path.dirname(current_path)
 if sys.path[0] != root:
     sys.path.insert(0, root)
 
+import config
+
+# Get the config database schema version. We store this in pgadmin.model
+# as it turns out that putting it in the config files isn't a great idea
+from pgadmin.model import SCHEMA_VERSION
+config.SETTINGS_SCHEMA_VERSION = SCHEMA_VERSION
+
 from pgadmin import create_app
 
 # Create the app!
@@ -45,6 +53,22 @@ TestsGeneratorRegistry.load_generators('pgadmin')
 # application. We can trigger test request to the application.
 test_client = app.test_client()

 def suite():
     """ Defining test suite which will execute all the testcases present in
@@ -59,6 +83,8 @@ def suite():

+    modules.sort(key=operator.attrgetter('priority'))
+
     for m in modules:
         obj = m()
         obj.setTestClient(test_client)
@@ -69,5 +95,25 @@ def suite():

---

From: Priyanka Shendge <[email-masked]>
Date: Mon, 4 Jul 2016 16:46:34 +0530

Hi Dave,

I am unable to reproduce issue on my side; tried on Python 2.7 and Python
3.4.
Could you please provide me DEBUG logs and test data using for database
node?

Thank you.

On 30 June 2016 at 00:51, Dave Page <[email-masked]> wrote:

> >>> >> > Current configuration file web/regression/test_config.json
> contains
> >>> >> > test
> >>> >> >>> define one or more connections, then be able to run the tests.
> If
> >>> >> >>> you
> >>> >> >>> need to keep configuration info for "advanced users", let's put
> it
> >>> >> >>> in

-- 
Best,
Priyanka

EnterpriseDB Corporation

---

From: Dave Page <[email-masked]>
Date: Mon, 4 Jul 2016 13:00:37 +0100

Hi

The test data was the default, and I ran against PG 9.4. All other logs were attached to my previous email.

EnterpriseDB UK:http://www.enterprisedb.com
The Enterprise PostgreSQL Company

> On 4 Jul 2016, at 12:16, Priyanka Shendge <[email-masked]> wrote:
> 
> Hi Dave,
> 
> I am unable to reproduce issue on my side; tried on Python 2.7 and Python 3.4.
> Could you please provide me DEBUG logs and test data using for database node? 
> 
> Thank you.
>

---

From: Priyanka Shendge <[email-masked]>
Date: Tue, 5 Jul 2016 13:30:17 +0530

Hi Dave,

I tried running the testsuite against PG9.4 and unable to reproduce the
failures.
I have added debug statements to previous patch. Patch attached.
Could you please re-run the same and send me the logs and output?

Thank you.

On 4 July 2016 at 17:30, Dave Page <[email-masked]> wrote:

> On 4 Jul 2016, at 12:16, Priyanka Shendge <
>> >>> >> >>> need to keep configuration info for "advanced users", let's
>> put it
>> >>> >> >>> in
>> >>> >> >>> a different file to avoid confusing/scaring everyone else.
>> Maybe
>> >>> >> >>> split

-- 
Best,
Priyanka

EnterpriseDB Corporation

---

From: Dave Page <[email-masked]>
Date: Tue, 5 Jul 2016 11:10:32 +0100

Attached.

On Tue, Jul 5, 2016 at 9:00 AM, Priyanka Shendge
<[email-masked]> wrote:
>> On 4 Jul 2016, at 12:16, Priyanka Shendge
>>> >>> You should have one set of credentials that's used for the entire
>>> >>> test
>>> >>> run.
>>> >>
>>> >>

---

From: Priyanka Shendge <[email-masked]>
Date: Fri, 8 Jul 2016 15:08:14 +0530

Hi Dave,

I have tried to reproduce the issue by running the test-suite on different
machines (64 and 32 bit) and
users on PG9.4/9.5 (Provided different "test_db_username" in
test_config.json). It is working fine at my end.

The log file (output.log) sent by you shows following query is failing at
your end:

SELECT
    db.oid as did, db.datname, db.datallowconn,
    pg_encoding_to_char(db.encoding) AS serverencoding,
    has_database_privilege(db.oid, 'CREATE') as cancreate, datlastsysoid
FROM
    pg_database db
WHERE db.oid =

Let me know if you have an extra system where I can reproduce the issue.

On 5 July 2016 at 15:40, Dave Page <[email-masked]> wrote:

> >>> >>> >> >>> test_config.json.in should be the file that's included in
> the
> >>> >>> >> >>> patch.
> >>> >>> >> >>
> >>> >>> >> >>
> >>> >>> >> >> OK.
> >>> >>> >> >>>
> >>> >>> >> >>>
> >>> >> And an advanced user can have an option to change the test data if
> he
> >>> >> wants.
> >>> >>>
> >>> >>>
> >>> >>> >> >>> I should only need to
> >>> >>> >> >>> (config.json.in would go in git), and test_config.json for
> the
> >>> >>> >> >>> test
> >>> >>> >> >>> configuration.
> >>> >>> >> >
> >>> >>> >> >
> >>> >>> >> > put respective node details into config.json file of
> respective
> >>> >>> >> > node's
> >>> >>> >> > tests
> >>> >>> >> > directory?
> >>> >>> >>
> >>> >>> >> Not if you expect users to need to edit them - and if not, why
> are
> >>> >>> >> the
> >>> >>> >> - If we have configurable tests (because making them
> configurable
> >>> >>> >> adds
> >>> >>> >> genuine value), then we can use an "advanced" config file to
> allow
> >>> >>> >> the

-- 
Best,
Priyanka

EnterpriseDB Corporation

---

From: Dave Page <[email-masked]>
Date: Mon, 11 Jul 2016 12:48:14 +0100

Hi,

No, sorry I don't have an extra system you can test on.

It's pretty clear that query would fail - it's missing a database OID
after the =

On Fri, Jul 8, 2016 at 10:38 AM, Priyanka Shendge
<[email-masked]> wrote:
>> >>> >>> >> >>> 1) The patch overwrote my test_config.json file. That
>> >>> >>> >> >>> should
>> >>> >>> >> >>> never
>> >>> >>> >> have defaults that match what is in the template advanced
>> >>> >>> >> config
>> >>> >>> >> file

---

From: Priyanka Shendge <[email-masked]>
Date: Mon, 11 Jul 2016 17:55:24 +0530

Sorry, by mistake i copied incomplete query.  There is an OID present for
added database.

SELECT
WHERE db.oid = 158579

On 11 July 2016 at 17:18, Dave Page <[email-masked]> wrote:

> >> >> The test data was the default, and I ran against PG 9.4. All other
> logs
> >> >> were attached to my previous email.
> >> >>
> >> >> --
> >> >> Dave Page
> >> >>> >>> > Should i keep basic credentials of each node (database,
> schema)
> >> >>> >>> > into
> >> >>> >>> > test_config.json
> >> >>> >> Sure.  I'll separate the credentials and test data into 2
> different
> >> >>> >> files.
> >> >>> >>> >> - To run the default tests, they should be able to copy/edit
> a
> >> >>> >>> >> simple
> >> >>> >>> >> - Users should never edit a file that is in our source
> control.
> >> >>> >>> >> That's
> >> >>> >>> >> - Unless they're an advanced user, they shouldn't need to
> copy
> >> >>> >>> >> the

-- 
Best,
Priyanka

EnterpriseDB Corporation

---

From: Dave Page <[email-masked]>
Date: Mon, 11 Jul 2016 14:05:48 +0100

>     has_database_privilege(db.oid, 'CREATE') as cancreate, datlastsysoid

There's nothing wrong with that query. Can you work with Khushboo to
see if she can reproduce or help figure it out please?

Thanks.

>> >> >>> >>> >> exist, though that does seem a little icky). Of course,
>> >> >>> >>> >> those
>> >> >>> >>> >> are

---

From: Priyanka Shendge <[email-masked]>
Date: Mon, 11 Jul 2016 19:15:11 +0530

> see if she can reproduce or help figure it out please?

I had work with Khushboo, she also tried to reproduce the issue at her it's
working fine for her.
Khushboo also tried to troubleshoot/trace the issue but not able to figure
out where exactly its failing;
as issue was not reproducible.

@Khushboo:
 Please add if i am missing anything.

> >> >> >>> currently running (and pass/fail), and a summary at the end -
> even
> >> >> >>> if
> >> >> >>> > As per discussion over mail i have created separate config
> files
> >> >> >>> > for
> >> >> >>> >>> >> >> On 15 June 2016 at 14:09, Dave Page <[email-masked]
> >
> >> >> >>> >>> >> >> wrote:
> >> >> >>> >>> >> >>>
> >> >> >>> >>> >> >>> Hi
> >> >> >>> >>> >> >>>
> >> >> >>> >>> >> >>> test_config.json.in should be the file that's
> included
> >> >> >>> >>> >> >>> in
> >> >> >>> >>> >> >>> the
> >> >> >>> >>> >> >>> patch.
> >> >> >>> >>> >> >>
> >> >> >>> >>> >> >>
> >> >> >>> >>> >> >> OK.
> >> >> >>> >>> >> >>>
> >> >> >>> >>> >> >>>
> >> >> >>> >>> > Each node file (e.g. test_db_add.py and test_db_put.py)
> uses
> >> >> >>> >>> > respective
> >> >> >>> >> And an advanced user can have an option to change the test
> data
> >> >> >>> >> if
> >> >> >>> >> he
> >> >> >>> >> wants.
> >> >> >>> >>>
> >> >> >>> >>>
> >> >> >>> >>> >> >>> I should only need to
> >> >> >>> >>> >> >>> define one or more connections, then be able to run
> the
> >> >> >>> >>> >> >>> tests.
> >> >> >>> >>> >> >>> If
> >> >> >>> >>> >> >>> you
> >> >> >>> >>> >> >>> (config.json.in would go in git), and
> test_config.json
> >> >> >>> >>> >> >>> for
> >> >> >>> >>> >> >>> the
> >> >> >>> >>> >> >>> test
> >> >> >>> >>> >> >>> configuration.
> >> >> >>> >>> >> >
> >> >> >>> >>> >> >
> >> >> >>> >>> >> file, and just add database server details for the server
> to
> >> >> >>> >>> >> run
> >> >> >>> >>> >> against.
> >> >> >>> >>> >>
> >> >> >>> >>> >> config file for advanced options. That means that the
> tests
> >> >> >>> >>> >> should
> >> >> >>> >>> >> (or, the tests could read advanced.json.in if
> advanced.json
> >> >> >>> >>> >> doesn't

-- 
Best,
Priyanka

EnterpriseDB Corporation

---

From: Khushboo Vashi <[email-masked]>
Date: Tue, 12 Jul 2016 09:44:16 +0530

On Mon, Jul 11, 2016 at 7:15 PM, Priyanka Shendge <
[email-masked]> wrote:

> I had work with Khushboo, she also tried to reproduce the issue at her
> it's working fine for her.

We have tried to reproduce this issue at our end several times with the
different scenarios but every attempt was unsuccessful.

Here the newly created database connection is failing which should not as
the database is created properly as per the log.
The above query (mentioned by Priyanka) executes from the psycopg2 driver
and could fail in 2 scenarios, either the database has been dropped before
this particular test-case runs or the database is not created properly
through the 'create database test-case'.  But as per the log, the 'delete
database test-case' runs after this test-case and the database is created
properly.

Can any privilege issue prevent the database connection in this scenario?

Thanks,
Khushboo

>> >> > The log file (output.log) sent by you shows following query is
>> failing
>> >> > at
>> >> > your end:
>> >> >
>> >> > SELECT
>> >> >> > I tried running the testsuite against PG9.4 and unable to
>> reproduce
>> >> >> > the
>> >> >> > failures.
>> >> >> >> I am unable to reproduce issue on my side; tried on Python 2.7
>> and
>> >> >> >> Python
>> >> >> >> 3.4.
>> >> >> >>> This should be in the summary at the end, and should be
>> corrected
>> >> >> >>> to
>> >> >> >>> >>> >> >> On 15 June 2016 at 14:09, Dave Page <
>> [email-masked]>
>> >> >> >>> >>> >> >> wrote:
>> >> >> >>> >>> >> >>>
>> >> >> >>> >>> >> >>> Hi
>> >> >> >>> >>> >> >>>
>> >> >> >>> >>> >> Not if you expect users to need to edit them - and if
>> not,
>> >> >> >>> >>> >> why
>> >> >> >>> >>> >> are
>> >> >> >>> >>> >> the
>> >> >> >>> >>> >> file, and just add database server details for the
>> server to
>> >> >> >>> >>> >> run
>> >> >> >>> >>> >> against.
>> >> >> >>> >>> >>

---

From: Dave Page <[email-masked]>
Date: Tue, 12 Jul 2016 13:04:45 +0100

On Tue, Jul 12, 2016 at 5:14 AM, Khushboo Vashi
<[email-masked]> wrote:
>
>
> On Mon, Jul 11, 2016 at 7:15 PM, Priyanka Shendge

Not on my system, that I can think of.

If there was a connection error like that though, shouldn't we see a
message from libpq at least? If not, that implies that there are error
reporting issues to be fixed.

---

From: Priyanka Shendge <[email-masked]>
Date: Thu, 14 Jul 2016 17:20:48 +0530

Hi Dave,

I have added more debug statements to older patch. New patch attached.
Also, i removed database deletion test case from current patch so that we
can analyse
if database is added or not.

I have added few more debug statements to database add test case. After
running the testsuite
can you please confirm whether the database is created or not under server
node?

Could you please re-run the attached patch and send me the logs and output?

-- 
Best,
Priyanka

EnterpriseDB Corporation

---

From: Dave Page <[email-masked]>
Date: Fri, 15 Jul 2016 13:43:11 +0100

Hi

> if database is added or not.

OK. One quick note - somewhere along the way,
test_advanced_config.json has been changed back to
test_advance_config.json. The first is correct - please include that
fix in the next patch.

The database is added - assuming you're referring to one randomly
named like bbb6cad or d602036?

> Could you please re-run the attached patch and send me the logs and output?

Sure - all the interesting info is here:

runTest (pgadmin.browser.tests.test_login.LoginTestCase)
This function checks login functionality. (TestCase for Checking
Invalid_Password) ... ok
runTest (pgadmin.browser.tests.test_login.LoginTestCase)
This function checks login functionality. (Empty_Password) ... ok
runTest (pgadmin.browser.tests.test_login.LoginTestCase)
This function checks login functionality. (Empty_Email) ... ok
runTest (pgadmin.browser.tests.test_login.LoginTestCase)
This function checks login functionality. (Empty_Creadentials) ... ok
runTest (pgadmin.browser.tests.test_login.LoginTestCase)
This function checks login functionality. (Invalid_Email) ... ok
runTest (pgadmin.browser.tests.test_login.LoginTestCase)
This function checks login functionality. (Invalid_Creadentials) ... ok
runTest (pgadmin.browser.tests.test_login.LoginTestCase)
This function checks login functionality. (Valid_Creadentials) ... ok
runTest (pgadmin.browser.server_groups.tests.test_sg_add.SgNodeTestCase)
This function will check available server groups. (Check Server Group
Node) ... ok
runTest (pgadmin.browser.tests.test_reset_password.ResetPasswordTestCase)
This function checks reset password functionality. (TestCase for
Validating Empty Email) ... ok
runTest (pgadmin.browser.tests.test_reset_password.ResetPasswordTestCase)
This function checks reset password functionality. (TestCase for
Validating Invalid_Email) ... ok
runTest (pgadmin.browser.tests.test_reset_password.ResetPasswordTestCase)
This function checks reset password functionality. (TestCase for
Validating Valid_Email) ... ok
runTest (pgadmin.browser.tests.test_change_password.ChangePasswordTestCase)
This function will check change password functionality. (TestCase for
Validating Incorrect_New_Password) ... ok
runTest (pgadmin.browser.tests.test_change_password.ChangePasswordTestCase)
This function will check change password functionality. (TestCase for
Validating New_Password_Less_Than_Min_Length) ... ok
runTest (pgadmin.browser.tests.test_change_password.ChangePasswordTestCase)
This function will check change password functionality. (TestCase for
Validating Empty_New_Password) ... ok
runTest (pgadmin.browser.tests.test_change_password.ChangePasswordTestCase)
This function will check change password functionality. (TestCase for
Validating Incorrect_Current_Password) ... ok
runTest (pgadmin.browser.tests.test_change_password.ChangePasswordTestCase)
This function will check change password functionality. (TestCase for
Changing Valid_Password) ... ok
runTest (pgadmin.browser.tests.test_change_password.ChangePasswordTestCase)
This function will check change password functionality.
(Reassigning_Password) ... ok
runTest (pgadmin.browser.server_groups.tests.test_sg_get.SgGetTestCase)
This function will check available server groups. (Check Server Group
Node) ... ok
runTest (pgadmin.browser.server_groups.servers.tests.test_server_add.ServersAddTestCase)
This function will add the server under default server group. (Default
Server Node url) ... ('\nServer id in server add', u'9')
ok
runTest (pgadmin.browser.server_groups.servers.tests.test_server_get.ServersGetTestCase)
This function will fetch the added servers to object browser. (Default
Server Node url) ... ok
runTest (pgadmin.browser.server_groups.servers.tests.test_server_put.ServerUpdateTestCase)
This function will update the server's comment field. (Default Server
Node url) ... 2016-07-15 13:29:39,946: INFO pgadmin: Connection
Request for server#9
FAIL
runTest (pgadmin.browser.server_groups.servers.databases.tests.test_db_add.DatabaseAddTestCase)
This function will add database under 1st server of tree node. (Check
Databases Node URL) ... 2016-07-15 13:29:39,956: INFO pgadmin:
Connection Request for server#9
FAIL
runTest (pgadmin.browser.server_groups.servers.databases.tests.test_db_get.DatabasesGetTestCase)
This function will fetch added database. (Check Databases Node URL) ...

('db id in get database from pickle:', 158619)
('Database Details From pickle: id in test nodes:', 158619)
2016-07-15 13:29:39,962: INFO pgadmin: Connection Request for server#9

('Server Connection Response After Database Addition in test nodes',
u'{"info": "", "errormsg": "Server not found.", "data": null,
"result": null, "success": 0}')
2016-07-15 13:29:39,969: ERROR pgadmin: Exception on
/browser/database/connect/1/9/158619 [POST]
Traceback (most recent call last):
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/views.py",
line 84, in view
    return self.dispatch_request(*args, **kwargs)
  File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/utils.py", line
235, in dispatch_request
    return method(*args, **kwargs)
  File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/__init__.py",
line 334, in connect
    conn = manager.connection(did=did, auto_reconnect=True)
AttributeError: 'NoneType' object has no attribute 'connection'

('Database Connection Response After Database Addition in test nodes',
u'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500
Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The
server encountered an internal error and was unable to complete your
request.  Either the server is overloaded or there is an error in the
application.</p>\n')
ERROR
runTest (pgadmin.browser.server_groups.servers.databases.tests.test_db_put.DatabasesUpdateTestCase)
This function will update the comments field of database. (Check
Databases Node) ...

('db id in update database from pickle:', 158619)
('Database Details From pickle: id in test nodes:', 158619)
2016-07-15 13:29:39,976: INFO pgadmin: Connection Request for server#9

('Server Connection Response After Database Addition in test nodes',
u'{"info": "", "errormsg": "Server not found.", "data": null,
"result": null, "success": 0}')
2016-07-15 13:29:39,983: ERROR pgadmin: Exception on
/browser/database/connect/1/9/158619 [POST]
Traceback (most recent call last):
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/views.py",
line 84, in view
    return self.dispatch_request(*args, **kwargs)
  File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/utils.py", line
235, in dispatch_request
    return method(*args, **kwargs)
  File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/__init__.py",
line 334, in connect
    conn = manager.connection(did=did, auto_reconnect=True)
AttributeError: 'NoneType' object has no attribute 'connection'

('Database Connection Response After Database Addition in test nodes',
u'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500
Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The
server encountered an internal error and was unable to complete your
request.  Either the server is overloaded or there is an error in the
application.</p>\n')
ERROR
runTest (pgadmin.browser.server_groups.servers.tests.test_server_delete.ServerDeleteTestCase)
This function will get all available servers under object browser
(Default Server Node url) ... ok
runTest (pgadmin.browser.tests.test_logout.LogoutTest)
This function checks the logout functionality. (Logging Out) ... ok

======================================================================
ERROR: runTest (pgadmin.browser.server_groups.servers.databases.tests.test_db_get.DatabasesGetTestCase)
This function will fetch added database. (Check Databases Node URL)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_get.py",
line 38, in runTest
    db_con = test_getnodes(node=self)
  File "/Users/dpage/git/pgadmin4/web/regression/test_nodes.py", line
48, in test_getnodes
    db_con = json.loads(con_response.data.decode())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py",
line 338, in loads
    return _default_decoder.decode(s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py",
line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py",
line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

======================================================================
ERROR: runTest (pgadmin.browser.server_groups.servers.databases.tests.test_db_put.DatabasesUpdateTestCase)
This function will update the comments field of database. (Check Databases Node)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_put.py",
line 39, in runTest
    db_con = test_getnodes(node=self)
  File "/Users/dpage/git/pgadmin4/web/regression/test_nodes.py", line
48, in test_getnodes
    db_con = json.loads(con_response.data.decode())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py",
line 338, in loads
    return _default_decoder.decode(s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py",
line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py",
line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

======================================================================
FAIL: runTest (pgadmin.browser.server_groups.servers.tests.test_server_put.ServerUpdateTestCase)
This function will update the server's comment field. (Default Server Node url)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/tests/test_server_put.py",
line 64, in runTest
    self.assertTrue(respdata['success'], 1)
AssertionError: 1

======================================================================
FAIL: runTest (pgadmin.browser.server_groups.servers.databases.tests.test_db_add.DatabaseAddTestCase)
This function will add database under 1st server of tree node. (Check
Databases Node URL)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_add.py",
line 47, in runTest
    self.assertEquals(response.status_code, 200)
AssertionError: 400 != 200

----------------------------------------------------------------------
Ran 26 tests in 12.312s

FAILED (failures=2, errors=2)
('Please check output in file: logger.log placed at',
'/Users/dpage/git/pgadmin4/web/regression')
Traceback (most recent call last):
  File "regression/testsuite.py", line 113, in <module>
    os.remove("parent_id.pkl")
OSError: [Errno 2] No such file or directory: 'parent_id.pkl'
(pgadmin4)piranha:web dpage$

The output log doesn't seem to contain anything more useful.