From e13b5a212f2f7b3007d83de4073b6f2121ab0c90 Mon Sep 17 00:00:00 2001 From: Kankana Bordoloi Date: Thu, 12 Jun 2025 17:22:56 +0530 Subject: [PATCH 1/4] QA-7808 fixes for current HQ Failures --- .github/workflows/hq-smoke-tests.yml | 5 +++-- .gitignore | 6 +++++- HQSmokeTests/testCases/test_07_applications.py | 4 +++- .../testPages/applications/application_page.py | 14 +++++++++++--- .../testPages/data/data_dictionary_page.py | 12 +++++++++--- HQSmokeTests/testPages/messaging/messaging_page.py | 9 ++++++++- .../testPages/users/mobile_workers_page.py | 9 ++++++++- HQSmokeTests/testPages/users/org_structure_page.py | 9 ++++++++- HQSmokeTests/testPages/users/web_user_page.py | 9 ++++++++- 9 files changed, 63 insertions(+), 14 deletions(-) diff --git a/.github/workflows/hq-smoke-tests.yml b/.github/workflows/hq-smoke-tests.yml index 0c203d2b3..920b5d2a3 100644 --- a/.github/workflows/hq-smoke-tests.yml +++ b/.github/workflows/hq-smoke-tests.yml @@ -21,6 +21,7 @@ on: - staging - production - eu + - india schedule: - cron: '30 6 * * 1-5' @@ -42,11 +43,11 @@ jobs: - id: set-matrix-manual if: ${{ github.event_name == 'workflow_dispatch' }} run: | - echo "::set-output name=matrix::{\"environment\": [\"${{ inputs.environment }}\"]}" + echo "::set-output name=matrix::{\"environment\": [\"production\", \"staging\", \"india\"]}" - id: set-matrix-default if: ${{ github.event_name != 'repository_dispatch' }} run: | - echo "::set-output name=matrix::{\"environment\": [\"production\", \"staging\",\"eu\"]}" + echo "::set-output name=matrix::{\"environment\": [\"production\", \"staging\", \"india\",\"eu\"]}" - id: invalid-deploy if: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.environment != 'production' }} run: | diff --git a/.gitignore b/.gitignore index 20fd1542e..5aecd7f03 100644 --- a/.gitignore +++ b/.gitignore @@ -271,4 +271,8 @@ P1P2Tests/settings.cfg /P1P2Tests/userInputs/test_data/mobile_workers_* /P1P2Tests/userInputs/test_data/import_to_parent_* -LocustScripts/update-scripts/project-config/co-carecoordination-perf/mobile_worker_credentials.json \ No newline at end of file +LocustScripts/update-scripts/project-config/co-carecoordination-perf/mobile_worker_credentials.json + +/POCs/AppPercyMobile/settings.cfg +/POCs/PercyWebApps/settings.cfg +/POCs/VisualComparison/settings.cfg \ No newline at end of file diff --git a/HQSmokeTests/testCases/test_07_applications.py b/HQSmokeTests/testCases/test_07_applications.py index 8c19ec751..cdc80df98 100644 --- a/HQSmokeTests/testCases/test_07_applications.py +++ b/HQSmokeTests/testCases/test_07_applications.py @@ -104,8 +104,10 @@ def test_case_38_create_new_build_deploy_to_mobile(driver, settings): """ if 'staging' in settings['url']: pytest.xfail("Failing on Staging due to QA-7314") - elif "eu" in settings["url"]: + if "eu" in settings["url"]: pytest.skip("App code is not getting displayed") + if "india" in settings["url"]: + pytest.skip("App code limit exhausted for the month") load = ApplicationPage(driver) load.opening_dashboard() install_code, field_text = load.update_form_field() diff --git a/HQSmokeTests/testPages/applications/application_page.py b/HQSmokeTests/testPages/applications/application_page.py index ed63fd58f..85655f320 100644 --- a/HQSmokeTests/testPages/applications/application_page.py +++ b/HQSmokeTests/testPages/applications/application_page.py @@ -38,7 +38,7 @@ def __init__(self, driver): self.confirm_change = (By.XPATH, "(//button[@data-bind=\"click: save, hasFocus: saveHasFocus, visible: !isSaving()\"])[1]") self.add_module = (By.XPATH, "//a[contains(@class,'new-module') or contains(@class,'appnav-add js-add-new-item')]/i") self.add_case_list = (By.XPATH, "//button[@data-type='case']") - self.add_questions = (By.XPATH, "//div[@class='dropdown fd-add-question-dropdown']") + self.add_questions = (By.XPATH, "//div[@class='dropdown fd-add-question-dropdown']/button") self.text_question = (By.XPATH, "//a[@data-qtype='Text']") self.advanced_question = (By.XPATH, "//a[@data-qtype='Geopoint'][contains(.,'Advanced')]") self.location_question = (By.XPATH, "//a[@data-qtype='Geopoint'][contains(.,'GPS')]") @@ -187,6 +187,16 @@ def form_xml_download_upload(self): self.wait_for_element(self.download_xml) self.click(self.download_xml) wait_for_download_to_finish(file_extension=".xml") + time.sleep(5) + newest_file = latest_download_file(".xml") + if 'xml' in newest_file: + file_that_was_downloaded = PathSettings.DOWNLOAD_PATH / newest_file + else: + print("Not the expected file. Downloading again...") + self.js_click(self.download_xml) + wait_for_download_to_finish() + newest_file = latest_download_file(".xml") + file_that_was_downloaded = PathSettings.DOWNLOAD_PATH / newest_file print("XML downloaded successfully") time.sleep(4) self.wait_to_click(self.add_form_button) @@ -200,8 +210,6 @@ def form_xml_download_upload(self): self.click(self.actions_tab) self.wait_for_element(self.upload_xml) self.click(self.upload_xml) - newest_file = latest_download_file(".xml") - file_that_was_downloaded = PathSettings.DOWNLOAD_PATH / newest_file print(f"file_that_was_downloaded: {file_that_was_downloaded}") self.send_keys(self.choose_file, str(file_that_was_downloaded)) self.wait_to_click(self.upload) diff --git a/HQSmokeTests/testPages/data/data_dictionary_page.py b/HQSmokeTests/testPages/data/data_dictionary_page.py index c4ac61682..da9e8252f 100644 --- a/HQSmokeTests/testPages/data/data_dictionary_page.py +++ b/HQSmokeTests/testPages/data/data_dictionary_page.py @@ -6,8 +6,7 @@ from common_utilities.generate_random_string import fetch_random_string from common_utilities.selenium.base_page import BasePage from common_utilities.path_settings import PathSettings -from HQSmokeTests.testPages.users.org_structure_page import latest_download_file - +from HQSmokeTests.testPages.users.org_structure_page import latest_download_file, wait_for_download_to_finish """"Contains test page elements and functions related to data dictionary module""" @@ -40,7 +39,14 @@ def export_data_dictionary(self): self.click(self.export_button) time.sleep(2) newest_file = latest_download_file() - self.assert_downloaded_file(newest_file, "data_dictionary"), "Download Not Completed!" + if 'data_dictionary' in newest_file: + self.assert_downloaded_file(newest_file, "data_dictionary"), "Download Not Completed!" + else: + print("Not the expected file. Downloading again...") + self.js_click(self.export_button) + wait_for_download_to_finish() + newest_file = latest_download_file() + self.assert_downloaded_file(newest_file, "data_dictionary"), "Download Not Completed!" print("File download successful") except TimeoutException: print("TIMEOUT ERROR: Still preparing for download..Celery might be down..") diff --git a/HQSmokeTests/testPages/messaging/messaging_page.py b/HQSmokeTests/testPages/messaging/messaging_page.py index 8e3e30f2e..11a63f67a 100644 --- a/HQSmokeTests/testPages/messaging/messaging_page.py +++ b/HQSmokeTests/testPages/messaging/messaging_page.py @@ -287,7 +287,14 @@ def cond_alert_download(self): def cond_alert_upload(self): newest_file = latest_download_file() - file_that_was_downloaded = PathSettings.DOWNLOAD_PATH / newest_file + if 'Alerts' in newest_file: + file_that_was_downloaded = PathSettings.DOWNLOAD_PATH / newest_file + else: + print("Not the expected file. Downloading again...") + self.js_click(self.download_id) + wait_for_download_to_finish() + newest_file = latest_download_file() + file_that_was_downloaded = PathSettings.DOWNLOAD_PATH / newest_file self.send_keys(self.choose_file, str(file_that_was_downloaded)) self.wait_to_click(self.upload) self.wait_for_element(self.upload_success_message) diff --git a/HQSmokeTests/testPages/users/mobile_workers_page.py b/HQSmokeTests/testPages/users/mobile_workers_page.py index a209328fe..f551ea45c 100644 --- a/HQSmokeTests/testPages/users/mobile_workers_page.py +++ b/HQSmokeTests/testPages/users/mobile_workers_page.py @@ -467,7 +467,14 @@ def download_mobile_worker(self): assert False # verify_downloaded_workers newest_file = latest_download_file() - self.assert_downloaded_file(newest_file, "_users_"), "Download Not Completed!" + if '_users_' in newest_file: + self.assert_downloaded_file(newest_file, "_users_"), "Download Not Completed!" + else: + print("Not the expected file. Downloading again...") + self.js_click(self.download_users_btn) + wait_for_download_to_finish() + newest_file = latest_download_file() + self.assert_downloaded_file(newest_file, "_users_"), "Download Not Completed!" print("File download successful") return newest_file diff --git a/HQSmokeTests/testPages/users/org_structure_page.py b/HQSmokeTests/testPages/users/org_structure_page.py index 08e1dab27..fb7f3b0d1 100644 --- a/HQSmokeTests/testPages/users/org_structure_page.py +++ b/HQSmokeTests/testPages/users/org_structure_page.py @@ -223,7 +223,14 @@ def download_locations(self): assert False # verify_downloaded_location newest_file = latest_download_file() - self.assert_downloaded_file(newest_file, "_locations"), "Download not completed!" + if '_locations' in newest_file: + self.assert_downloaded_file(newest_file, "_locations"), "Download Not Completed!" + else: + print("Not the expected file. Downloading again...") + self.js_click(self.download_loc_btn) + wait_for_download_to_finish() + newest_file = latest_download_file() + self.assert_downloaded_file(newest_file, "_locations"), "Download Not Completed!" print("File download successful") def upload_locations(self): diff --git a/HQSmokeTests/testPages/users/web_user_page.py b/HQSmokeTests/testPages/users/web_user_page.py index d9fa46eff..31e0b97c0 100644 --- a/HQSmokeTests/testPages/users/web_user_page.py +++ b/HQSmokeTests/testPages/users/web_user_page.py @@ -162,7 +162,14 @@ def download_web_users(self): # verify_downloaded_workers newest_file = latest_download_file() print(newest_file) - self.assert_downloaded_file(newest_file, "_users_"), "Download Not Completed!" + if '_users_' in newest_file: + self.assert_downloaded_file(newest_file, "_users_"), "Download Not Completed!" + else: + print("Not the expected file. Downloading again...") + self.js_click(self.download_users_btn) + wait_for_download_to_finish() + newest_file = latest_download_file() + self.assert_downloaded_file(newest_file, "_users_"), "Download Not Completed!" print("File download successful") def upload_web_users(self): From c4394816e45a274abf209961d9bea0f448a22d8a Mon Sep 17 00:00:00 2001 From: Kankana Bordoloi Date: Thu, 12 Jun 2025 18:47:27 +0530 Subject: [PATCH 2/4] QA-7808 fixes for import cases and case search --- .../test_cases/test_02_casesearch_configs.py | 1 + .../test_05_casesearch_inline_search.py | 3 +++ .../test_07_casesearch_data_registry.py | 2 +- .../test_05_casesearch_inline_search.py | 3 +++ .../testCases/test_07_applications.py | 1 + .../applications/application_page.py | 14 +++++++------- .../testPages/data/import_cases_page.py | 1 - HQSmokeTests/testPages/users/web_user_page.py | 2 ++ .../userInputs/test_data/reassign_cases.xlsx | Bin 8473 -> 8465 bytes common_utilities/selenium/base_page.py | 2 ++ common_utilities/selenium/webapps.py | 2 ++ 11 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Features/CaseSearch/test_cases/test_02_casesearch_configs.py b/Features/CaseSearch/test_cases/test_02_casesearch_configs.py index 01c2522fe..5eed05220 100644 --- a/Features/CaseSearch/test_cases/test_02_casesearch_configs.py +++ b/Features/CaseSearch/test_cases/test_02_casesearch_configs.py @@ -405,6 +405,7 @@ def test_case_15_sticky_search_without_default_value(driver, settings): casesearch.search_against_property(search_property=CaseSearchUserInput.mood, input_value=CaseSearchUserInput.four, property_type=TEXT_INPUT) + time.sleep(2) casesearch.search_against_property(search_property=CaseSearchUserInput.rating, input_value=CaseSearchUserInput.three_star, property_type=COMBOBOX) diff --git a/Features/CaseSearch/test_cases/test_05_casesearch_inline_search.py b/Features/CaseSearch/test_cases/test_05_casesearch_inline_search.py index 2a97d58d8..c8733afbf 100644 --- a/Features/CaseSearch/test_cases/test_05_casesearch_inline_search.py +++ b/Features/CaseSearch/test_cases/test_05_casesearch_inline_search.py @@ -1,3 +1,5 @@ +import time + from Features.CaseSearch.test_pages.casesearch_page import CaseSearchWorkflows from Features.CaseSearch.user_inputs.casesearch_user_inputs import CaseSearchUserInput from common_utilities.selenium.webapps import WebApps @@ -60,6 +62,7 @@ def test_case_03_search_property_settings(driver, settings): casesearch.search_against_property(search_property=CaseSearchUserInput.rating, input_value=CaseSearchUserInput.four_star, property_type=COMBOBOX) + time.sleep(2) casesearch.search_against_property(search_property=CaseSearchUserInput.rating, input_value=CaseSearchUserInput.five_star, property_type=COMBOBOX, diff --git a/Features/CaseSearch/test_cases/test_07_casesearch_data_registry.py b/Features/CaseSearch/test_cases/test_07_casesearch_data_registry.py index e74ecdeef..e0d079a5e 100644 --- a/Features/CaseSearch/test_cases/test_07_casesearch_data_registry.py +++ b/Features/CaseSearch/test_cases/test_07_casesearch_data_registry.py @@ -201,7 +201,7 @@ def test_case_08_smart_link_search_first_shadow(driver, settings): print("casesearch-1 present in url") webapps.submit_the_form() - +@pytest.mark.skip def test_case_09_smart_link_skip_default_shadow(driver, settings): webapps = WebApps(driver, settings) casesearch = CaseSearchWorkflows(driver) diff --git a/Features/SplitScreenCaseSearch/test_cases/test_05_casesearch_inline_search.py b/Features/SplitScreenCaseSearch/test_cases/test_05_casesearch_inline_search.py index 0080179d5..5cd188a01 100644 --- a/Features/SplitScreenCaseSearch/test_cases/test_05_casesearch_inline_search.py +++ b/Features/SplitScreenCaseSearch/test_cases/test_05_casesearch_inline_search.py @@ -1,3 +1,5 @@ +import time + from Features.CaseSearch.test_pages.casesearch_page import CaseSearchWorkflows from Features.CaseSearch.user_inputs.casesearch_user_inputs import CaseSearchUserInput from common_utilities.selenium.webapps import WebApps @@ -59,6 +61,7 @@ def test_case_03_search_property_settings(driver, settings): casesearch.search_against_property(search_property=CaseSearchUserInput.rating, input_value=CaseSearchUserInput.four_star, property_type=COMBOBOX) + time.sleep(2) casesearch.search_against_property(search_property=CaseSearchUserInput.rating, input_value=CaseSearchUserInput.five_star, property_type=COMBOBOX, diff --git a/HQSmokeTests/testCases/test_07_applications.py b/HQSmokeTests/testCases/test_07_applications.py index cdc80df98..9807e5026 100644 --- a/HQSmokeTests/testCases/test_07_applications.py +++ b/HQSmokeTests/testCases/test_07_applications.py @@ -49,6 +49,7 @@ def test_case_37_form_xml_download_upload(driver): 3. Ensure this new form is a copy of the original form """ load = ApplicationPage(driver) + load.create_new_application() load.form_xml_download_upload() diff --git a/HQSmokeTests/testPages/applications/application_page.py b/HQSmokeTests/testPages/applications/application_page.py index 85655f320..4caa0bb5f 100644 --- a/HQSmokeTests/testPages/applications/application_page.py +++ b/HQSmokeTests/testPages/applications/application_page.py @@ -186,17 +186,17 @@ def form_xml_download_upload(self): self.js_click(self.actions_tab) self.wait_for_element(self.download_xml) self.click(self.download_xml) - wait_for_download_to_finish(file_extension=".xml") + file_name=wait_for_download_to_finish(file_extension=".xml") time.sleep(5) - newest_file = latest_download_file(".xml") - if 'xml' in newest_file: - file_that_was_downloaded = PathSettings.DOWNLOAD_PATH / newest_file + # newest_file = latest_download_file(".xml") + if 'xml' in file_name: + file_that_was_downloaded = PathSettings.DOWNLOAD_PATH / file_name else: print("Not the expected file. Downloading again...") self.js_click(self.download_xml) - wait_for_download_to_finish() - newest_file = latest_download_file(".xml") - file_that_was_downloaded = PathSettings.DOWNLOAD_PATH / newest_file + file_name = wait_for_download_to_finish(file_extension=".xml") + # newest_file = latest_download_file(".xml") + file_that_was_downloaded = PathSettings.DOWNLOAD_PATH / file_name print("XML downloaded successfully") time.sleep(4) self.wait_to_click(self.add_form_button) diff --git a/HQSmokeTests/testPages/data/import_cases_page.py b/HQSmokeTests/testPages/data/import_cases_page.py index a1b3e435e..47f17a8c1 100644 --- a/HQSmokeTests/testPages/data/import_cases_page.py +++ b/HQSmokeTests/testPages/data/import_cases_page.py @@ -40,7 +40,6 @@ def replace_property_and_upload(self): self.wait_for_element(self.choose_file) print(str(self.renamed_file)) self.send_keys(self.choose_file, self.renamed_file) - self.wait_for_element(self.next_step) self.click(self.next_step) self.is_visible_and_displayed(self.case_type) diff --git a/HQSmokeTests/testPages/users/web_user_page.py b/HQSmokeTests/testPages/users/web_user_page.py index 31e0b97c0..027aa2a09 100644 --- a/HQSmokeTests/testPages/users/web_user_page.py +++ b/HQSmokeTests/testPages/users/web_user_page.py @@ -84,6 +84,8 @@ def invite_new_web_user(self, role): self.wait_to_clear_and_send_keys(self.email_input, UserData.yahoo_user_name) self.select_by_value(self.select_project_role_id, role) self.wait_to_click(self.send_invite) + print("Waiting for sometime for the status to get updated...") + time.sleep(5) def assert_invitation_sent(self): time.sleep(2) diff --git a/HQSmokeTests/userInputs/test_data/reassign_cases.xlsx b/HQSmokeTests/userInputs/test_data/reassign_cases.xlsx index 902e7c6a9e0b60c162b98d284948ca62d3048f18..9808474ab039bd0dfa572f4ffd973d96376048d6 100644 GIT binary patch delta 2134 zcmY+Fc`zG_6UP(x5qDhCkk%2cQnyxHXRECU`iSbQyKYH6O6!iGZi+bTF3)p?5EH7X zeir-xc&V4o9X=C{;{*OJ3F&8``Pd27^E5yd)ct^8qx}lOaOoe8vwuu z0008eSDt(OdO3M}dnpBA(504?Cv(dDq4pl99oxaLxU+`Ji(i{tmQv%X({>k7Jt}`w zCi=gc0#U~dC|nN_xIz|~kTmlRaa~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>%3TM%zMvsA<5q3 zo#AtLvgzlqoQ#s*1y{!e$!v)EI{hh|G9k~T>-=xR@SJ(rs_p|`P}%!J;^Q+byTI<= z37ec@-EsM1qpFhre@&0q2z%Z&>7_ZX{iE|)rSJ=PSrHF)Nk8*qkx@3E_4V^h!7jWQ zlPH$oL4%Bd9-NY{JeSU`yN%B{l_D|p8#!CaR00028lT8>Me@$+KKn#WVm3jv>douha6e=K#NJ=($rVt{p~f(MZgY7ff)%au_B9e{rFHa zyTH#9S7LB(dX|#A0WI)hoRGY78D|U5w{tIfnh_Kah|U_BL{TO!e`pdxH!kG--dF?+ z>CXjU?w}BL$+|9G-2tOkrF3;EZ{$u1ENOV|NjF3P)h>@lbZty1s{^;Ku5Dy86*LJjFLf1!!Q_z?}GoK%TW`x4NMRp_k@;^Yr;XnlBHkj=sP;+2{h1Bt;Qu-Uz9;1$wPk z@g0hsXIikj(NLfc99ovwS2;J7Hx{04W59X|E(#>=C^rS#d2cAjj_*J*mxP86;ij>F ziuv$rx7aZL$+m#AG`+zJJQK__+yi4X5z!GT_=GfjTMq!iG1Q0&8y}M9Kt}-p0AT_E k01*HH00000000000000{lc^v+0nd}@AR`8Y9smFU0R8FQ9RL6T diff --git a/common_utilities/selenium/base_page.py b/common_utilities/selenium/base_page.py index e7478f33b..5cadd892e 100644 --- a/common_utilities/selenium/base_page.py +++ b/common_utilities/selenium/base_page.py @@ -594,11 +594,13 @@ def _is_jquery_present(self): def back(self): try: self.driver.back() + self.wait_after_interaction(timeout=20) print("[INFO] Navigated back using driver.back()") except WebDriverException as e: print(f"[WARNING] driver.back() failed: {e}. Trying JavaScript fallback...") try: self.driver.execute_script("window.history.back();") + self.wait_after_interaction(timeout=20) print("[INFO] Navigated back using JavaScript") except Exception as js_e: print(f"[ERROR] JavaScript fallback also failed: {js_e}") diff --git a/common_utilities/selenium/webapps.py b/common_utilities/selenium/webapps.py index a0319950e..d95756f5e 100644 --- a/common_utilities/selenium/webapps.py +++ b/common_utilities/selenium/webapps.py @@ -221,6 +221,7 @@ def continue_to_forms(self): def select_case_and_continue(self, case_name): self.select_case(case_name) self.continue_to_forms() + self.wait_after_interaction(timeout=20) self.wait_for_element(self.content_container, timeout=30) form_names = self.find_elements_texts(self.form_names) return form_names @@ -364,6 +365,7 @@ def go_to_page(self, page_number): def open_data_preview(self): self.wait_to_click(self.data_preview) + time.sleep(5) def present_in_data_preview(self, value): value_in_data_preview = self.get_element(self.value_in_data_preview, value) From b91afe514034e4039daf5f08de127a98dda4e7c3 Mon Sep 17 00:00:00 2001 From: Kankana Bordoloi Date: Thu, 12 Jun 2025 19:26:22 +0530 Subject: [PATCH 3/4] QA-7808 fix for export form data --- HQSmokeTests/testPages/data/export_data_page.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/HQSmokeTests/testPages/data/export_data_page.py b/HQSmokeTests/testPages/data/export_data_page.py index 37d4d9499..3ec869880 100644 --- a/HQSmokeTests/testPages/data/export_data_page.py +++ b/HQSmokeTests/testPages/data/export_data_page.py @@ -78,6 +78,7 @@ def __init__(self, driver): self.web_users_option = (By.XPATH, "//li/span[.='[Web Users]']") self.all_data_option = (By.XPATH, "//li/span[.='[All Data]']") self.users_field = (By.XPATH, "(//textarea[@class='select2-search__field'])[1]") + self.user_selected = "//span[contains(@class, 'choice') and .='{}']" self.users_list_item = "//ul[@role='listbox']/li[contains(.,'{}')]" self.users_list = (By.XPATH, "//ul[contains(@class,'select2-results__options')]/li") self.user_from_list = "//li[contains(.,'{}')]" @@ -199,8 +200,12 @@ def prepare_and_download_export(self, name, flag=None): time.sleep(2) self.date_filter() if flag == None: - self.send_keys(self.users_field, UserData.web_user) - self.wait_to_click((By.XPATH, self.users_list_item.format(UserData.web_user))) + if not self.is_present((By.XPATH, self.user_selected.format(UserData.web_user))): + print("Web User option is not already selected") + self.send_keys(self.users_field, UserData.web_user) + self.wait_to_click((By.XPATH, self.users_list_item.format(UserData.web_user))) + else: + print("Web User option is already selected") self.wait_and_sleep_to_click(self.prepare_export_button, timeout=10) try: self.wait_till_progress_completes("exports") From bd08ac7235ea97cc15a3d1b6fc0b0ed911418d48 Mon Sep 17 00:00:00 2001 From: Kankana Bordoloi Date: Thu, 12 Jun 2025 19:41:55 +0530 Subject: [PATCH 4/4] QA-7808 fix for import cases --- HQSmokeTests/testPages/data/import_cases_page.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/HQSmokeTests/testPages/data/import_cases_page.py b/HQSmokeTests/testPages/data/import_cases_page.py index 47f17a8c1..36e08845d 100644 --- a/HQSmokeTests/testPages/data/import_cases_page.py +++ b/HQSmokeTests/testPages/data/import_cases_page.py @@ -41,6 +41,14 @@ def replace_property_and_upload(self): print(str(self.renamed_file)) self.send_keys(self.choose_file, self.renamed_file) self.wait_for_element(self.next_step) + if self.is_present(self.alert_msg): + print("Upload might have failed. Reuploading...") + self.reload_page() + self.wait_for_element(self.choose_file) + self.send_keys(self.choose_file, self.renamed_file) + self.wait_for_element(self.next_step) + else: + print("Upload successful.") self.click(self.next_step) self.is_visible_and_displayed(self.case_type) self.select_by_text(self.case_type, UserData.case_pregnancy)