def validate_statistics_by_stages(user_content): # Validate Scrolling # FEOverview.click_on_vf(user_content) Click.id(Constants.Dashboard.Statuses.ID) Wait.text_by_id("dashboard-title", "Statuses") Wait.css(Constants.Dashboard.Statuses.Statistics.FilterDropdown.CSS) Select( session.ice_driver.find_element_by_css_selector( Constants.Dashboard.Statuses.Statistics.FilterDropdown.CSS) ).select_by_visible_text("All") engLeadID = DBUser.select_user_native_id(user_content['el_email']) countOfEngInStagePerUser = DBUser.select_all_user_engagements( engLeadID) # Scroll # Wait.text_by_id( Constants.Dashboard.Statuses.Statistics.EngagementsNumber.ID, str(countOfEngInStagePerUser), wait_for_page=True) element = session.ice_driver.find_element_by_id( Constants.Dashboard.Statuses.Statistics.EngagementsNumber.ID) # Stage Active Validation # element.location_once_scrolled_into_view Wait.css(Constants.Dashboard.Statuses.Statistics.FilterDropdown.CSS, wait_for_page=True) Select( session.ice_driver.find_element_by_css_selector( Constants.Dashboard.Statuses.Statistics.FilterDropdown.CSS) ).select_by_visible_text("Active") countOfEngInStagePerUser = DBUser.select_user_engagements_by_stage( "Active", engLeadID) Wait.text_by_id( Constants.Dashboard.Statuses.Statistics.EngagementsNumber.ID, str(countOfEngInStagePerUser), wait_for_page=True)
def test_search_bar(self): """ Create user and VF, log in, add VFC, search by EID, VF and VFC """ vfFullName = self.user_content[ 'engagement_manual_id'] + ": " + self.user_content['vfName'] try: Enter.text_by_id( Constants.Dashboard.LeftPanel.SearchBox.ID, self.user_content['vfName']) Wait.css(Constants.Dashboard.LeftPanel.SearchBox.Results.CSS) Click.css(Constants.Dashboard.LeftPanel.SearchBox.Results.CSS) Wait.text_by_id( Constants.Dashboard.Overview.Title.ID, vfFullName) except BaseException: errorMsg = "Failed to search by VF name." raise Exception(errorMsg) try: Enter.text_by_id( Constants.Dashboard.LeftPanel.SearchBox.ID, self.user_content['engagement_manual_id']) Enter.text_by_id( Constants.Dashboard.LeftPanel.SearchBox.ID, self.user_content['engagement_manual_id']) Wait.css(Constants.Dashboard.LeftPanel.SearchBox.Results.CSS) Click.css(Constants.Dashboard.LeftPanel.SearchBox.Results.CSS) Wait.text_by_id( Constants.Dashboard.Overview.Title.ID, vfFullName) except BaseException: errorMsg = "Failed to search by Engagement Manual ID." raise Exception(errorMsg) Frontend.Overview.click_on_vf(self.user_content) detailedViewID = Constants.Dashboard.DetailedView.ID + vfFullName Wait.text_by_id(detailedViewID, "Detailed View", wait_for_page=True) Click.id(detailedViewID, wait_for_page=True) Click.id( Constants.Dashboard.DetailedView.VFC.Add.ID, wait_for_page=True) vfcName = Helper.rand_string("randomString") extRefID = Helper.rand_string("randomNumber") Enter.text_by_name("name", vfcName) Enter.text_by_name("extRefID", extRefID, wait_for_page=True) Select(session.ice_driver.find_element_by_id( Constants.Dashboard.DetailedView.VFC.Choose_Company.ID)).\ select_by_visible_text(self.user_content['vendor']) Click.id( Constants.Dashboard.DetailedView.VFC.Save_button.ID, wait_for_page=True) try: Enter.text_by_id( Constants.Dashboard.LeftPanel.SearchBox.ID, vfcName, wait_for_page=True) Click.id( "search-" + self.user_content['vfName'], wait_for_page=True) Wait.id("clickable-" + vfFullName, wait_for_page=True) except Exception as e: errorMsg = "Failed to search by VFC name." raise Exception(errorMsg + str(e))
def add_feedback(): Wait.css("textarea[name=\"description\"]", wait_for_page=True) description = Helper.rand_string("randomString") Enter.text_by_css("textarea[name=\"description\"]", description) Click.id(Constants.Dashboard.Feedback.FeedbackModal.SAVE_BTN_ID, wait_for_page=True) Wait.text_by_id(Constants.Toast.ID, "Feedback was sent successfully.", wait_for_page=True) return description
def drag_and_drop_by_css(source_css, xoffset, yoffset): ns = session.ice_driver.find_element_by_id("step-description-1") ActionChains(session.ice_driver).move_to_element(ns).perform() Wait.css(source_css) source_element = session.ice_driver.find_element_by_css_selector( source_css) ActionChains( session.ice_driver).drag_and_drop_by_offset( source_element, xoffset, yoffset).perform()
def css(element_css, wait_for_page=False): try: if wait_for_page: Wait.page_has_loaded() Wait.css(element_css) session.ice_driver.find_element_by_css_selector( element_css).click() # If failed - count the failure and add the error to list of errors. except Exception as e: errorMsg = "Failed to click_on on CSS Selector " + element_css raise Exception(errorMsg, e)
def by_css(attr_css_value, wait_for_page=False): try: if wait_for_page: Wait.page_has_loaded() Wait.css(attr_css_value) return session.ice_driver.find_element_by_css_selector( attr_css_value).text # If failed - count the failure and add the error to list of errors. except Exception: errorMsg = "Failed to get text of element " + attr_css_value raise Exception(errorMsg, attr_css_value)
def edit_description_lineitem_and_save(): desc = Helper.rand_string("randomString") Click.id(Constants.Dashboard.LeftPanel.EditChecklistTemplate. FIRST_LINE_ITEM_ID) Click.id(Constants.Dashboard.LeftPanel.EditChecklistTemplate. EDIT_LINE_ITEM_BTN) Enter.text_by_id( Constants.Dashboard.LeftPanel.EditChecklistTemplate. EDIT_LINE_ITEM_NAME, Helper.rand_string("randomString")) Click.id(Constants.Dashboard.LeftPanel.EditChecklistTemplate. EDIT_LINE_ITEM_DESC) editor_element = Get.wysiwyg_element_by_id( Constants.Dashboard.LeftPanel.EditChecklistTemplate. LINE_ITEM_DESC_TEXT_BOX) editor_element.clear() editor_element.send_keys(desc) Wait.page_has_loaded() actionChains = ActionChains(session.ice_driver) actionChains.double_click(editor_element).perform() Wait.page_has_loaded() Click.xpath(Constants.Dashboard.LeftPanel.EditChecklistTemplate. WYSIWYG_BUTTON_BOLD) Click.id(Constants.Dashboard.LeftPanel.EditChecklistTemplate. EDIT_LINE_ITEM_BTN, wait_for_page=True) isBold = Wait.is_css_exists("b") while not isBold: Click.id(Constants.Dashboard.LeftPanel.EditChecklistTemplate. EDIT_LINE_ITEM_BTN, wait_for_page=True) actionChains.double_click(editor_element).perform() Click.xpath(Constants.Dashboard.LeftPanel.EditChecklistTemplate. WYSIWYG_BUTTON_BOLD, wait_for_page=True) Click.id(Constants.Dashboard.LeftPanel.EditChecklistTemplate. EDIT_LINE_ITEM_BTN, wait_for_page=True) isBold = Wait.is_css_exists("b") if isBold: FEChecklistTemplate.click_on_save_and_assert_success_msg() FEGeneral.refresh() Click.name(Constants.Dashboard.LeftPanel.EditChecklistTemplate.HEAT, wait_for_page=True) Click.id(Constants.Dashboard.LeftPanel.EditChecklistTemplate. FIRST_LINE_ITEM_ID, wait_for_page=True) Wait.css("b") Wait.text_by_css("b", desc, wait_for_page=True)
def add_next_step_updated(checklistName, newFileName): Click.id(Constants.Dashboard.Checklist.AddNS.ID) Wait.id(Constants.Dashboard.Modal.CLOSE_BUTTON_ID) Wait.text_by_css("span.font_header.ng-binding", "Checklist:") Wait.text_by_css("h2.ng-binding", "Add Next Steps") # First NS Click.id("description") Enter.text_by_id("description", "description of NS") Click.css("div.modal-content") Click.xpath("(//button[@type='button'])[10]") Click.link_text(newFileName) Click.css("div.modal-content") Click.xpath("(//button[@type='button'])[11]") try: Click.xpath("//div[3]/multiselect/div/ul/li/a") except BaseException: Wait.link_text("Homer Simpson") Click.link_text("Homer Simpson") Wait.css("div.modal-content") Click.css("div.modal-content") Wait.xpath("(//button[@type='button'])[12]") count = 0 FEWizard.date_picker_add_ns(count) count = +1 Click.css("span.add-text") Click.xpath("(//div[@id='description'])[2]") Enter.text_by_xpath("(//div[@id='description'])[2]", "description of NS2") Click.css("div.modal-content") Click.xpath("(//button[@type='button'])[14]") Click.xpath("(//button[@type='button'])[22]") Click.xpath("//div[3]/div/div[2]/multiselect/div/ul/li[2]/a") Click.css("div.modal-content") Click.xpath("(//button[@type='button'])[23]") Click.css("div.btn-group.open > ul.dropdown-menu > " + "li.ng-scope > a.ng-binding") Click.link_text("Add Another Next Step") Wait.xpath("(//button[@type='button'])[25]") Click.xpath("(//button[@type='button'])[25]") Wait.xpath("(//button[@type='button'])[24]") FEWizard.date_picker_add_ns(count) Wait.xpath("//div[4]/div/span") Click.xpath("//div[4]/div/span") Wait.id("btn-submit") Wait.text_by_id("btn-submit", "Submit Next Steps") Click.id("btn-submit")
def text_by_css(attr_css_value, typed_text, wait_for_page=False): # Send keys to element in UI, by CSS locator (e.g. type something in # text box). try: if wait_for_page: Wait.page_has_loaded() Wait.css(attr_css_value) session.ice_driver.find_element_by_css_selector( attr_css_value).clear() session.ice_driver.find_element_by_css_selector( attr_css_value).send_keys(typed_text[:-1]) time.sleep(session.wait_until_time_pause) session.ice_driver.find_element_by_css_selector( attr_css_value).send_keys(typed_text[-1:]) # If failed - count the failure and add the error to list of errors. except Exception: errorMsg = "Failed to type " + typed_text + " in text box" raise Exception(errorMsg, attr_css_value)
def login(email, password, expected_element=Constants.Dashboard.Statuses.Title.ID, element_type="id"): try: logger.debug("Verifying and Insert Login page elements:") logger.debug("Insert Email " + email) Wait.name(Constants.Login.Email.NAME, wait_for_page=True) Enter.text_by_name(Constants.Login.Email.NAME, email) logger.debug("Insert Password") Enter.text_by_name(Constants.Login.Password.NAME, password) logger.debug("Click Login Button") Click.css(Constants.SubmitButton.CSS) logger.debug("Login Button clicked") if element_type == 'id': Wait.id(expected_element, True) elif element_type == 'css': Wait.css(expected_element, True) # If failed - count the failure and add the error to list of errors. except Exception as e: errorMsg = "Login FAILED: email=%s password=%s" % (email, password) logger.error(errorMsg) raise Exception(errorMsg, e)
def test_current_status(self): user_content = API.VirtualFunction.create_engagement( wait_for_gitlab=False) vfName = user_content['vfName'] Frontend.User.login(user_content['email'], Constants.Default.Password.TEXT) # new Frontend.Overview.click_on_vf(user_content) Frontend.User.go_to_account() Wait.id(user_content['email']) actualFullName = Get.value_by_name("fullname") Helper.internal_assert(user_content['full_name'], actualFullName) Click.id(Constants.Dashboard.Statuses.ID) Frontend.Overview.click_on_vf(user_content) Helper.internal_assert( "Current Status", Get.by_css(Constants.Dashboard.Overview.Status.Header.ID)) Wait.text_by_id(Constants.Dashboard.Overview.Status.Description.ID, "No status update has been provided yet.") Click.id(Constants.Dashboard.Avatar.ID) Click.link_text("Logout") engLeadEmail = DB.User.select_el_email(vfName) Frontend.User.relogin(engLeadEmail, Constants.Default.Password.TEXT) Frontend.Overview.click_on_vf(user_content) Click.css(Constants.Dashboard.Overview.Status.Add.CSS) Helper.internal_assert("Add Status", Get.by_css("h3.modal-title.ng-binding")) Helper.internal_assert( "Use the form below to add the current status of the engagement.", Get.by_css("span.ng-binding")) Click.css("textarea[name=\"description\"]") Enter.text_by_css("textarea[name=\"description\"]", "Add new Status", wait_for_page=True) Helper.internal_assert( "Add status", Get.by_id(Constants.Dashboard.DetailedView.VFC.Save_button.ID)) Click.id(Constants.Dashboard.DetailedView.VFC.Save_button.ID, wait_for_page=True) Helper.assertTrue("Last updated" in Get.by_id("status-update-details")) Wait.text_by_id(Constants.Dashboard.Overview.Status.Description.ID, "Add new Status") Wait.css(Constants.Dashboard.Overview.Status.Edit.CSS) Wait.modal_to_dissappear() Click.css(Constants.Dashboard.Overview.Status.Edit.CSS) Helper.internal_assert("Current Status", Get.by_css("h3.modal-title.ng-binding")) Click.css("textarea[name=\"description\"]") Enter.text_by_css("textarea[name=\"description\"]", "Update Status") Click.id(Constants.Dashboard.DetailedView.VFC.Save_button.ID) Wait.modal_to_dissappear() Wait.text_by_id(Constants.Dashboard.Overview.Status.Description.ID, "Update Status") Frontend.User.logout() Frontend.User.relogin(user_content['email'], Constants.Default.Password.TEXT) Frontend.Overview.click_on_vf(user_content) Helper.internal_assert( "Current Status", Get.by_css(Constants.Dashboard.Overview.Status.Header.ID)) Wait.text_by_id(Constants.Dashboard.Overview.Status.Description.ID, "Update Status")
def cl_to_next_stage(actualVfNameid): Click.xpath("//div[@id='state-actions']/button", wait_for_page=True) Wait.id(actualVfNameid, wait_for_page=True) session.run_negative(lambda: Wait.css(Constants.Default.BlockUI.CSS), "Error: CL to next stage failed.")
def review_state_actions_and_validations(checklistName, vfName, state): try: # REWVIEW STEPS AND VALIDATIONS Wait.id("checklist-main-section") Wait.text_by_id(Constants.Dashboard.Checklist.Name.ID, checklistName) try: if settings.DATABASE_TYPE == 'local': Helper.internal_assert( "Section 1: Parameter Specification", Get.by_css("h2.ng-binding")) Helper.internal_assert( "Parameters", Get.by_css("span.col-md-9.ng-binding")) Helper.internal_assert("String parameters", Get.by_xpath("//li[2]/span[2]")) Helper.internal_assert("Numeric parameters", Get.by_xpath("//li[3]/span[2]")) if settings.DATABASE_TYPE == 'local': Helper.internal_assert( "Section 2: External References", Get.by_xpath("//li[2]/h2")) Helper.internal_assert("Normal references", Get.by_name("Normal references")) Helper.internal_assert("VF image", Get.by_name("Normal references")) except BaseException: try: Helper.internal_assert("Section 1: External References", Get.by_css("h2.ng-binding")) except BaseException: Helper.internal_assert("Section 1: Scaling Considerations", Get.by_css("h2.ng-binding")) try: Helper.internal_assert( "Normal references", Get.by_css("span.col-md-9.ng-binding")) except BaseException: if "VF image" in Get.by_xpath("//li[2]/span[2]"): logger.debug("All Ok") if settings.DATABASE_TYPE == 'local': Helper.internal_assert( "Section 2: Parameter Specification", Get.by_xpath("//li[2]/h2")) Click.name("VF image") Click.name("Normal references") try: Helper.internal_assert("1.1 - Parameters", Get.by_xpath("//header/h2")) except BaseException: text = Get.by_name("Normal references") Helper.internal_assert("Normal references", text) Helper.internal_assert("Audit Logs", Get.by_css("h3.col-md-12")) localLogText = "local log" Enter.text_by_id("new-audit-log-text", localLogText) Helper.internal_assert("Add Log Entry", Get.by_id("submit-new-audit-lop-text")) Click.id("submit-new-audit-lop-text") # Validate Local AuditLog engLeadFullName = DBUser.get_el_name(vfName) Helper.internal_assert( engLeadFullName, Get.by_xpath("//ul[@id='audit-log-list']/li/h4")) Helper.internal_assert( localLogText, Get.by_css(Constants.Dashboard.Checklist.AuditLog. LastLocalAuditLog.CSS)) if settings.DATABASE_TYPE == 'local': try: Helper.internal_assert( "Parameters", Get.by_xpath("//li[2]/ul/li/span[2]")) except BaseException: Helper.internal_assert( "Numeric parameters", Get.by_xpath("//li[2]/ul/li/span[2]")) Click.name("Normal references") Wait.css(Constants.Dashboard.Checklist.LineItem.Deny.CSS) Wait.css(Constants.Dashboard.Checklist.LineItem.Approve.CSS) Click.css(Constants.Dashboard.Checklist.LineItem.Approve.CSS) # NOT LOCAL if settings.DATABASE_TYPE != 'local': checklistUuid = DBChecklist.get_recent_checklist_uuid( checklistName)[0] DBChecklist.update_all_decisions_to_approve(checklistUuid) # NOT LOCAL Click.css(".line-item-row span.manual") print("click on V button approve of decision in state = " + state) try: Wait.css("li.not-relevant-btn") except BaseException: Wait.xpath("//aside/header/ul/li") if state == "review": Wait.id("edit-checklist") if state == "PEER": if settings.DATABASE_TYPE == 'local': Helper.internal_assert( "Audit Log (4)", Get.by_id(Constants.Dashboard.Checklist.AuditLog.ID)) else: Helper.internal_assert( "Audit Log (5)", Get.by_id(Constants.Dashboard.Checklist.AuditLog.ID)) if state == "review": if settings.DATABASE_TYPE == 'local': Helper.internal_assert( "Audit Log (2)", Get.by_id(Constants.Dashboard.Checklist.AuditLog.ID)) else: Helper.internal_assert( "Audit Log (3)", Get.by_id(Constants.Dashboard.Checklist.AuditLog.ID)) if state == "APPROVAL": if settings.DATABASE_TYPE == 'local': Helper.internal_assert( "Audit Log (8)", Get.by_id(Constants.Dashboard.Checklist.AuditLog.ID)) else: Helper.internal_assert( "Audit Log (9)", Get.by_id(Constants.Dashboard.Checklist.AuditLog.ID)) Click.id(Constants.Dashboard.Checklist.AuditLog.ID, wait_for_page=True) Wait.text_by_xpath("//span[2]", checklistName) Enter.text_by_xpath("//textarea", "zdfgsdyh") Click.css(Constants.SubmitButton.CSS) Wait.modal_to_dissappear() if state == "review": if settings.DATABASE_TYPE == 'local': Helper.internal_assert( "Audit Log (3)", Get.by_id(Constants.Dashboard.Checklist.AuditLog.ID)) else: Helper.internal_assert( "Audit Log (4)", Get.by_id(Constants.Dashboard.Checklist.AuditLog.ID)) if state == "PEER": if settings.DATABASE_TYPE == 'local': Helper.internal_assert( "Audit Log (5)", Get.by_id(Constants.Dashboard.Checklist.AuditLog.ID)) else: Helper.internal_assert( "Audit Log (6)", Get.by_id(Constants.Dashboard.Checklist.AuditLog.ID)) if state == "APPROVAL": if settings.DATABASE_TYPE == 'local': Helper.internal_assert( "Audit Log (9)", Get.by_id(Constants.Dashboard.Checklist.AuditLog.ID)) else: Helper.internal_assert( "Audit Log (10)", Get.by_id(Constants.Dashboard.Checklist.AuditLog.ID)) # Validate Buttons if settings.DATABASE_TYPE != 'local': FEGeneral.refresh() engagement_id = DBVirtualFunction.select_eng_uuid(vfName) engLeadEmail = DBUser.select_el_email(vfName) logger.debug("EL email: " + engLeadEmail) engagement_manual_id = DBGeneral.select_where( "engagement_manual_id", "ice_engagement", "uuid", engagement_id, 1) # Click on all default next steps myVfName = engagement_manual_id + ": " + vfName actualVfNameid = "clickable-" + myVfName Click.id(actualVfNameid) Click.id("checklist-" + checklistUuid) Helper.internal_assert("Add Next Steps", Get.by_xpath("//button[3]")) Wait.text_by_id( Constants.Dashboard.Checklist.Reject.ID, Constants.Dashboard.Checklist.Reject.Modal.Button.TEXT, wait_for_page=True) Helper.internal_assert( "Approve", Get.by_xpath("//div[@id='state-actions']/button")) logger.debug("ALL VALIDATION PASS FOR STATE: " + state) # If failed - count the failure and add the error to list of errors. except Exception as e: errorMsg = "review_state_actions_and_validations " +\ "FAILED because: " + str(e) raise Exception(errorMsg, "review_state_actions_and_validations") logger.error( state + " state FAILED CONNECT TO STAGING MANUAL AND VERIFY WHY!") raise
def approval_state_actions_and_validations(checklistName, newObj, state): # REWVIEW STEPS AND VALIDATIONS try: Wait.id("checklist-main-section") Wait.text_by_id(Constants.Dashboard.Checklist.Name.ID, checklistName) try: if settings.DATABASE_TYPE == 'local': Wait.text_by_css("h2.ng-binding", "Section 1: Parameter Specification") Helper.internal_assert( "Parameters", Get.by_css("span.col-md-9.ng-binding")) Helper.internal_assert("String parameters", Get.by_xpath("//li[2]/span[2]")) Helper.internal_assert("Numeric parameters", Get.by_xpath("//li[3]/span[2]")) if settings.DATABASE_TYPE == 'local': Helper.internal_assert( "Section 2: External References", Get.by_xpath("//li[2]/h2")) Helper.internal_assert( "Normal references", Get.by_xpath("//li[2]/ul/li/span[2]")) Helper.internal_assert( "VF image", Get.by_xpath("//li[2]/ul/li[2]/span[2]")) except BaseException: if settings.DATABASE_TYPE == 'local': Wait.text_by_css("h2.ng-binding", "Section 1: External References") try: Helper.internal_assert( "Normal references", Get.by_css("span.col-md-9.ng-binding")) except BaseException: if "VF image" in Get.by_xpath("//li[2]/span[2]"): logger.debug("All Ok") if settings.DATABASE_TYPE == 'local': Helper.internal_assert( "Section 2: Parameter Specification", Get.by_xpath("//li[2]/h2")) try: if settings.DATABASE_TYPE == 'local': Helper.internal_assert("1.1 - Parameters", Get.by_xpath("//header/h2")) except BaseException: if settings.DATABASE_TYPE == 'local': Helper.internal_assert("1.1 - Normal References", Get.by_xpath("//header/h2")) if settings.DATABASE_TYPE == 'local': elementTxt = Get.by_id("line-item-description") Helper.internal_assert( "Numeric parameters should include " + "range and/or allowed values.", elementTxt) Helper.internal_assert("Audit Logs", Get.by_css("h3.col-md-12")) localLogText = "local log" Enter.text_by_id("new-audit-log-text", localLogText) Helper.internal_assert("Add Log Entry", Get.by_id("submit-new-audit-lop-text")) Click.id("submit-new-audit-lop-text") vfName = newObj[0] DBUser.get_el_name(vfName) Helper.internal_assert( localLogText, Get.by_css(Constants.Dashboard.Checklist.AuditLog. LastLocalAuditLog.CSS)) try: if settings.DATABASE_TYPE == 'local': Helper.internal_assert( "Parameters", Get.by_xpath("//li[2]/ul/li/span[2]")) except BaseException: if settings.DATABASE_TYPE == 'local': Helper.internal_assert( "Numeric parameters", Get.by_xpath("//li[2]/ul/li/span[2]")) session.run_negative( lambda: Wait.css(Constants.Dashboard.Checklist.LineItem.Deny. CSS) or Wait.css(Constants.Dashboard.Checklist .LineItem.Approve.CSS), "Buttons displayed for Admin it's NOT work") if state == "APPROVAL": if settings.DATABASE_TYPE == 'local': Helper.internal_assert( "Audit Log (6)", Get.by_id(Constants.Dashboard.Checklist.AuditLog.ID)) else: Helper.internal_assert( "Audit Log (7)", Get.by_id(Constants.Dashboard.Checklist.AuditLog.ID)) if state == "HANDOFF": if settings.DATABASE_TYPE == 'local': Helper.internal_assert( "Audit Log (8)", Get.by_id(Constants.Dashboard.Checklist.AuditLog.ID)) else: Helper.internal_assert( "Audit Log (9)", Get.by_id(Constants.Dashboard.Checklist.AuditLog.ID)) Click.id(Constants.Dashboard.Checklist.AuditLog.ID) Wait.text_by_xpath("//span[2]", checklistName) DBUser.select_el_email(vfName) Enter.text_by_xpath("//textarea", "zdfgsdyh") Click.css(Constants.SubmitButton.CSS) Wait.modal_to_dissappear() if state == "APPROVAL": if settings.DATABASE_TYPE == 'local': Wait.text_by_id(Constants.Dashboard.Checklist.AuditLog.ID, "Audit Log (7)") else: Wait.text_by_id(Constants.Dashboard.Checklist.AuditLog.ID, "Audit Log (8)") if state == "HANDOFF": if settings.DATABASE_TYPE == 'local': Wait.text_by_id(Constants.Dashboard.Checklist.AuditLog.ID, "Audit Log (9)") else: Wait.text_by_id(Constants.Dashboard.Checklist.AuditLog.ID, "Audit Log (10)") if state == "APPROVAL": Wait.text_by_xpath("//button[3]", "Add Next Steps") Wait.text_by_id( Constants.Dashboard.Checklist.Reject.ID, Constants.Dashboard.Checklist.Reject.Modal.Button.TEXT) Wait.text_by_xpath("//div[@id='state-actions']/button", "Approve") if state == "HANDOFF": Wait.text_by_xpath("//div[@id='state-actions']/button", "Handoff complete?") logger.debug("ALL VALIDATION PASS FOR STATE : " + state) # If failed - count the failure and add the error to list of errors. except Exception as e: logger.error( state + " state FAILED CONNECT TO STAGING MANUAL AND VERIFY WHY! ") errorMsg = "approval_state_actions_and_validations " +\ "FAILED because : " + str(e) raise Exception(errorMsg, "approval_state_actions_and_validations")