public inbox for [email protected]  
help / color / mirror / Atom feed
From: Yogesh Mahajan <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: Re: Feature Test Fix - React porting
Date: Tue, 23 Nov 2021 16:31:28 +0530
Message-ID: <CAMa=N=Px4E53Uva8x0dGdFoi-6_2G3-9J_Qu3yfJPRS3caD0_A@mail.gmail.com> (raw)
In-Reply-To: <CANxoLDfTCoZekQvTXaapdXO6aXxaJ_F-TaYzgCpeDWEGFPbhSA@mail.gmail.com>
References: <CAMa=N=M7TmEsEk0tD787z-obnN_805R4QyegZtFspjfddLKbug@mail.gmail.com>
	<CANxoLDfH2YoCG1aVFPuzWCR95FTFgJczceH1Z-eFg2Oo24tzLA@mail.gmail.com>
	<CAMa=N=Op8hASK9hRBfDXHiwrVsDn-NaH-0hUk+7gGF6L_80mHQ@mail.gmail.com>
	<CANxoLDe_meHYN8DU4kc5p+6wpiKivSyyJLW26idD+7h7=wi+2A@mail.gmail.com>
	<CAMa=N=MyQWGD_YwRBRXKtEVq3B1wqwCDHcOjn88XLQm+dw-Hhw@mail.gmail.com>
	<CANxoLDf2pZExvAawcMcM_Bn-5D=g6iWzVEG0dWsuu-qPnAZYig@mail.gmail.com>
	<CAMa=N=OHsVoYaTYdspiVHnYXhmD=Q074D8awZdTpswRuj-xgFg@mail.gmail.com>
	<CANxoLDfTCoZekQvTXaapdXO6aXxaJ_F-TaYzgCpeDWEGFPbhSA@mail.gmail.com>

Hi,

Please find the attached patch to fix feature test failures due to react
porting for backup dialogue.

Thanks,
Yogesh Mahajan
EnterpriseDB


On Mon, Nov 22, 2021 at 6:09 PM Akshay Joshi <[email protected]>
wrote:

> Thanks, the patch applied.
>
> On Mon, Nov 22, 2021 at 12:58 PM Yogesh Mahajan <
> [email protected]> wrote:
>
>> Hi,
>>
>> Please find the attached patch which adds flexibility to wait for
>> launching pgAdmin.
>>
>> Thanks,
>> Yogesh Mahajan
>> EnterpriseDB
>>
>>
>> On Thu, Nov 18, 2021 at 5:15 PM Akshay Joshi <
>> [email protected]> wrote:
>>
>>> Thanks, the patch applied.
>>>
>>> On Thu, Nov 18, 2021 at 3:23 PM Yogesh Mahajan <
>>> [email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> Please find the attached patch which fixes the problem related to
>>>> feature tests.
>>>>
>>>>
>>>> Thanks,
>>>> Yogesh Mahajan
>>>> EnterpriseDB
>>>>
>>>>
>>>> On Fri, Nov 12, 2021 at 11:59 AM Akshay Joshi <
>>>> [email protected]> wrote:
>>>>
>>>>> Thanks, the patch applied.
>>>>>
>>>>> On Thu, Nov 11, 2021 at 10:04 PM Yogesh Mahajan <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Please find the attached patch which uses selenium 4.0.0a6 which
>>>>>> works with python 3.6.8.
>>>>>> Selenium 4.0.0 requires python 3.7+
>>>>>>
>>>>>> Thanks,
>>>>>> Yogesh Mahajan
>>>>>> EnterpriseDB
>>>>>>
>>>>>>
>>>>>> On Wed, Nov 10, 2021 at 11:59 AM Akshay Joshi <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Thanks, the patch applied. but Jenkins is failing with the below
>>>>>>> error:
>>>>>>> ERROR: No matching distribution found for selenium==4.0.0
>>>>>>> ERROR: Failed to install Python requirements.
>>>>>>>
>>>>>>> On Tue, Nov 9, 2021 at 2:48 PM Yogesh Mahajan <
>>>>>>> [email protected]> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Please find the attached patch which fixes feature tests broken due
>>>>>>>> to react porting changes.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Yogesh Mahajan
>>>>>>>> EnterpriseDB
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> *Thanks & Regards*
>>>>>>> *Akshay Joshi*
>>>>>>> *pgAdmin Hacker | Principal Software Architect*
>>>>>>> *EDB Postgres <http://edbpostgres.com>*
>>>>>>>
>>>>>>> *Mobile: +91 976-788-8246*
>>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> *Thanks & Regards*
>>>>> *Akshay Joshi*
>>>>> *pgAdmin Hacker | Principal Software Architect*
>>>>> *EDB Postgres <http://edbpostgres.com>*
>>>>>
>>>>> *Mobile: +91 976-788-8246*
>>>>>
>>>>
>>>
>>> --
>>> *Thanks & Regards*
>>> *Akshay Joshi*
>>> *pgAdmin Hacker | Principal Software Architect*
>>> *EDB Postgres <http://edbpostgres.com>*
>>>
>>> *Mobile: +91 976-788-8246*
>>>
>>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Principal Software Architect*
> *EDB Postgres <http://edbpostgres.com>*
>
> *Mobile: +91 976-788-8246*
>


Attachments:

  [application/octet-stream] Feature_Test_Fix_React_Porting_v5.patch (3.4K, 3-Feature_Test_Fix_React_Porting_v5.patch)
  download | inline diff:
diff --git a/web/pgadmin/feature_tests/pg_utilities_backup_restore_test.py b/web/pgadmin/feature_tests/pg_utilities_backup_restore_test.py
index f02c19a3d..9a6c7ec8b 100644
--- a/web/pgadmin/feature_tests/pg_utilities_backup_restore_test.py
+++ b/web/pgadmin/feature_tests/pg_utilities_backup_restore_test.py
@@ -88,7 +88,7 @@ class PGUtilitiesBackupFeatureTest(BaseFeatureTest):
              NavMenuLocators.process_watcher_alertfier))
         self.page.wait_for_element_to_disappear(
             lambda driver: driver.find_element(
-                By.CSS_SELECTOR, ".loading-logs"), 18)
+                By.CSS_SELECTOR, ".loading-logs"), 15)
 
         expected_backup_success_msg = "Successfully completed."
         self.assertEqual(status, expected_backup_success_msg)
