2017-03-16 09:27:55 -05:00
|
|
|
##########################################################################
|
|
|
|
#
|
|
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
|
|
#
|
2018-01-05 04:42:49 -06:00
|
|
|
# Copyright (C) 2013 - 2018, The pgAdmin Development Team
|
2017-03-16 09:27:55 -05:00
|
|
|
# This software is released under the PostgreSQL Licence
|
|
|
|
#
|
|
|
|
##########################################################################
|
|
|
|
|
2017-02-22 06:41:28 -06:00
|
|
|
from regression.feature_utils.base_feature_test import BaseFeatureTest
|
2017-03-23 06:59:31 -05:00
|
|
|
from regression.python_test_utils import test_utils
|
2017-02-22 06:41:28 -06:00
|
|
|
|
|
|
|
|
2017-03-23 06:47:21 -05:00
|
|
|
class TableDdlFeatureTest(BaseFeatureTest):
|
2017-04-06 03:33:29 -05:00
|
|
|
""" This class test acceptance test scenarios """
|
|
|
|
|
|
|
|
scenarios = [
|
|
|
|
("Test table DDL generation", dict())
|
|
|
|
]
|
|
|
|
|
2017-03-09 09:34:51 -06:00
|
|
|
def before(self):
|
2018-02-09 06:57:37 -06:00
|
|
|
connection = test_utils.get_db_connection(
|
|
|
|
self.server['db'],
|
|
|
|
self.server['username'],
|
|
|
|
self.server['db_password'],
|
|
|
|
self.server['host'],
|
|
|
|
self.server['port'],
|
|
|
|
self.server['sslmode']
|
|
|
|
)
|
2017-02-22 06:41:28 -06:00
|
|
|
test_utils.drop_database(connection, "acceptance_test_db")
|
|
|
|
|
|
|
|
test_utils.create_database(self.server, "acceptance_test_db")
|
|
|
|
|
|
|
|
self.page.add_server(self.server)
|
|
|
|
|
|
|
|
def runTest(self):
|
2018-02-09 06:57:37 -06:00
|
|
|
test_utils.create_table(
|
|
|
|
self.server, "acceptance_test_db", "test_table")
|
2017-02-22 06:41:28 -06:00
|
|
|
|
2017-06-08 07:31:36 -05:00
|
|
|
self.page.toggle_open_server(self.server['name'])
|
2017-02-22 06:41:28 -06:00
|
|
|
self.page.toggle_open_tree_item('Databases')
|
|
|
|
self.page.toggle_open_tree_item('acceptance_test_db')
|
|
|
|
self.page.toggle_open_tree_item('Schemas')
|
|
|
|
self.page.toggle_open_tree_item('public')
|
2017-03-23 06:47:21 -05:00
|
|
|
self.page.toggle_open_tree_item('Tables')
|
|
|
|
self.page.select_tree_item('test_table')
|
|
|
|
self.page.click_tab("SQL")
|
|
|
|
|
|
|
|
self.page.find_by_xpath(
|
2018-02-09 06:57:37 -06:00
|
|
|
"//*[contains(@class,'CodeMirror-lines') and "
|
|
|
|
"contains(.,'CREATE TABLE public.test_table')]")
|
2017-02-22 06:41:28 -06:00
|
|
|
|
2017-03-09 09:34:51 -06:00
|
|
|
def after(self):
|
2017-02-22 06:41:28 -06:00
|
|
|
self.page.remove_server(self.server)
|
2018-02-09 06:57:37 -06:00
|
|
|
connection = test_utils.get_db_connection(
|
|
|
|
self.server['db'],
|
|
|
|
self.server['username'],
|
|
|
|
self.server['db_password'],
|
|
|
|
self.server['host'],
|
|
|
|
self.server['port'],
|
|
|
|
self.server['sslmode']
|
|
|
|
)
|
2017-03-23 06:47:21 -05:00
|
|
|
test_utils.drop_database(connection, "acceptance_test_db")
|