public inbox for [email protected]  
help / color / mirror / Atom feed
From: Shubham Agarwal <[email protected]>
To: [email protected]
Subject: pgadmin_page functions updated
Date: Thu, 14 Jun 2018 15:25:33 +0530
Message-ID: <CAKbCA9Rk0PKsMxC95MJhqK=WeDWoizDKiXBZar+uuRe42obq3Q@mail.gmail.com> (raw)

Hi Team,

I have modified following two functions in pgadmin_page.py :-

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.

Please find the attached patch.

-- 
Thanks & Regards,
Shubham Agarwal
EnterpriseDB Corporation

The Postgres Database Company


Attachments:

  [application/octet-stream] pgadmin_page.patch (1.4K, 3-pgadmin_page.patch)
  download | inline diff:
diff --git a/web/regression/feature_utils/pgadmin_page.py b/web/regression/feature_utils/pgadmin_page.py
index 78578a2..80f0ca7 100644
--- a/web/regression/feature_utils/pgadmin_page.py
+++ b/web/regression/feature_utils/pgadmin_page.py
@@ -60,8 +60,8 @@ class PgadminPage:
         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("password", server_config['db_password'])
-        # Required sleep to avoid "fe_sendauth" password error.
-        time.sleep(0.5)
+        WebDriverWait(self.driver, 10).until(EC.element_to_be_clickable(
+            (By.XPATH, "//button[contains(.,'Save')]")))
         self.find_by_xpath("//button[contains(.,'Save')]").click()
 
         self.find_by_xpath(
@@ -245,6 +245,11 @@ class PgadminPage:
         action.perform()
 
     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')]//"
                                  "*[contains(@class,'wcPanelTab') "
                                  "and contains(.,'" + tab_name + "')]")


view thread (6+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: pgadmin_page functions updated
  In-Reply-To: <CAKbCA9Rk0PKsMxC95MJhqK=WeDWoizDKiXBZar+uuRe42obq3Q@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox