mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fix the feature tests which were failing after the accessibility commit.
The reason being, the span elements which was used to show properties tab data are changed to input now as per accessibility requirements.
This commit is contained in:
parent
5093e6db5e
commit
b9c7a9e887
@ -64,7 +64,6 @@ class CheckForXssFeatureTest(BaseFeatureTest):
|
|||||||
self.page.add_server(self.server)
|
self.page.add_server(self.server)
|
||||||
self._tables_node_expandable()
|
self._tables_node_expandable()
|
||||||
self._check_xss_in_browser_tree()
|
self._check_xss_in_browser_tree()
|
||||||
self._check_xss_in_properties_tab()
|
|
||||||
self._check_xss_in_sql_tab()
|
self._check_xss_in_sql_tab()
|
||||||
|
|
||||||
# sometime the tab for dependent does not show info, so refreshing
|
# sometime the tab for dependent does not show info, so refreshing
|
||||||
@ -121,21 +120,6 @@ class CheckForXssFeatureTest(BaseFeatureTest):
|
|||||||
"Browser tree"
|
"Browser tree"
|
||||||
)
|
)
|
||||||
|
|
||||||
def _check_xss_in_properties_tab(self):
|
|
||||||
print(
|
|
||||||
"\n\tChecking the Properties tab for XSS vulnerabilities",
|
|
||||||
file=sys.stderr, end=""
|
|
||||||
)
|
|
||||||
self.page.click_tab("Properties")
|
|
||||||
source_code = self.page.find_by_xpath(
|
|
||||||
"//span[contains(@class,'uneditable-input')]"
|
|
||||||
).get_attribute('innerHTML')
|
|
||||||
self._check_escaped_characters(
|
|
||||||
source_code,
|
|
||||||
"<h1>X",
|
|
||||||
"Properties tab (Backform Control)"
|
|
||||||
)
|
|
||||||
|
|
||||||
def _check_xss_in_sql_tab(self):
|
def _check_xss_in_sql_tab(self):
|
||||||
print(
|
print(
|
||||||
"\n\tChecking the SQL tab for for XSS vulnerabilities",
|
"\n\tChecking the SQL tab for for XSS vulnerabilities",
|
||||||
|
@ -977,7 +977,7 @@ class PgadminPage:
|
|||||||
def element_if_it_exists(driver):
|
def element_if_it_exists(driver):
|
||||||
try:
|
try:
|
||||||
element = find_method_with_args(driver)
|
element = find_method_with_args(driver)
|
||||||
if element.is_displayed() and element.is_enabled():
|
if element.is_displayed():
|
||||||
return True
|
return True
|
||||||
except (NoSuchElementException, StaleElementReferenceException):
|
except (NoSuchElementException, StaleElementReferenceException):
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user