mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Feature test reliability improvements:
1. click_tab() -> Added wait till element is clickable, test cases are failing since the function attempts to click the tab which is not yet in the state to be clicked. 2. add_server() -> Replaced the sleep statement with wait till element to be clickable.
This commit is contained in:
parent
ce8fb28b34
commit
ec476d6274
@ -60,9 +60,9 @@ class PgadminPage:
|
|||||||
self.fill_input_by_field_name("port", server_config['port'])
|
self.fill_input_by_field_name("port", server_config['port'])
|
||||||
self.fill_input_by_field_name("username", server_config['username'])
|
self.fill_input_by_field_name("username", server_config['username'])
|
||||||
self.fill_input_by_field_name("password", server_config['db_password'])
|
self.fill_input_by_field_name("password", server_config['db_password'])
|
||||||
# Required sleep to avoid "fe_sendauth" password error.
|
WebDriverWait(self.driver, 10).until(EC.element_to_be_clickable(
|
||||||
time.sleep(0.5)
|
(By.CSS_SELECTOR, "button[type='save'].btn.btn-primary")))
|
||||||
self.find_by_xpath("//button[contains(.,'Save')]").click()
|
self.find_by_css_selector("button[type='save'].btn.btn-primary").click()
|
||||||
|
|
||||||
self.find_by_xpath(
|
self.find_by_xpath(
|
||||||
"//*[@id='tree']//*[.='" + server_config['name'] + "']")
|
"//*[@id='tree']//*[.='" + server_config['name'] + "']")
|
||||||
@ -235,6 +235,11 @@ class PgadminPage:
|
|||||||
action.perform()
|
action.perform()
|
||||||
|
|
||||||
def click_tab(self, tab_name):
|
def click_tab(self, tab_name):
|
||||||
|
WebDriverWait(self.driver, 10).until(EC.element_to_be_clickable(
|
||||||
|
(By.XPATH, "//*[contains(@class,'wcTabTop')]//"
|
||||||
|
"*[contains(@class,'wcPanelTab') "
|
||||||
|
"and contains(.,'" + tab_name + "')]")))
|
||||||
|
|
||||||
tab = self.find_by_xpath("//*[contains(@class,'wcTabTop')]//"
|
tab = self.find_by_xpath("//*[contains(@class,'wcTabTop')]//"
|
||||||
"*[contains(@class,'wcPanelTab') "
|
"*[contains(@class,'wcPanelTab') "
|
||||||
"and contains(.,'" + tab_name + "')]")
|
"and contains(.,'" + tab_name + "')]")
|
||||||
|
Loading…
Reference in New Issue
Block a user