Skip to content

Commit

Permalink
QA-7156 fix for data dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
kbo001 committed Oct 15, 2024
1 parent 4a32a29 commit 18ceb09
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions HQSmokeTests/testPages/data/data_dictionary_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,35 @@ def __init__(self, driver):
self.dictionary_description = "Test dictionary"

self.data_dictionary_link = (By.LINK_TEXT, "Data Dictionary")
self.export_button = (By.ID, "download-dict")
self.export_button = (By.XPATH, "//a[contains(@href,'export')]/i[contains(@class,'fa-cloud')]")
self.import_button = (By.XPATH, "//a[contains(@href,'import')]/i[contains(@class,'fa-cloud')]")
self.choose_file = (By.XPATH, "//input[@data-bind ='value: file']")
self.upload = (By.XPATH, "//button[@data-bind ='disable: !file()']")
self.success_message = (By.XPATH , "//div[@class= 'alert alert-margin-top fade in alert-success']")


def open_data_dictionary_case_page(self):
self.click(self.data_dictionary_link)
self.wait_to_click(self.data_dictionary_link)
print("waiting for page to load completely....")
time.sleep(20)

def export_data_dictionary(self):
try:
self.wait_to_click(self.export_button)
time.sleep(5)
self.wait_for_element(self.export_button)
self.js_click(self.export_button)
time.sleep(6)
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..")
assert False
newest_file = latest_download_file()
self.assert_downloaded_file(newest_file, "data_dictionary"), "Download Not Completed!"
print("File download successful")


def import_data_dictionary(self):
try:
self.wait_to_click(self.import_button)
self.wait_for_element(self.import_button)
self.js_click(self.import_button)
newest_file = latest_download_file()
file_that_was_downloaded = PathSettings.DOWNLOAD_PATH / newest_file
time.sleep(5)
Expand Down

0 comments on commit 18ceb09

Please sign in to comment.