From bdb8f20aed561ba018207119d9e067c81d9cca4b Mon Sep 17 00:00:00 2001 From: Usman Muzaffar Date: Thu, 27 Jun 2019 10:19:57 -0400 Subject: [PATCH] Feature test fixes: The query tool element while running on jenkins, is present on the DOM but not visible due to comparatively small page size. So handle it , would work in both cases(if element is visible or not). The tab name handles XSS characters due to which table name

is shown modified accordingly in the tab name. --- .../xss_checks_panels_and_query_tool_test.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/web/pgadmin/feature_tests/xss_checks_panels_and_query_tool_test.py b/web/pgadmin/feature_tests/xss_checks_panels_and_query_tool_test.py index c415b2b93..c7eb39fab 100644 --- a/web/pgadmin/feature_tests/xss_checks_panels_and_query_tool_test.py +++ b/web/pgadmin/feature_tests/xss_checks_panels_and_query_tool_test.py @@ -66,9 +66,8 @@ class CheckForXssFeatureTest(BaseFeatureTest): self._check_xss_in_query_tool() self._check_xss_in_query_tool_history() self.page.close_query_tool() - # Query tool view/edit data - self.page.open_view_data(self.test_table_name) + self.page.open_view_data(self.test_db) self._check_xss_view_data() self.page.close_data_grid() @@ -189,7 +188,6 @@ class CheckForXssFeatureTest(BaseFeatureTest): "\n\tChecking the query tool history for the XSS", file=sys.stderr, end="" ) - self.page.fill_codemirror_area_with( "select '" ) @@ -212,9 +210,8 @@ class CheckForXssFeatureTest(BaseFeatureTest): ) # Check for history details message - history_ele = self.page.find_by_css_selector( - ".query-detail .content-value" - ) + history_ele = self.driver\ + .find_element_by_css_selector(".query-detail .content-value") source_code = history_ele.get_attribute('innerHTML')