Enhancements to the regression test suite.

Navnath Gadakh and Priyanka Shendge
This commit is contained in:
Dave Page
2016-07-18 14:50:21 +01:00
parent c7d25c33f2
commit f17c2e3b84
25 changed files with 1293 additions and 308 deletions

View File

@@ -12,4 +12,4 @@ from pgadmin.utils.route import BaseTestGenerator
class SGGenerateTestCase(BaseTestGenerator):
def runTest(self):
print ("In SGGenerateTestCase...")
return

View File

@@ -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)

View File

@@ -0,0 +1,48 @@
###########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2016, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
###########################################################################
import json
from pgadmin.utils.route import BaseTestGenerator
from regression import test_utils as utils
from regression.test_setup import config_data
class SgNodeTestCase(BaseTestGenerator):
"""
This class will check available server groups in pgAdmin.
"""
scenarios = [
# Fetching the default url for server group node
('Check Server Group Node', dict(url='/browser/server-group/obj/'))
]
def setUp(self):
"""
This function login the test account before running the logout
test case
"""
utils.login_tester_account(self.tester)
def runTest(self):
"""This function will check available server groups."""
server_group_id = config_data['test_server_group']
response = self.tester.get(self.url + str(server_group_id),
content_type='html/json')
self.assertTrue(response.status_code, 200)
response_data = json.loads(response.data.decode('utf8'))
self.assertTrue(response_data['id'], server_group_id)
def tearDown(self):
"""This function logout the test account """
utils.logout_tester_account(self.tester)