2017-03-16 09:27:55 -05:00
|
|
|
##########################################################################
|
|
|
|
#
|
|
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
|
|
#
|
2019-01-02 04:24:12 -06:00
|
|
|
# Copyright (C) 2013 - 2019, The pgAdmin Development Team
|
2017-03-16 09:27:55 -05:00
|
|
|
# This software is released under the PostgreSQL Licence
|
|
|
|
#
|
|
|
|
##########################################################################
|
|
|
|
|
2018-08-21 07:09:36 -05:00
|
|
|
import random
|
|
|
|
|
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())
|
|
|
|
]
|
|
|
|
|
2018-08-21 07:09:36 -05:00
|
|
|
test_table_name = ""
|
|
|
|
|
2017-03-09 09:34:51 -06:00
|
|
|
def before(self):
|
2017-02-22 06:41:28 -06:00
|
|
|
|
|
|
|
self.page.add_server(self.server)
|
|
|
|
|
|
|
|
def runTest(self):
|
2018-08-21 07:09:36 -05:00
|
|
|
self.test_table_name = "test_table" + str(random.randint(1000, 3000))
|
|
|
|
test_utils.create_table(self.server, self.test_db,
|
|
|
|
self.test_table_name)
|
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')
|
2018-08-21 07:09:36 -05:00
|
|
|
self.page.toggle_open_tree_item(self.test_db)
|
2017-02-22 06:41:28 -06:00
|
|
|
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')
|
2018-08-21 07:09:36 -05:00
|
|
|
self.page.select_tree_item(self.test_table_name)
|
2017-03-23 06:47:21 -05:00
|
|
|
self.page.click_tab("SQL")
|
|
|
|
|
|
|
|
self.page.find_by_xpath(
|
2018-02-09 06:57:37 -06:00
|
|
|
"//*[contains(@class,'CodeMirror-lines') and "
|
2018-08-21 07:09:36 -05:00
|
|
|
"contains(.,'CREATE TABLE public.%s')]" % self.test_table_name)
|
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)
|