Skip to content

Commit

Permalink
Merge pull request #343 from dimagi/QA-6520-script-fix-bs-url-update-…
Browse files Browse the repository at this point in the history
…and-case-search-locator-updates

QA-6520 removed xfail tags from CS and SSCS tests, fixed BHA test
  • Loading branch information
kbo001 committed Jun 5, 2024
2 parents 9daa6c5 + eed1c91 commit 281d007
Show file tree
Hide file tree
Showing 7 changed files with 276 additions and 138 deletions.
6 changes: 0 additions & 6 deletions Features/CaseSearch/test_cases/test_02_casesearch_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,6 @@ def test_case_17_required_property(driver, settings):


def test_case_18_conditionally_required_condition_property(driver, settings):
if 'staging' in settings['url']:
pytest.xfail('https://dimagi.atlassian.net/browse/QA-6631')
webapps = WebApps(driver, settings)
casesearch = CaseSearchWorkflows(driver)
"""Check conditionally required condition property"""
Expand Down Expand Up @@ -610,8 +608,6 @@ def test_case_23_dependent_dropdowns_value_clear(driver, settings):


def test_case_24_case_search_validations(driver, settings):
# if 'staging' in settings['url']:
# pytest.xfail('https://dimagi.atlassian.net/browse/QA-6600')
webapps = WebApps(driver, settings)
casesearch = CaseSearchWorkflows(driver)
"""Case Search Validations"""
Expand Down Expand Up @@ -665,8 +661,6 @@ def test_case_24_case_search_validations(driver, settings):


def test_case_25_case_search_validations_dot_notations(driver, settings):
# if 'staging' in settings['url']:
# pytest.xfail('https://dimagi.atlassian.net/browse/QA-6600')
webapps = WebApps(driver, settings)
casesearch = CaseSearchWorkflows(driver)
"""Case Search Validations"""
Expand Down
3 changes: 2 additions & 1 deletion Features/CaseSearch/test_pages/casesearch_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def check_default_values_displayed(self, search_property, default_value, search_
assert self.is_visible_and_displayed(search_property)

def search_against_property(self, search_property, input_value, property_type, include_blanks=None):
print(input_value)
print("Providing value: ", input_value)
if property_type == TEXT_INPUT:
self.search_property = self.get_element(self.search_against_text_property_format, search_property)
self.wait_to_click(self.search_property)
Expand Down Expand Up @@ -133,6 +133,7 @@ def check_date_range(self, search_property, date_range):
date_element = (By.XPATH, self.date_selected.format(date_range, date_range))
self.search_property = self.get_element(self.search_against_text_property_format, search_property)
value = self.get_attribute(self.search_property, 'value')
print('date range: ', date_range)
print('value: ', value)
print(date_element)
assert self.is_present(date_element) or value == date_range
Expand Down
391 changes: 261 additions & 130 deletions Features/SplitScreenCaseSearch/test_cases/test_02_casesearch_configs.py

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions USH_Apps/CO_BHA/test_cases/test_01_admit_client_and_locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ def test_case_02_admit_case_2(driver, settings):
app.select_clinic(BhaUserInput.aurora_therapy_center)
webapps.submit_the_form()
"""Check if case present in pending requests menu"""
webapps.login_as(BhaUserInput.state_level_user)
webapps.open_app(BhaUserInput.bha_app_name)
webapps.open_menu(BhaUserInput.pending_requests)
casesearch.search_against_property(search_property=BhaUserInput.name,
input_value=typo_first_name + " " + typo_last_name,
Expand Down Expand Up @@ -148,6 +150,7 @@ def test_case_04_lock_in_1_2(driver, settings):
casesearch.search_against_property(search_property=BhaUserInput.case_name,
input_value=full_name,
property_type=TEXT_INPUT)
webapps.search_button_on_case_search_page()
webapps.select_case(full_name)
app.select_radio(BhaUserInput.approve)
app.check_answer_options(label=BhaUserInput.lock_out_confirmation, displayed=YES)
Expand Down
3 changes: 3 additions & 0 deletions USH_Apps/CO_BHA/test_pages/bha_app_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def replace_one_char(self, original_string):
def select_radio(self, value):
radio_value = self.get_element(self.radio_option_value, value)
self.js_click(radio_value)
time.sleep(4)

def check_search_properties_present(self, properties):
properties_labels = self.find_elements_texts(self.case_search_properties)
Expand All @@ -60,10 +61,12 @@ def check_client_info_on_form(self, search_property, search_value):
def select_clinic(self, clinic_name):
if self.is_displayed(self.combobox_select_clinic):
self.select_by_text(self.combobox_select_clinic, clinic_name)
time.sleep(4)

def remove_clinic(self, clinic_name):
close_xpath = self.get_element(self.clinic_close_button, clinic_name)
self.js_click(close_xpath)
time.sleep(4)

def check_answer_options(self, label, displayed=None):
answer_label = self.get_element(self.answer_option_label, label)
Expand Down
6 changes: 5 additions & 1 deletion common_utilities/selenium/base_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def get_element(self, xpath_format, insert_value):
return element

def wait_for_ajax(self):
wait = WebDriverWait(self.driver, 700)
wait = WebDriverWait(self.driver, 300)
wait.until(lambda driver: self.driver.execute_script('return jQuery.active') == 0)
wait.until(lambda driver: self.driver.execute_script('return document.readyState') == 'complete')

Expand Down Expand Up @@ -415,3 +415,7 @@ def select_multiple_by_text(self, source_locator, value_list):
for value in value_list:
select_source.select_by_visible_text(value)
ActionChains(self.driver).key_up(Keys.CONTROL).perform()

def reload_page(self):
self.driver.refresh()
time.sleep(5)
2 changes: 2 additions & 0 deletions common_utilities/selenium/webapps.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def clear_selections_on_case_search_page(self):
time.sleep(2)
self.js_click(self.clear_case_search_page)
self.wait_for_ajax()
time.sleep(5)

def search_button_on_case_search_page(self, enter_key=None):
if enter_key == YES:
Expand Down Expand Up @@ -187,6 +188,7 @@ def select_case_and_continue(self, case_name):
def submit_the_form(self):
self.wait_for_element(self.form_submit)
self.js_click(self.form_submit)
time.sleep(5)
try:
assert self.is_visible_and_displayed(self.form_submission_successful, timeout=500)
except AssertionError:
Expand Down

0 comments on commit 281d007

Please sign in to comment.