@@ -204,13 +204,14 @@ class PGUtilitiesBackupFeatureTest(BaseFeatureTest):
         element.click()
         self.page.fill_input_by_field_name(
             NavMenuLocators.backup_filename_txt_box_name,
-            "test_backup", loose_focus=True)
+            "test_backup", input_keys=True, loose_focus=True)
 
         # Click on the take Backup button
         take_bckup = self.page.find_by_xpath(
             NavMenuLocators.backup_btn_xpath)
         click = True
-        while click:
+        retry = 3
+        while click and retry > 0:
             try:
                 take_bckup.click()
                 if self.page.wait_for_element_to_disappear(
@@ -219,6 +220,7 @@ class PGUtilitiesBackupFeatureTest(BaseFeatureTest):
                         NavMenuLocators.backup_filename_txt_box_name)):
                     click = False
             except Exception:
+                retry -= 1
                 pass
 
     def initiate_restore(self):
diff --git a/web/regression/feature_utils/locators.py b/web/regression/feature_utils/locators.py
index 3c728ca9c..110e1425e 100644
--- a/web/regression/feature_utils/locators.py
+++ b/web/regression/feature_utils/locators.py
@@ -78,7 +78,7 @@ class NavMenuLocators:
     restore_file_name_txt_box_name = "file"
 
     backup_btn_xpath = \
-        "//button[contains(@class,'fa-save')and contains(.,'Backup')]"
+        "//button[ contains(.,'Backup')]"
 
     bcg_process_status_alertifier_css = \
         ".ajs-message.ajs-bg-bgprocess.ajs-visible"
diff --git a/web/regression/feature_utils/pgadmin_page.py b/web/regression/feature_utils/pgadmin_page.py
index 630d05ef6..996118b58 100644
--- a/web/regression/feature_utils/pgadmin_page.py
+++ b/web/regression/feature_utils/pgadmin_page.py
@@ -384,12 +384,17 @@ class PgadminPage:
         :param tree_node_exp_check_xpath:
         :return: True is tree_node_exp_check_xpath present in DOM else false
         """
-        webdriver.ActionChains(self.driver).double_click(
-            tree_node_web_element).perform()
-        if self.check_if_element_exist_by_xpath(tree_node_exp_check_xpath):
-            return True
-        else:
-            return False
+        retry = 2
+        while retry > 0:
+            webdriver.ActionChains(self.driver).double_click(
+                tree_node_web_element).perform()
+            if self.check_if_element_exist_by_xpath(tree_node_exp_check_xpath):
+                return True
+            elif retry == 1:
+                return False
+            else:
+                time.sleep(1)
+                retry -= 1
 
     def expand_server_group_node(self, server_group_name):
         """


view thread (12+ 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: Feature Test Fix - React porting
  In-Reply-To: <CAMa=N=Px4E53Uva8x0dGdFoi-6_2G3-9J_Qu3yfJPRS3caD0_A@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